Like HowStuffWorks on Facebook!

How Towers of Hanoi Works


This seemingly simple puzzle might stump even seasoned gamers. See more pictures of toys and games.
Amazon.com

Monks are known for their spiritual discipline, but the inhabitants of the Hindu temple of Benares are dedicated to the extreme. Day and night, they silently shuffle delicate gold wheels from one diamond post to another. The 64 disks, each thick as a bumblebee, are taken from their original post, slipped onto a second post and eventually begin to tower on a third post -- all with one unflinching rule: A larger disk may not be placed on a smaller one.

While the monks strive to finish their task, everyone else dreads its resolution. When the final disk falls into place, the tower, the temple and the world's terra firma will dissolve into thin air.

Fortunately, the downfall of humankind doesn't actually hinge on the completion of a puzzle. The gold-toting monks are simply part of an enduring legend that surrounds the Towers of Hanoi, a puzzle game invented in the late 1800s.

Even if there were monks actually completing a 64-disk switchback puzzle somewhere, a few reassuring calculations reveal it would require more than 580 billion years to complete the puzzle -- even if the monks moved a disk every single second [source: Lawrence Hall of Science].

Luckily, you can play a more manageable version of Towers of Hanoi in just a few minutes. Also known as the Tower of Brahma or simply Tower of Hanoi, the object is to rebuild the tower, usually made of eight wooden disks, by transferring the disks from Post A to Post B and Post C. As in the legend, the rules forbid placing a larger disk upon a smaller one.

The resulting waltz may seem deceptively simple, at least for the first three moves, which consist of moving the top disk to Post B or C, and the underlying disk to the remaining unoccupied post. After that, you'll need to employ strategy to solve the puzzle.

Still, the Towers of Hanoi can be tackled by children as young as 5 (who sometimes play a scaled-down version with fewer disks), yet it presents a wily challenge to adults. And you may just pick up a greater understanding of mathematical principles along the way.