Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
In plain English, what is recursion?

What is the best way to explain "Recursion" to 8 years old kid?

I tried with the Fibonacci Series but i failed.

share|improve this question
5  
When I were in college, they tried to explain recursion only at the second year. Half of the students didn't understand what's this thing and why do we need it. So good luck. – MainMa Jul 18 '11 at 8:09
3  
the above link tells the "nice explanation for recursion" -- NOT for an 8 year old -- hence the question MUST NOT be closed :( – greengit Jul 18 '11 at 8:58
17  
Well first you explain it to an 18 year old kid, then he explains it to a 17 year old kid, then he explains it to a 16 year old kid, then ... – Paul R Jul 18 '11 at 11:00
6  
IMHO an average 8 year old kid's mind is not yet developed enough to comprehend recursion in its entirety - that requires a level of abstract thinking (s)he is not capable of yet. – Péter Török Jul 18 '11 at 12:12
7  
You explain recursion to an 8 year old kid the same way you would explain recursion to an 8 year old kid. – Stargazer712 Jul 18 '11 at 17:14
show 15 more comments

marked as duplicate by Mark Trapp Jul 18 '11 at 11:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

9 Answers

up vote 47 down vote accepted

Well, recursion is actually pretty simple to grasp for kids. Don't try it with mathematics or whatever the other people here are suggesting. They are too young to understand it. It's too abstract and boring for them.

Instead: Show them a picture of a painter who is painting a picture of painter who is painting a picture ...

Something like this: Recursive painting

There are probably even better examples to be found on the web. And trust me: They'll understand it in no time.

Regardless of the question, I think any child should own a book with paintings of M. C. Escher. It'll be good for their development and creativity.


Edit:

Lately I have realized that you can explain recursion to children by using food, too. Take broccoli or cauliflower for example:

Broccoli

These are fractal vegetables. Tear them apart and you'll find that the smaller parts will turn out to look like the big whole you once had, just smaller. This has the advantage that you can teach your child recursion while eating. Don't laugh! Children will remember it better, because it's related to their meal (and thus important to their conciousness) and they can comprehend it. A German term for "comprehend" is "begreifen", which literally means "to touch something in order to understand it". Try it yourself. It's far easier to remember something you have once touched.

share|improve this answer
14  
1) Get webcam 2) Point webcam at screen – Callum Rogers Jul 18 '11 at 10:34
1  
This demonstrates what recursion is, but doesn't explain why or how you would use it. – Peter Alexander Jul 18 '11 at 13:13
3  
It demonstrates the concept, that's sufficient. Children should be able to pick it up. They are able to think "recursive" then. And when the time comes, they'll understand and know how to apply it. Concerning the "why you would use it": Does this matter to non-programmers? You can use it to create art. You can use it to display mathematical concepts. You can use it to model a programming problem elegantly. It's all about representing something in the end. I'm sure smart kids won't have problems to recognize analogies. – Falcon Jul 18 '11 at 13:30
6  
This is also a way to get your kid to eat broccoli, which is an achievement in itself. – Pekka 웃 Sep 17 '11 at 13:08
2  
Oh, the idea with the broccoli is brilliant, perhaps you should take this one, AFAIK it is the most recursive cauliflower in the world ;) en.wikipedia.org/wiki/Romanesco_broccoli – Tokk Sep 22 '11 at 13:28
show 2 more comments

Read this sentence and do what it says twice.

Apologies for any BrainStackOverflowExceptions

share|improve this answer
7  
Ahhh infinite recursion!! At least it will keep the kids quiet... until they get bored (or is that the base case?) – FrustratedWithFormsDesigner Jul 18 '11 at 14:19
looks more like an infinite loop, hard to break.. lol. – H_7 Apr 8 '12 at 2:43

Logo.

Other suggested fractals, that's a good idea. But Logo allows you to trivially make neat fractals.

The Koch's snowflake:

 to koch :level :len
   ifelse :level == 0 
     [ fd :len ] 
     [ koch level-1 len/3
       lt 60  
       koch level-1 len/3  
       rt 120
       koch level-1 len/3 
       lt 60
       koch level-1 len/3 ]
 end

 koch 5 100
 rt 120
 koch 5 100
 rt 120
 koch 5 100

Then use various "basic shapes". Koch's Snowflake is _/\_ defined by "forward, left 60, forward, right 120, forward, left 60, forward. Others to try:

    _|_ 
      _
    _| |_

    /\

    __|

    __|_

    |\

...remembering to always turn at the end to face the same direction as in the beginning.

Later you may suggest including some little discrepancies, like using 59 degrees instead of 60...

Generally, Logo is awesome language to teach recursion.

share|improve this answer

Use a mathematical monster like the Julia or Mandebrot set in fractal form. This will give the kid something tangible to grasp at. Each time you reduce the problem, it looks the same, it's just smaller. The infinite mirrors example works as well as a tangible example.

share|improve this answer

Give him (her?) something he can draw, like a Koch Snowflake or one of its variations.

