Nepedia
Back to Discover
Fluent Reader
🔢

Tower of Hanoi

math Maturity 7-9 Next article →

The Tower of Hanoi is a famous math puzzle that tests how we solve problems.

Tower of Hanoi
Tower of Hanoi

It uses three rods and a stack of disks of different sizes. At the start, all disks sit on one rod in a neat pile. The smallest disk is on top, and they get larger as you go down. This makes the stack look like a cone or a pyramid.

Tower of Hanoi 4
Tower of Hanoi 4

Your goal is to move every disk to a different rod. To do this, you must follow two very important rules. You can only move one disk at a time. Also, you can never place a larger disk on top of a smaller one.

Solving the puzzle requires a smart way of thinking. You might try to move pieces back and forth, but there is a fastest way. For a stack with only three disks, you can finish in seven moves.

tower of hanoi graph
tower of hanoi graph

If you have more disks, the number of moves grows very quickly. One way to solve it is to use a method called recursion. This means you treat a big task as a collection of smaller tasks. To move a large stack, you first move the smaller top part to a spare rod. Then, you move the biggest disk to the new home. Finally, you move the smaller stack on top of that big disk.

A French mathematician named Édouard Lucas invented this puzzle. He first showed it to people in 1883.

UniversumUNAM34
UniversumUNAM34

He used a secret name for himself when he first presented the game. Later, he published the puzzle in a booklet in 1889. There are many old legends about where the game came from. Some stories say it started in a place called Tonkin. Other legends say priests in a temple in Benares have been moving disks for a long time. These stories often involve a sacred tower made of golden disks.

Some of these legends are quite amazing and even a bit spooky. One story says the tower has 64 golden disks. It claims that the world will end when the priests finish moving them.

If you moved one disk every single second, it would take a huge amount of time. It would take 585 billion years to move all 64 disks. That is about 42 times longer than the age of the universe! Because the number of moves grows so fast, the task is nearly impossible. This shows how math can describe things that are much bigger than our lives.

You can see how this math works in many different ways. You can solve it by alternating between moving the top disk and another disk. Some people even use computer math called binary to find the right moves.

Hanoi-Graph-7
Hanoi-Graph-7

This puzzle is not just a game for fun. It is used to teach people how to write computer programs. It helps us understand how to break down hard jobs into easy steps. Whether you use a toy version or a computer, the rules stay the same. It is a perfect way to see math in action.

505 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (8)
File:Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
File:Tower of Hanoi 4.gif
Tower of Hanoi 4.gif
File:UniversumUNAM34.JPG
UniversumUNAM34.JPG
File:Iterative algorithm solving a 6 disks Tower of Hanoi.gif
Iterative algorithm solving a 6 disks...
File:tower_of_hanoi_graph.svg
tower_of_hanoi_graph.svg
File:Hanoi-Graph-7.svg
Hanoi-Graph-7.svg
File:BTOHIC.jpg
BTOHIC.jpg
File:BTOHFC.jpg
BTOHFC.jpg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.