Live data from Hacker News

Conversations with a six-year-old on functional programming

byorgey.wordpress.com

161–170 of 319 posts

Re: Conversations with a six-year-old on functional programming

#161

This is fantastic. Reminds me of Hofstadter's conversations between Achilles and a Tortoise. The trouble with most math I've encountered isn't the concepts, it's the quality of the abstractions we use to represent and interpret them. The best(worst) example I can think of is the Alice/Bob description of cryptographic protocols, where somebody's idea of teaching is, "let's take these symbolic representations and inste…

I disagree with your example being a bad and reason is right there in your comment: the word "protocol". From wikipedia we find that a "communication protocol is a system of rules that allow _two or more entities_ of a communications system to transmit information...", where I have underscored the essential phrase and cryptographic protocols are just a subset of communication protocols. The reason that Alice and Bob…

What about a definition of protocol that allows sending messages to yourself for recursion.

Re: Conversations with a six-year-old on functional programming

#163
post #3

What is truly astounding about this is the patience to even attempt to explain free theorems to a 6 year old. Most parents would likely answer "math" and that would be the end of it. I don't (yet) have kids, but when I do I hope I have the wherewithal to recognize and take advantage of moments like these.

I have three very inquisitive kids and I love trying to explain complex topics, like reinforcement learning, to them in a way that they can understand. The best thing I get out of it is clarity for my own understanding, or gaps/lack of clarity, so it's a valuable exercise. People don't give children enough credit for what they can really understand. I remember distinctly teaching my oldest daughter how to do a basic…

Exactly. My 4 year old sometimes surprises me like that. Last week she asked me how you can talk into a mobile phone. So I said, there's a tiny transmitter in there, and it sends the voice over waves in the air. So she's like, "OK" and I thought it went over her head.

Then yesterday she asked: "Why couldn't you call gramps when we were on the plane?" I told her that the mobile phone wasn't close enough to the receivers on the ground.

It amazed me that obviously some facts had been stewing for a week in that tiny head. And out comes another question.

Re: Conversations with a six-year-old on functional programming

#164
post #73

Earlier quoted context omitted.

Well, a linear function is a function where you can only use the parameter once when expressed in its Taylor expansion. E.g. these are not linear: x^2=x*x (used twice), exp(x)=1+x+... (used infinite times). It’s a very symbolic way of thinking about it though, and not what you usually consider an important property of linearity.

Not all linear functions possess a Taylor expansion, as not all linear functions are continuous, example: https://en.wikipedia.org/wiki/Discontinuous_linear_map But, your statement is true for all real-valued linear functions AFAIK.

You still need to worry about the domain, in general there are plenty of real valued discontinuous linear functions (or functionals) from an infinite dimensional Banach space to R.

In finite dimension however linear functions are continuous

Re: Conversations with a six-year-old on functional programming

#165
post #22

Earlier quoted context omitted.

I often tell my kids "I'll explain that when you're 16", or "you're too young for that, go out and play". This has proven to be very effective in motivating them to think for themselves, or ask someone more collaborative (s.a mom)

the more you try the less they want

Interesting quote.

Re: Conversations with a six-year-old on functional programming

#166
post #142
post #2

