Classroom resource

Tower of Hanoi Algorithms

Use the Tower of Hanoi to teach algorithms, decomposition, recursion and exponential growth.

Lesson overview

Suggested time
50–60 minutes
Suitable for
Years 7–10, adaptable for clubs

Learning objectives

  • Apply a restricted set of rules accurately.
  • Record an algorithm as a sequence of unambiguous steps.
  • Recognise and explain the minimum-move pattern 2ⁿ − 1.

Resources

  • Online Tower of Hanoi page or three cups and graduated card discs
  • Move-recording table
  • Optional spreadsheet

Starter

Show the three-disc puzzle without explaining the solution. Ask pupils to predict the fewest moves and identify which actions are illegal.

Main activity

  1. Pupils solve three discs and record every move.
  2. Repeat with four discs and compare strategies.
  3. Decompose the task: move the top n−1 discs, move the largest disc, then move n−1 discs again.
  4. Generate the sequence 1, 3, 7, 15, 31 and explain why each term is double the previous term plus one.
  5. Extension: write pseudocode for a recursive solution.

Plenary

Ask pupils to explain why moving the largest disc creates two smaller versions of the same problem.

Differentiation

Provide partially completed move tables or reduce to three discs. Extend by analysing time for larger towers or comparing recursive and iterative descriptions.

Assessment evidence

A correct move record, an explanation of the pattern and a short algorithm or pseudocode solution.

Puzzle instruction image