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.

  • 6
    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. Jul 18, 2011 at 8:09
  • 2
    @MainMa, we had recursion on the first day of our computer sci degree - that way students that were not up to computer sci could change degrees quickly (pity more of the "hopeless" ones did not make the change).
    – Ian
    Jul 18, 2011 at 8:29
  • 7
    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. Jul 18, 2011 at 12:12
  • 4
    Do: Open Russian Doll: If there is a doll inside, do "Open Russian Doll" Jul 18, 2011 at 17:49
  • Mirrors before and behind.
    – user1842
    Jul 19, 2011 at 5:38

9 Answers 9


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.


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


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.

  • 24
    1) Get webcam 2) Point webcam at screen Jul 18, 2011 at 10:34
  • 1
    This demonstrates what recursion is, but doesn't explain why or how you would use it. Jul 18, 2011 at 13:13
  • 5
    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, 2011 at 13:30
  • Oh no they wont, they will just remember how much more they will hate eating broccoli!
    – Harvey Lin
    Jan 2, 2019 at 6:00

Read this sentence and do what it says twice.

Apologies for any BrainStackOverflowExceptions

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

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.

  • 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. Jul 18, 2011 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, 2011 at 10:56


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 ]

 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.


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.


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.

  • "basic approach behind recursion" is NOT "divide and conquer" -- it is "code reuse" :)
    – treecoder
    Jul 18, 2011 at 9:39
  • 5
    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, 2011 at 9:53

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).


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.

  • 4
    I hope your kidding... you are, right :D? Jul 18, 2011 at 10:15

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.

  • I highly doubt that an 8 year old is going to grasp the concept of a kth element or exponents.
    – MGZero
    Jul 18, 2011 at 20:27
  • @MGZero Haha, I learned decimal division and a little bit of extremely basic pre-algebra at that age! Oct 14, 2011 at 4:27
  • 1
    @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, 2011 at 14:29

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