Log in Sign up
Back to Discover
🔢

Tower of Hanoi

math Maturity 7-9

This is a fun game.

Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
It has three sticks. You move round disks from one stick to another. You cannot put a big disk on a small one. It is a tricky puzzle! Can you solve it?

40 words

This is a fun puzzle.

Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
It uses three sticks and many disks. The disks are different sizes. They start in a stack. The small ones are on top.

You must move the stack to a new stick. You can move only one disk at a time. You cannot put a big disk on a small one.

A man named Édouard Lucas made this game.

Tower of Hanoi 4.gif
Tower of Hanoi 4.gif
Legend says monks move golden disks in a temple. If they finish, the world ends. It would take a very long time!

With three disks, you need seven moves. You can play with many disks. Can you solve it?

110 words

The Tower of Hanoi is a famous math puzzle.

Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
It uses three rods and several disks. The disks have different sizes. They start in a stack on one rod. The smallest disk is at the top.
Tower of Hanoi 4.gif
Tower of Hanoi 4.gif

Your goal is to move the whole stack to another rod. You must follow two main rules. First, you can move only one disk at a time. Second, you cannot put a large disk on top of a smaller one.

A man named Édouard Lucas shared this game in 1883. Some old legends say monks move golden disks in a temple. These stories say the world ends when the task is done. If a tower had 64 disks, it would take a very long time. It would take 585 billion years to finish!

Iterative algorithm solving a 6 disks Tower of Hanoi.gif
Iterative algorithm solving a 6 disks Tower of Hanoi.gif

Math helps us find the best way to play. For a tower with three disks, you need seven moves. You can use a method called recursion. This means you break a big problem into smaller parts. You solve the small parts to finish the big puzzle.

191 words

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

Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
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.gif
Tower of Hanoi 4.gif
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.svg
tower of hanoi graph.svg
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.JPG
UniversumUNAM34.JPG
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.svg
Hanoi-Graph-7.svg
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.

521 words

The Tower of Hanoi is a mathematical puzzle involving three rods and a set of disks.

Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
Each disk has a different diameter, allowing them to slide onto any rod. The puzzle begins with all disks stacked on one rod in decreasing order of size. This arrangement creates a conical shape with the smallest disk at the very top. The objective is to move the entire stack to a different rod. To succeed, a player must obey two strict rules. First, only one disk may be moved at a time. Second, no disk may be placed on top of a smaller disk. These rules ensure that the stack always maintains a specific order.

Solving the puzzle involves understanding how the number of moves grows with each added disk. The minimum number of moves required to solve the puzzle is expressed by the formula 2^n - 1, where n represents the number of disks. For example, a puzzle with three disks requires exactly seven moves to complete.

Tower of Hanoi 4.gif
Tower of Hanoi 4.gif
As more disks are added, the difficulty increases exponentially. This mathematical relationship is a core part of the puzzle's complexity. It demonstrates how simple rules can lead to very large numbers very quickly.

There are several ways to approach a solution, including iterative and recursive methods. An iterative solution involves a repeating pattern of moves. One method is to alternate between moving the top disk and moving another legal piece. If the number of disks is even, the top disk moves in one direction around the rods. If the number is odd, it moves in the opposite direction.

Iterative algorithm solving a 6 disks Tower of Hanoi.gif
Iterative algorithm solving a 6 disks Tower of Hanoi.gif
Another way to solve it is through a sequence of legal moves between specific pegs. By following a set order of moves between pegs A, B, and C, the stack will eventually reach its destination.

A recursive solution is often used to teach computer programming. Recursion is a process where a large problem is broken down into smaller sub-problems.

tower of hanoi graph.svg
tower of hanoi graph.svg
To move a stack of n disks from a source peg to a target peg, you must first move the top n-1 disks to a spare peg. Once the largest disk is free, you move it to the target peg. Finally, you move the n-1 disks from the spare peg onto the target peg. This strategy reduces the problem step by step until it reaches a "base case." In this puzzle, the base case is moving zero disks, which requires doing nothing.

The puzzle was invented by the French mathematician Édouard Lucas. He first presented the game in 1883 using the pseudonym "N. Claus (de Siam." This name was an anagram of his own name, Lucas d'Amiens.

UniversumUNAM34.JPG
UniversumUNAM34.JPG
He later published the game in a booklet in 1889. Various legends accompany the puzzle, suggesting ancient and mystical origins. Some stories claim the game originated in Tonkin or was practiced by priests in a Benares temple. These legends often describe a "Sacred Tower of Brahma" made of golden disks.

One famous legend involves a tower consisting of 64 golden disks. It claims that the completion of the tower will lead to the end of the world. The scale of this task is difficult to imagine. If a person made one move every second, it would take 2^64 - 1 seconds to finish. This is approximately 585 billion years.

Hanoi-Graph-7.svg
Hanoi-Graph-7.svg
To put this in perspective, that duration is roughly 42 times the estimated current age of the universe. These massive numbers highlight the exponential growth found in the puzzle's math.

Beyond being a game, the Tower of Hanoi is a significant tool in mathematics and science. It is a classic example used to demonstrate mathematical induction and recurrence relations. In computer science, it helps students understand how algorithms function. The puzzle also connects to other mathematical concepts, such as binary representation. The position of disks after any given move can be determined using the binary form of the move number. This deep connection between a simple game and complex logic makes the Tower of Hanoi a fundamental study in pattern and structure.

689 words
🖼️ 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
Up Next
🔢
Mathematical puzzle
Math
More to explore

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.