Explore modules

Hanoi Three-Peg Shortest State Path

Explore legal disk moves and see why a deceptively small puzzle needs exponentially many steps.

Free theory article

Explore legal disk moves and see why a deceptively small puzzle needs exponentially many steps.

Concept & interpretation

The Tower of Hanoi is a classic mathematical puzzle that perfectly illustrates recursive problem-solving and exponential growth. The objective is to move an entire stack of disks from one peg to another, subject to the rules that only one disk may be moved at a time, and a larger disk can never be placed on top of a smaller disk.

experiment

You can interact with the puzzle parameters to trace the shortest path and count available moves from any valid state. Using the interactive controls in the Hanoi Three-Peg Shortest State Path module:

  1. Set the Disks count to exactly 3.
  2. Adjust the Inspected moves select.
  3. Observe the visual graph and disk positions on pegs.
  4. Inspect the resulting Legal Neighbors to count the possible moves from the current state.
Read the full free theory article