>\lambda x.\, 6 was also surprisingly difficult for him to guess (though he did get it right eventually). I think he was just stuck on the idea of the function doing something arithmetical to the input, and was having trouble coming up with some sort of arithmetic procedure which would result in 6 no matter what you put in! It simply hadn’t occurred to him that the machine might not care about the input. (Interesting…

I have a series of programming assignments in my introductory course that has students write simple functions in Python. One of those functions is to consume nothing and returns their (the programmer's) current age. So for example, you might write def get_my_age(): return 21 The students' reaction to this in office hours can be... interesting. I am curious how many of them actually follow the comment at the bottom of…

One of those functions is to consume nothing and returns their (the programmer's) current age.

This is - or at least might be - ambiguous. Current age as of implementation time or current age as of function invocation time? And while a result in whole years is a pretty natural and obvious choice for the age of a person in absence of an explicit requirement, it is certainly not the only sensible choice.

Re: Conversations with a six-year-old on functional programming

#167

Earlier quoted context omitted.

As a parent, I agree. One should not shy away from talking about "advanced" topics. Kids are naturally curious and bright and I think we should encourage their desire to learn and understand complex things. I worry that if you try to dumb down things for kids, they might become interested in dumb things. :) Also, as the OP mentions, it can be a fun "pedagogical challenge" to try to explain free theorems or turing com…

When my daughter was 10 we were waiting in line to checkout at a Home Depot. She asked me what was algebra. I think she had heard the older kids mention it. I responded with a question. "A plus B = 10, and A minus B = 1. What are the values of A and B?" She puzzled it over while I check out. Then her face lit up like a whole realm of knowledge had just opened up to her, and she proudly told me the answer. It's a spec…

As someone who takes pride in having solved the first 100 problems of project Euler, I am slightly ashamed to admit that I probably spent as much time as your daughter to solve that.

I got stuck thinking in integers, and quite quickly left the exercise as an oversight in writing the post (since X + y = even, X - y = odd is impossible for integers)

3 seconds into the first coffee of the day the realisation of my stupidity hit me in the face.

Re: Conversations with a six-year-old on functional programming

#168
post #124

Earlier quoted context omitted.

My problem is unschooling is that just because you’re not interested in something (as a kid) doesn’t mean you shouldn’t learn it. It’d be nice if traditional school had a better balance where personal interests could be explored in a structured and formally accepted way.

> My problem is unschooling is that just because you’re not interested in something (as a kid) doesn’t mean you shouldn’t learn it. In my experience as an unschooled child who was in constant contact with the parents of other unschooled children, and other unschooled children, if a child isn't interested in something, that almost always changes over time. One example was where one kid did not wish to learn to read, u…

This sounds great! I remember teaching myself to read before I was supposed to (very standard Belgian education), and probably as a result I was from that point on always ahead of my classmates simply because I'm very curious. I tended to read ahead for subjects that interested me, and not really bother for those that didn't. Teachers were sometimes annoyed because they really didn't understand why I could do insanely well for some subjects (or even some parts of some subjects) and do absolutely horrible for others, with no reasonable explanation for it. Especially as soon as I discovered computers and the internet, things changed rapidly as I was learning how to do things (and even program some PHP and create websites with Dreamweaver). You could basically say I unschooled myself almost right up until I finished our equivalent of high school (at 18).

And then I was royally screwed. I always had enough grades for teachers to pass me on almost all subjects, but in my last year of high school I was really stressed out about what I wanted to do at university, and stopped making an effort for a lot of subjects at high school that were suddenly going at a pace I couldn't follow in "zero interest mode". It took me two years and a detour via a central government exam to get my degree.

Then I was screwed again in my final year of university college (software development). While I did great in the actual software development courses, I couldn't get myself focused on subjects I didn't care about (because I never had to, so I had absolutely no study methods for things that don't interest me). So of course after three years when I should've had my degree, I had nothing. Even though I had been to all classes and seen everything, on some subjects I just didn't pass because they didn't interest me at all.

So I just quit and started working, which was absolutely fine. I found enough at work that interested me and I became a pretty decent developer in no time. 26 now and I'm still coding cool stuff, so I'd say it ended well.

Based on how my education went I'd say unschooling would've been a great fit, but I really wonder if an unschooled kid would be more or less likely to encounter the same problems I have. While for programming you can easily get your professional life going without a sign of a degree, for many fields that's not a possibility and you will have to study (a lot). If you've never _really_ had to just process and memorize things that don't interest you, that might get really hard. I fear that being unschooled might be great at the start, but there's a point where (for most fields) you have no choice besides going into a classic education system, and you'd be less prepared than other students...

Re: Conversations with a six-year-old on functional programming

#169

This game can be played in a group, too: https://en.wikipedia.org/wiki/Zendo_(game) > once the guesser thinks they know what the function does, the players switch roles and the person who came up with function specifies some inputs in order to test whether the guesser is able to produce the correct outputs. In Zendo when the guesser offers the wrong rule, the 'master' must tell them an (input,output) pair where the g…

If anyone wants to try, I wrote a small game like this. Input is 3 (ordered) digits, output is a Boolean. http://laurent.le-brun.eu/games/rules/

Re: Conversations with a six-year-old on functional programming

#170

Fun(ctional)! When my daughter was in 4th grade, I volunteer-taught a group of pull-out 4th–6th graders, so that she could have some peers to do math with. You might enjoy this set of math worksheets I created for them. https://www.scribd.com/document/15720543/Squarrows [EDIT: now also at https://drive.google.com/open?id=1hfzm3Rvm4xpwp_xHUKBHxuIEgf... ] I was learning category theory at the time. I gave them some ele…

This is fantastic, good job!

I'm currently teaching an introductory programming course using Python (for people who have never programmed), and the level of abstraction you are using in your worksheets inspired me to actually update the exercises on my worksheets I'm using for the course (e.g. break down concepts even further and use more repetitive tasks to actually help students get the hang of these concepts).

Thanks a lot for sharing your ideas!

Post reply on HN