Towers of Hanoi
by Jillian Gregory
Are you interested in math or computer science? Do you enjoy working through long algorithms and data structures? If you love puzzles, mathematics, or computer programming then the "Towers of Hanoi" problem is brain teaser designed just for you.
At first glance, the Towers of Hanoi problem appears to be a simple matter of trial and error. The problem consists of three wooden pegs. The center wooden peg contains 8 discs of varying size. The discs decrease in diameter from the bottom to top. For example, the bottom disc could be 8 inches in diameter and the disc on top of it could be 6 inches in diameter. Place a 4 inch disc on top of that followed by a 2 inch disc on the very top. At the beginning of the problem, the two remaining pegs do not contain any discs.
The goal of the Towers of Hanoi problem is to move all the discs from the center peg to one outside peg. Sounds easy, right? There are two rules that you must follow. Rule #1 is that you can move only one peg at a time. Rule #2 is that you can not place a larger disc on top of a smaller disc. This is the reason why there are three pegs in the problem as opposed to just two pegs.
How would you solve this intriguing problem? First instinct is to play with the problem and try to solve it by trial and error. This is a great way to understand the components of the problem. Remember to catch yourself if you try to place a larger disc on top of a smaller disc. That is not allowed! Here on GrandMatrix we have a free online version of the Towers of Hanoi where you can set the number of discs and of you are stumped you can be shown the solution!
Playing this game online you will notice that you can choose to work on the problem with a fewer number of discs (i.e. 3, 4, 5, 6, or 7 discs). Start out with only 3 discs to give yourself confidence and a quick chance at finding the solution. It is a fun puzzle to solve and will have your logical brain buzzing with excitement.
What is the history of the Towers of Hanoi problem? French mathematician Edouard Lucas was the first to propose this problem in 1883. There were 8 discs in the initial problem. However, the level of difficulty of the problem can be adjusted by working with a fewer number of discs such as 3 or 4 discs. Beginners can start with 3 discs to practice solving the problem. Consider yourself a genius if you can solve the Towers of Hanoi problem that contains 8 discs!
Mathematicians and computer science experts revel in the complexity of the 8 disc problem. It demonstrates useful mathematical algorithms and programming data structures. Recursive functions are at the heart of the problem. You might be unfamiliar with this terminology. A recursive function is one that repeatedly calls upon itself until a terminating condition is met. This may interest computer programmers, but to other puzzle players the Towers of Hanoi is just plain fun!


