Conversations with a six-year-old on functional programming
171–180 of 319 posts
Re: Conversations with a six-year-old on functional programming
#172Earlier quoted context omitted.
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 stupi…
Re: Conversations with a six-year-old on functional programming
#173What 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.
Note kid asked "dad what are you doing", not "what is functional programming". That's a simple call for attention, and it was equally suitable to close the book and play frisbee with him.
And much more likely: who's to say that the overstimulated little monster that asked 15 questions in 5 minutes doesn't need a little dose of adult life to encourage some self-play?
Re: Conversations with a six-year-old on functional programming
#174Earlier quoted context omitted.
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.
Expressing "age" in whole years is acceptable in English, but using a decimal would be highly defensible. That's an issue of grading though.
Re: Conversations with a six-year-old on functional programming
#175Earlier quoted context omitted.
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 stupi…
I feel like I’m missing something entirely, though...
Re: Conversations with a six-year-old on functional programming
#176What 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.
It's an immense amount of effort to do it consistently. And it gets harder with each kid, at least for me. One of the things you figure out is that some kids aren't interested. And if your kid isn't interested in thinking about prime numbers, you're going to be hard pressed to change that. Conversely they will have interests that you don't share, and it's going to be harder for you to participate meaningfully in that…
You can't start telling your child about maths if they're busy doing something else. All you can do is wait for a moment when their curiosity spots something and try to feed that.
Even when you catch their interest it's easy to break it if you can't explain it, so los of kudos to Brent for navigating it perfectly.
Re: Conversations with a six-year-old on functional programming
#177Earlier 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…
Re: Conversations with a six-year-old on functional programming
#178Earlier quoted context omitted.
> what's wrong with a function that multiplies by 0? Obviously the fact that it doesn't seem to have any visible effect on the input -- and people expect the input to be affected.
Affected? f(x) = 6 has a pretty obvious effect on all input other than 6. Your comment is more of an indictment of identity functions than dimension-losing functions.
It wasn't "what would the result be" that eluded the child (or those students).
It was the question "in what way is this an operation on x" -- which in their minds was intuitively, put x in and add/subtract/multiply by something(s) to get another result.
fx=K, fx=0, or fx=x didn't seem as substantial enough transformations (given the other examples) to qualify with their notion of a function.
Re: Conversations with a six-year-old on functional programming
#179I _hated_ it; felt patronised by the illustrations of these machines, so I rebelled by trying to come up with a different correct solution - aware that there were infinitely many answers given just a few example domain/range pairs.
But if anyone's interested in them for a car journey or some time you can't play this game aloud, there ought to be examples available online aimed at teachers.
Re: Conversations with a six-year-old on functional programming
#180Earlier quoted context omitted.
Maybe it helps being rich, but just as a counter example, my grandfather was never rich. He was a clock-in/clock-out guy and still managed to spend a lot of time with me while I was growing up. He had a lot more patience than most of the "white collar" adults in my life ever did, and taught me lots of useful skills like how to fix a lot of electrical or mechanical things.
Sure it’s possible to do it when you’re not rich. It’s just a lot easier if you are. Like many things in life. :)