>\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'm curious what you mean. Is the problem that it is a constant function, or that you are asking them to ignore parameters? Or is that missing the point, still?
Conversations with a six-year-old on functional programming
11–20 of 319 posts
Re: Conversations with a six-year-old on functional programming
#12Re: Conversations with a six-year-old on functional programming
#13Re: Conversations with a six-year-old on functional programming
#14I told him that a number X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket.
I drew 6 apples and asked whether they could be divided into buckets with an equal number of apples in each. It was immediately obvious that they could. My son circled one group of three apples, then another group of three apples.
Then I drew 7 apples. He realized that you couldn't divide 7 apples into baskets and have each basket contain the same number of apples.
Voila! A prime number.
Then we started talking about the frequency with which prime numbers occur on the number line, how important they are to fields such as cryptography, and the existence of dense Bragg peaks among primes in judiciously chosen intervals. By the end of the conversation, he had discovered a new recursive prime generator and submitted a paper on it to arXiv. Who knew?!?
Re: Conversations with a six-year-old on functional programming
#15What 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 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 completeness or MySQL sharding to a young child. And you may find a clever way to describe it, that they can easily understand, which is satisfying for both of you.
Re: Conversations with a six-year-old on functional programming
#16What 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.
Re: Conversations with a six-year-old on functional programming
#17When my son was around five or six, I did a similar exercise to explain the difference between prime and composite numbers. I told him that a number X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket. I drew 6 apples and asked whether they could be divided into buckets with an equal number of apples in each. It was immediately obvious that they could. My son c…
Re: Conversations with a six-year-old on functional programming
#18Earlier quoted context omitted.
I'm curious what you mean. Is the problem that it is a constant function, or that you are asking them to ignore parameters? Or is that missing the point, still?
The child was stuck on the intuition that the argument must change in some way (i.e. that the function was linearly typed).
>> 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
don't really seem, to me, like they can explain what's happening -- f(x) = 6 is trivially easy to express in terms of arithmetic operations being applied to x. If you assume that a function that multiplies by 2 is intuitively ok, what's wrong with a function that multiplies by 0?
Re: Conversations with a six-year-old on functional programming
#19Could it be used to create a functional programming language, easily understood by non-programmers or beginners , so they too could take a program and adapt it to their needs ? Does such language exist ?