Skip to main content Skip to footer

Tower of Hanoi

🗼 Tower of Hanoi

Tower of Hanoi is a classic logic puzzle: move a stacked tower of discs from the left peg to the right peg while following simple rules that make it surprisingly deep.

🎯 Objective

Move the entire stack to the target peg in the fewest moves, obeying the placement rules at all times.

📜 Rules & Gameplay

Setup

Three pegs; a tower of discs on the first peg, largest at the bottom and smallest on top.

Legal move
  • Move only one disc at a time.
  • Only the top disc of a stack can be moved.
  • Never place a larger disc on top of a smaller one.
Win condition

All discs end up on the destination peg in correct order (largest at the bottom).

Optimal moves

Minimum moves for n discs is 2n − 1 (e.g., 3 discs → 7 moves, 4 discs → 15 moves).

💡 Strategy Tips

  • Think recursively: move the top n−1 discs aside, move the largest disc, then bring the n−1 discs onto it.
  • Alternate moves of the smallest disc; it typically moves every other turn.
  • Name the pegs (Start, Aux, Target) to plan multi-step sequences more clearly.

🧠 Extra Tips

  • If you lose track, reset focus: where must the largest mis-placed disc go next?
  • Count your moves and compare against the optimal 2n−1 to gauge efficiency.

✨ Why Play Tower of Hanoi

Elegant rules, infinite difficulty scaling, and a perfect lesson in planning, recursion, and problem-solving—great brain training for kids & adults.

📚 History & Math

Popularized in the 19th century, this puzzle is a classic of recreational mathematics. Its solution follows a clean recursive pattern and the move count grows exponentially with the number of discs.