Brent is one of the greatest teachers I've ever experienced. I used to take classes from him (and TA some others he taught) and was consistently blown away by his enthusiasm and capacity for sharing concepts. He has a great essay on pedagogy as well (https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti...)
If you're interested in learning some of the beautiful foundations of functional programming, I highly recommend checking out the lecture notes and assignments from his Penn CIS 194 class (http://www.cis.upenn.edu/~cis194/spring13/lectures.html)
Agreed! I taught myself programming, and Haskell was my second language. I was at Penn so I emailed Brent out of the blue, and he responded and was so helpful with understanding helping me understand Monoids, not at all judgmental, and so different from all the educational experience I had up until then. And it was serious gateway drug to mathmatics. Funny thing is a few years later I TAed an advanced Haskell class with Stephanie Weirich (https://www.seas.upenn.edu/~cis552/current/index.html), who was Brent's thesis advisor. All started with Brent!
I'll second this; he is a fantastic teacher. I had the incredibly fortunate opportunity of learning from Brent in my undergrad at Hendrix, where he currently teaches.
There are other comments here that praise his patience with regard to teaching these topics to a child. I can say without a doubt he maintains the same patience with all of his students - not just his children. If you ever have the opportunity to learn from Brent (be from a course, blog, or talk), I would highly encourage it.
I'm glad to see a post of his making its rounds on HN.
Just read Week 1 of this course - very easy to follow.
Although with a different instructor, there are later versions - http://www.cis.upenn.edu/~cis194/fall16/ seems the most recent, with plenty of updates since the spring13 course. I'll be reading more!
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.
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 beyond being generally supportive. They are individuals that way.
One thing that makes this easier is being rich. What I mean by that is for example, when my kid is asking me questions or wants to "do it myself!", the fact that I have a flexible schedule helps immensely, and that flexible schedule is possible because I can turn down work that doesn't give me that flexibility.
If I had a strict clock-in/clock-out job, and only had limited time to run errands, I'd have a lot less patience for waiting for my kid to do stuff or answering her questions.
I consider myself very lucky that I have that privilege and can pass that on to my kids.
Dad of 8 here. It makes life so sweet when we acknowledge the child's capacities. Notice it didn't take that much patience...it's almost just a matter of creatively overcoming a language barrier.
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 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.
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 cipher - like direct substitution and she got it immediately. I also taught my son how to do pin bumping and pin counting/picking on locks with my lockpick set. I even bought him a transparent set of master locks to practice on and he would sit for an hour at the age of 4 picking those locks. The obvious downside now is that he knows how to get into everything!
Very cool to watch what are basic principals being applied at the very basic level.
When my mother died, I was asked to think of one word to describe her. The best word that I could come up with was "teacher." One quick example: when my own child was 2 or 3, we spent some time with Grandma at Yellowstone National Park. Grandma walked with her grandchild through the park and explained geisers, plate techtonics, and many other topics of geology. I rolled my eyes and thought, "Really? He can barely speak and you are delivering a college lecture?" But then I remembered all the college lectures of my own youth. It's amazing how much even the youngest minds can absorb.
One of my biggest failings as a parent has been to assume that my children will learn things somehow without me teaching it to them. If anybody learned 1/3 of what my mother taught them in detail, they learned a lot.
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.
Explaining things to them and seeing the dawn of understanding in their eyes in easily my greatest joy in life. As a parent, I basically get to relive this xkcd[0], over and over, every day.
We take it to an extreme - we unschool[1]. We do our best to treat our daughters as any other member of the family, expecting to act as adults to the extent that they're able to do so. My nine-year-old spends much of her days right now playing Roblox and Star Stable, but even that is punctuated by her coming to us with random questions about things she's interested in. If I'm not head-down on a project I take the time to explain as best I can. If I'm otherwise occupied I always at least take the time to say "Go search for <insert keywords>" and follow up with once I'm free.
The results have, so far, been incredible. Our oldest was a late reader by the standards of the testing done in government schools, but once she ran into something she wanted to do that could only be accomplished by reading, she achieved fluency more quickly than I would have ever expected. For what it's worth, that "something" was an online RPG where she had to do quests to progress. In order to do that, she had to be able to read the quest text.
These days she's engrossed in the "Pegasus" series by Kate O'Hearn, and devouring them at a rate of ~1k pages per week. She'll have finished the series by the end of this week and I'm hoping she'll pick up Asimov's "Norby" series next. If not, she'll find something else that interests her and continue reading well into the wee hours of the morning I'm sure.
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)
>\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. (Interestingly, many students in my functional programming class this semester were also confused by constant functions when we were learning about the lambda calculus; they really wanted to substitute the input somewhere and were upset/confused by the fact that the bound variable did not occur in the body at all!)
Just goes to show, our intuition works on linear types.
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 the question, and what they think:
> Reflect on the difference between creating a variable with a constant value and creating a function with no arguments and a constant return value.
Up to you to decide if this has any pedagogical value. The real learning objective was to "write a function that has no arguments but returns a constant value", so getting them to draw big conclusions about the nature of functions and values and so on is outside the scope of this little activity.
I was learning category theory at the time. I gave them some element-chasing problems so they could work on the same areas I was studying, although at a different level of abstraction.
We also did some stuff on permutahedrons, and relating single-character-replacement paths (I think Nabokov calls these “rooks path”, when each step is a word) from AAA → BBB, to geometric cubes, and 2³, etc., but I didn't collect the worksheets for those into the same document.
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).
When 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 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?!?
> 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.
Wrong; X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket, with at least two apples in each bucket.
"You gotta tell the children the truth. They don't need a whole lot of lies. Cause one of these days, baby, they'll be running things." - Jimi Hendrix, "Straight Ahead"
FWIW, "rectangles" is a visually/geometrically natural way to express "buckets of equal size".
And "1xN doesn't count" can be expressed nicely as "it can't just be a line", or "the line must be folded up into a shorter rectangle [because more compact shapes are nicer]"
Your six year old came up with a new recursive prime generator over the course of a conversation introducing him to the concept of primes, and then submitted this as a paper to arXiv? Do you have a link to this paper on arXiv?
> 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 guess disagrees with the rule the master had in mind. Then play continues.
Come to think of it, I find Zendo much harder than the game described in the article. I think it’s because the inputs (arrangements of shapes) are more complex than numbers, and the outputs (Booleans) give you less information than numbers.
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 instead of just shouting them at you slowly, I will obfuscate them with a set of conceptually unrelated words and repeat the representation word for word in a more patronizing way."
And it works with procedural programming also! I've been teaching programming in schools since I was in school myself - teaching the kids who know more than their teachers, as well as the kids that teachers don't think are ready to code.
Procedural thinking is something that anybody who knows socks come before shoes can do. Conditionals can be understood by anybody who wears different clothes on a weekend than on a schoolday. Loops can be understood by anybody who can eat a bowl of soup by drinking a single spoonful and then doing that again and again until the soup is gone.
Kids can definitely engage in computational thinking from a young age. We just need to offer them the opportunities to do so.
> “A function is like a machine where you put something in one end and something comes out the other end. For example, maybe you put a number in, and the number that is one bigger comes out. So if you put in three, four comes out, or if you put in six, seven comes out.”
Examples are such a useful tool to explain complex subjects and make them approachable.
Teaching CS by simple analogs is the most intuitive way for people to grasp it. I wrote lectures for a 8 week 3hrs a week CS50 level course and completely nontechnical people loved every analog. Example: Front end vs backend vs middleware development is like a Macys window display. The figures and placement are Html, colors are CSS, backend database is the store warehouse and the employees are RoR, PHP, Go or another middleware that connects the pieces. Just like any warehouse - you want most frequently accessed items in the front - so you need to design your database for quick and efficient access to the information you will need to show users most frequently.
Since then I’ve been thinking of a wikihow- or w3schools- like site that explains a CS50 level class online and can expand to reach Python, or Go or another language in depth. A second parameter to teaching is the pace - the speed of lecture and the steepness of the learning curve. Maybe we could structure a slow or fast paced versions of each module and the viewer can pick or customize a track for themselves. Is anyone interested in joining or contributing to such an effort?
Jesus that shows you how uneven of a baggage children have when they start going to class.. this little dude has a computer science prof as his father, & is doing abstract logic problems at 6 yo, for fun no less!!
my cabinet maker father can't spell a sentence without making four different mistakes in his native language, and my social worker mother literally grimaces with pain anytime something resembling math is distantly mentioned
I am surprised. Growing up in the 80s in France, this was a classic exercise for 7/8 year olds. I remember doing it a million times in school. They presented the problem as 2 columns with numbers on the left and on the right, and a box at the top, which we also called the "machine". It had a little arrow as well to show which way the numbers would go through the machine. The exercise was either "find what the machine does" or "guess the input" or "guess the output", sometimes combined together.
This reminds me of when I explained inverse functions to my kids. I was about to teach them to my grade 10 students and I wanted to use the Dr. Seuss book, The Sneetches to give an example. I asked my kids if I could borrow their copy. When they asked me what for, I told them and they ended up asking what inverse functions were. I similarly played a game where I told them what a certain function machine did and they had to come up with a machine that undid what my machine did.
This is so awesome. I'm consistently amazed at how much kids can understand intuitively, even when they can't express their understanding in precise language. For example, my partner teaches lower elementary at a Montessori school. Not everyone understands it, but she's managed to teach some basic algebra, including to several of her first-graders.
It's meant to "simulate scientific research", sorta: one player ("God" or "Nature") comes up with a secret rule for what cards are legal to play in a given situation, and then the other players take turns playing cards to figure it out. It's a lot harder than you think, even with quite simple rules. (The scoring system is meant to reward a "God" player for coming up with a rule that's not obvious but still guessable.)
I hope my kids want to learn and are curious about how things work like the OP's kid!
I dont want to be one of those parents that pushes their kid to the point that they dont enjoy learning or suffer socially.
Asking for a future me: how do you give your kid the best chance / environment to develop socially, but still enjoy learning & embracing the nerdier things?
I love to hear about conversations with people who aren't exposed to these kinds of concepts. I think it's interesting to hear a more simple opinion. Sometimes I talk to my wife about ideas I've been thinking about and she can give some helpful feedback despite not having experience with any of the underling concepts.
[+] [-] zwass|7 years ago|reply
If you're interested in learning some of the beautiful foundations of functional programming, I highly recommend checking out the lecture notes and assignments from his Penn CIS 194 class (http://www.cis.upenn.edu/~cis194/spring13/lectures.html)
[+] [-] xiaolingxiao|7 years ago|reply
[+] [-] teirce|7 years ago|reply
There are other comments here that praise his patience with regard to teaching these topics to a child. I can say without a doubt he maintains the same patience with all of his students - not just his children. If you ever have the opportunity to learn from Brent (be from a course, blog, or talk), I would highly encourage it.
I'm glad to see a post of his making its rounds on HN.
[+] [-] awbraunstein|7 years ago|reply
http://www.cis.upenn.edu/~cis39903
[+] [-] danharaj|7 years ago|reply
[0] https://hackage.haskell.org/package/diagrams
[+] [-] icc97|7 years ago|reply
[0]: http://cis.upenn.edu/~cis194/fall16/
[+] [-] quickthrower2|7 years ago|reply
After completing that one, he recomended the NICTA github repo https://github.com/data61/fp-course/tree/master/src/Course
Disclaimer: All subject to IIRC
[+] [-] Cyberspy|7 years ago|reply
[+] [-] riwazp7|7 years ago|reply
[+] [-] dyladan|7 years ago|reply
[+] [-] ams6110|7 years ago|reply
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 beyond being generally supportive. They are individuals that way.
[+] [-] jedberg|7 years ago|reply
If I had a strict clock-in/clock-out job, and only had limited time to run errands, I'd have a lot less patience for waiting for my kid to do stuff or answering her questions.
I consider myself very lucky that I have that privilege and can pass that on to my kids.
[+] [-] insensible|7 years ago|reply
[+] [-] wikwocket|7 years ago|reply
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.
[+] [-] AndrewKemendo|7 years ago|reply
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 cipher - like direct substitution and she got it immediately. I also taught my son how to do pin bumping and pin counting/picking on locks with my lockpick set. I even bought him a transparent set of master locks to practice on and he would sit for an hour at the age of 4 picking those locks. The obvious downside now is that he knows how to get into everything!
Very cool to watch what are basic principals being applied at the very basic level.
[+] [-] freeopinion|7 years ago|reply
One of my biggest failings as a parent has been to assume that my children will learn things somehow without me teaching it to them. If anybody learned 1/3 of what my mother taught them in detail, they learned a lot.
[+] [-] thenobsta|7 years ago|reply
[1] https://bookstore.ams.org/mcl-5/
[+] [-] avip|7 years ago|reply
[+] [-] LyndsySimon|7 years ago|reply
Explaining things to them and seeing the dawn of understanding in their eyes in easily my greatest joy in life. As a parent, I basically get to relive this xkcd[0], over and over, every day.
We take it to an extreme - we unschool[1]. We do our best to treat our daughters as any other member of the family, expecting to act as adults to the extent that they're able to do so. My nine-year-old spends much of her days right now playing Roblox and Star Stable, but even that is punctuated by her coming to us with random questions about things she's interested in. If I'm not head-down on a project I take the time to explain as best I can. If I'm otherwise occupied I always at least take the time to say "Go search for <insert keywords>" and follow up with once I'm free.
The results have, so far, been incredible. Our oldest was a late reader by the standards of the testing done in government schools, but once she ran into something she wanted to do that could only be accomplished by reading, she achieved fluency more quickly than I would have ever expected. For what it's worth, that "something" was an online RPG where she had to do quests to progress. In order to do that, she had to be able to read the quest text.
These days she's engrossed in the "Pegasus" series by Kate O'Hearn, and devouring them at a rate of ~1k pages per week. She'll have finished the series by the end of this week and I'm hoping she'll pick up Asimov's "Norby" series next. If not, she'll find something else that interests her and continue reading well into the wee hours of the morning I'm sure.
0: https://www.xkcd.com/1053/ 1: https://en.wikipedia.org/wiki/Unschooling
[+] [-] avip|7 years ago|reply
[+] [-] shawn|7 years ago|reply
[+] [-] ummonk|7 years ago|reply
Just goes to show, our intuition works on linear types.
[+] [-] acbart|7 years ago|reply
> Reflect on the difference between creating a variable with a constant value and creating a function with no arguments and a constant return value.
Up to you to decide if this has any pedagogical value. The real learning objective was to "write a function that has no arguments but returns a constant value", so getting them to draw big conclusions about the nature of functions and values and so on is outside the scope of this little activity.
[+] [-] osteele|7 years ago|reply
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 element-chasing problems so they could work on the same areas I was studying, although at a different level of abstraction.
We also did some stuff on permutahedrons, and relating single-character-replacement paths (I think Nabokov calls these “rooks path”, when each step is a word) from AAA → BBB, to geometric cubes, and 2³, etc., but I didn't collect the worksheets for those into the same document.
[+] [-] giu|7 years ago|reply
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!
[+] [-] gowld|7 years ago|reply
[+] [-] pbnjay|7 years ago|reply
[+] [-] inanutshellus|7 years ago|reply
[+] [-] jawns|7 years ago|reply
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 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?!?
[+] [-] kazinator|7 years ago|reply
Wrong; X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket, with at least two apples in each bucket.
"You gotta tell the children the truth. They don't need a whole lot of lies. Cause one of these days, baby, they'll be running things." - Jimi Hendrix, "Straight Ahead"
[+] [-] gowld|7 years ago|reply
And "1xN doesn't count" can be expressed nicely as "it can't just be a line", or "the line must be folded up into a shorter rectangle [because more compact shapes are nicer]"
[+] [-] k__|7 years ago|reply
[deleted]
[+] [-] dsnuh|7 years ago|reply
Your six year old came up with a new recursive prime generator over the course of a conversation introducing him to the concept of primes, and then submitted this as a paper to arXiv? Do you have a link to this paper on arXiv?
[+] [-] abecedarius|7 years ago|reply
> 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 guess disagrees with the rule the master had in mind. Then play continues.
[+] [-] evincarofautumn|7 years ago|reply
[+] [-] laurentlb|7 years ago|reply
[+] [-] motohagiography|7 years ago|reply
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 instead of just shouting them at you slowly, I will obfuscate them with a set of conceptually unrelated words and repeat the representation word for word in a more patronizing way."
Great piece of writing.
[+] [-] thomasfedb|7 years ago|reply
Procedural thinking is something that anybody who knows socks come before shoes can do. Conditionals can be understood by anybody who wears different clothes on a weekend than on a schoolday. Loops can be understood by anybody who can eat a bowl of soup by drinking a single spoonful and then doing that again and again until the soup is gone.
Kids can definitely engage in computational thinking from a young age. We just need to offer them the opportunities to do so.
[+] [-] heinrichhartman|7 years ago|reply
http://heinrichhartmann.com/blog/2016/06/12/Box-Counting-Ari...
It's a great joy to work with such gifted young minds.
[+] [-] mcv|7 years ago|reply
Well, maybe the 3 year old still has a chance.
[+] [-] kiliancs|7 years ago|reply
Examples are such a useful tool to explain complex subjects and make them approachable.
[+] [-] dzink|7 years ago|reply
Since then I’ve been thinking of a wikihow- or w3schools- like site that explains a CS50 level class online and can expand to reach Python, or Go or another language in depth. A second parameter to teaching is the pace - the speed of lecture and the steepness of the learning curve. Maybe we could structure a slow or fast paced versions of each module and the viewer can pick or customize a track for themselves. Is anyone interested in joining or contributing to such an effort?
[+] [-] make3|7 years ago|reply
my cabinet maker father can't spell a sentence without making four different mistakes in his native language, and my social worker mother literally grimaces with pain anytime something resembling math is distantly mentioned
[+] [-] d--b|7 years ago|reply
[+] [-] Delfino|7 years ago|reply
[+] [-] curuinor|7 years ago|reply
[+] [-] acobster|7 years ago|reply
[+] [-] Steuard|7 years ago|reply
It's meant to "simulate scientific research", sorta: one player ("God" or "Nature") comes up with a secret rule for what cards are legal to play in a given situation, and then the other players take turns playing cards to figure it out. It's a lot harder than you think, even with quite simple rules. (The scoring system is meant to reward a "God" player for coming up with a rule that's not obvious but still guessable.)
[+] [-] skate22|7 years ago|reply
I dont want to be one of those parents that pushes their kid to the point that they dont enjoy learning or suffer socially.
Asking for a future me: how do you give your kid the best chance / environment to develop socially, but still enjoy learning & embracing the nerdier things?
[+] [-] kyleperik|7 years ago|reply