Home / Hands-on activities / Recursion Russian Dolls

Coding activity

Recursion Russian Dolls

Discover patterns inside patterns! Draw a big circle, then a smaller circle inside, then an even smaller one. Like Russian nesting dolls, the same shape repeats at different sizes.

Hands OnAbout 25 minutesScreen-freeParent help expected

Materials and setup

How this changes by age

Pre-K (ages 3–4)

Discover patterns inside patterns! Draw a big circle, then a smaller circle inside, then an even smaller one. Like Russian nesting dolls, the same shape repeats at different sizes.

Difficulty 1 of 3

Steps

  1. Show nesting cups or draw concentric circles: big, medium, small, tiny.
  2. Ask: 'What do you notice? The same shape gets smaller and smaller!'
  3. Draw your own: start with a big triangle. Draw a smaller triangle inside. Then an even smaller one inside that.
  4. Try with squares: big square, smaller square inside, even smaller inside.
  5. Count: how many levels deep can you go? 'Each level is the same pattern, just smaller!'
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Recognize that the same shape can repeat at different sizes
  • Draw nested patterns by repeating a smaller version inside a larger one
  • Count the levels of nesting in a pattern

Kindergarten (ages 5–6)

Make fractal art! Draw a shape, then draw smaller copies of it inside or around it. Each copy follows the same rule. Discover how nature uses this trick in trees, ferns, and snowflakes.

Difficulty 2 of 3

Steps

  1. Draw a big Y shape (like a tree trunk splitting into branches).
  2. At the end of each branch, draw a smaller Y. At the end of those branches, draw an even smaller Y.
  3. You just drew 3 levels of a fractal tree! How many branch tips do you have?
  4. Try another pattern: draw a triangle. At each corner, draw a smaller triangle. At each of those corners, draw an even smaller one.
  5. Look at real examples: a fern leaf, broccoli, snowflake photos. Can you see the repeating pattern?
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Create fractal drawings by applying the same rule at smaller scales
  • Count how elements multiply at each level of recursion
  • Identify self-similar patterns in nature

Early elementary (ages 6–8)

Explore recursion through drawing and math! Understand the idea of a function that calls itself with a smaller input. Draw fractals, calculate recursive sequences, and discover the power of self-reference.

Difficulty 2 of 3

Steps

  1. Recursion in action: 'To clean your room, first clean one item. Then clean your room (which now has one fewer item).' The instruction refers to itself!
  2. Draw a Sierpinski Triangle: start with a big triangle. Find the midpoints of each side and connect them, creating 4 smaller triangles. Remove the middle one. Repeat for each remaining triangle.
  3. Calculate: at level 0, you have 1 triangle. Level 1: 3 triangles. Level 2: 9 triangles. Level 3: 27. What is the pattern? (Multiply by 3 each level.)
  4. Write a recursive instruction: 'To count down from N: say N, then count down from N-1. Stop when N is 0.' Trace through: countdown(5) = 5, 4, 3, 2, 1, 0.
  5. Try factorial: 'factorial(N) = N times factorial(N-1). factorial(1) = 1.' Calculate factorial(5) = 5 x 4 x 3 x 2 x 1 = 120.
  6. Discuss: 'Every recursion needs a stopping point (base case) or it goes forever! What is the base case in our examples?'
  7. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Understand recursion as a process that refers to itself with a smaller input
  • Draw multi-level fractal patterns by applying recursive rules
  • Identify the base case that stops a recursive process from running forever

Upper elementary (ages 8–10)

Master recursion as a programming concept. Trace through recursive function calls using a call stack, compare recursive and iterative solutions, and understand when recursion is elegant versus when it is inefficient.

Difficulty 3 of 3

Steps

  1. Draw a call stack for factorial(4): factorial(4) calls factorial(3) calls factorial(2) calls factorial(1)=1, then results flow back up: 1, 2, 6, 24.
  2. Fibonacci recursion: fib(n) = fib(n-1) + fib(n-2), fib(1)=fib(2)=1. Draw the call tree for fib(6). How many times does fib(2) get calculated? (Too many times!)
  3. Compare: write the iterative (loop) version of Fibonacci on paper. Count operations for both. Which is more efficient?
  4. Recursive drawing challenge: write the instructions for a Koch Snowflake. At each level, replace the middle third of each line segment with a triangle bump. Draw levels 0, 1, 2, and 3.
  5. Real-world recursion: file folders contain files and other folders (which contain files and other folders...). Design a 'search every file' algorithm using recursion.
  6. Discuss: 'When is recursion better than loops? (Tree structures, fractals, divide-and-conquer.) When is it worse? (Simple counting, when it recalculates the same values.)'
  7. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Trace recursive function calls using a visual call stack
  • Compare the efficiency of recursive versus iterative solutions
  • Apply recursion to design algorithms for tree-structured problems

Safety and evidence note

Read the full activity before beginning. An adult should supervise tools, heat, food, outdoor work, movement, and experiments as appropriate. Completion records that the activity was done; the child’s explanation, work sample, photo, or demonstration is stronger evidence of learning than a completion check alone.

Related coding activities

Browse all 575 activities · Explore course syllabi