For formulas, give him something concrete that he can relate to, rather than just numbers. Like, number of legos in a box after applying the next step in the algorithm (which I'd advice to call something less scary, such as a turn or a step).

Oh, and avoid mentioning infinity. Prefer: and again, and again, and again... Pan it out so he's getting the impression he's playing a game.

Point is, make sure you're extremely concrete. 8-year olds can be smart, but their brain is not really equipped at that age to grasp this level of abstraction.


One extra approach that might work is to work out, with him, the algorithm that solves a tower of Hanoi, a rubics cube, or even a simple puzzle (do a simple puzzle with the picture facing the floor, and you'll quickly end up working like a computer, trying combinations one at a time).

share|improve this answer

As suggested, use fractals. Sierpinski's Triangle is best for this case.

Then, move on to factorial, length of list, sum of list, simple mathematical formulas in this area.

Later, switch to more complex algorithms like Lee but let him come up with it, do it like a game.

share|improve this answer
4  
I hope your kidding... you are, right :D? – Filip Dupanović Jul 18 '11 at 10:15

I'd start with a real world example. Use something non-code related, such as matryoshka dolls as a methaphore to explain the basic approach behind recursion. (divide and conquer) then use a simple visual example side by side with the code to explain how this relates to recursion in code. The Sierpinski's Triangle as mentioned by Mihai Maruseac is a nice start. Fibonacci is a good follow up for something abstract without visuals to match. if he doesn't get fibonacci, then get him to understand the math before explaining the code. He needs to understand the algorithm before he can understand the code that will accomplish it.

share|improve this answer
"basic approach behind recursion" is NOT "divide and conquer" -- it is "code reuse" :) – greengit Jul 18 '11 at 9:39
3  
I beg to differ. Recursion is the way to execute a divide and conquer solution to a problem. Recursion divides the problem into sets of smaller problems which can be solved or divided up further until they can be solved. Code reuse means you use the same code in a different context because you need to use the same functionality. (of course recursive code can be reused :) ) – Onno Jul 18 '11 at 9:53

When trainer calls Pokemon it's "normal" function call. If Pokemon could call himself from Pokeball that would be recursive call (Did he watch Pokemons?).

When singer, e.g. Eminem, starts calling names like - Dr. Dre, 50 cent (normal calls), Eminem (recursion).

When daddy drives the car, it's "normal call". When Bob the Builder drives himself, it's recursion.

share|improve this answer
3  
How many 8 year olds do you think understand the idea of a function call? Just sticking something a child is interested in into a complex explanation doesn't make it a good explanation for a child. – Jon Hopkins Jul 18 '11 at 10:34
1  
And how many of them understand what recursion is? I guessed he is learning programming. Maybe I'm wrong. Author didn't tell why he wants to explain the recursion to the child. It's not about function calls, but about behaviour. Something what we might call normal function call is normal / ordinary behaviour to a child, right? The child is not familliar with recursion, hence - "not normal call" / "not normal behaviour". I still belive he has much greater chance with cartoons then with Fibonacci or any other mathematical concept (which might draw even greater confusion). – StupidOne Jul 18 '11 at 10:56

epic fail.

You do not use the Fibonacci example to explain the meaning of recursion, but use it for explaining the power of use of recursion.

if you want to explain to an 8 year old recursion, use the linear series 1,2,3,4,5,..

and tell him: lets say you know the k element, and you want to know the next element, you can express things in a few ways, one of them is k1 = 1 k2 = k1 +1 k3 = k2 +1 k4 = k3 +1 k5 = k4 +1 k6 = k5 +1 l7 = l6 +1 k8 = k7 +1

then you say, well i don't want to write them all down, so i want to generalize it, and one way to do it is to say K = k + 1 target number the number we know the step to the next element.

then do it for the series -1,-2,-3,-4,...

then do it for the series 2,4,6,8,..

then ask the kid to come up with a series.

now let him think about it for a day, and after a day, show something more meaningful, and useful, like use of calculating power, and say that this is finite series that stops at element number 1 , and we calculate it backwards: 2^5 = 2^4*2 2^4 = 2^3*2 2^3 = 2^2*2 2^2 = 2^1*2 = 2*2 =4 2^3 = 4*2 = 8 2^4 = 8*2 = 16 2^5 = 16*2 = 32

now you can try Fibonacci again.

what ever you try , it will take a few days, as the mind needs to adjust to the next syntax of recursion which is not normal to any human being that does not know of it.

share|improve this answer
I highly doubt that an 8 year old is going to grasp the concept of a kth element or exponents. – MGZero Jul 18 '11 at 20:27
@MGZero Haha, I learned decimal division and a little bit of extremely basic pre-algebra at that age! – muntoo Oct 14 '11 at 4:27
@muntoo And I learned multiplication when I was in Kindergarten. Doesn't change the fact that most people learn it when they're 8. In my case and your case, we're just outside of the average. I was speaking with respect to the average. – MGZero Oct 14 '11 at 14:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.