Tower of Hanoi Puzzle
Tower of Hanoi Puzzle
http://chemeng.p.lodz.pl/zylla/games/hanoi4e.html
Hmm, my wrong moves get really high the more pieces I move.
Hmm, my wrong moves get really high the more pieces I move.
Re: Tower of Hanoi Puzzle
I remember having to solve this puzzle for computer science back in high school. I don't recall whether or not we had to solve it in the least possible moves like this version, or if we simply had to provide any solution that worked.Wabbit wrote: Hmm, my wrong moves get really high the more pieces I move.
There is actually a very simple set of rules to follow to solve it in the least possible number of steps, although there is one complication - the rules are slightly different depending on whether you have an even or odd number of disks.
Spoiler:
http://www.tequilasplace.com/temp/hanoi.txt
this is a classic discrete math problem.
http://www.lawrencehallofscience.org/Ja ... story.htmlFascinating Facts
The Tower of Hanoi (sometimes referred to as the Tower of Brahma or the End of the World Puzzle) was invented by the French mathematician, Edouard Lucas, in 1883. He was inspired by a legend that tells of a Hindu temple where the pyramid puzzle might have been used for the mental discipline of young priests. Legend says that at the beginning of time the priests in the temple were given a stack of 64 gold disks, each one a little smaller than the one beneath it. Their assignment was to transfer the 64 disks from one of the three poles to another, with one important provisoøa large disk could never be placed on top of a smaller one.
Where's the Math in this Game?
The number of separate transfers of single disks the priests must make to transfer a tower is 2 to the 64th minus 1, or 18,446,744,073,709,551,615 moves! If the priests worked day and night, making one move every second it would take slightly more than 580 billion years to accomplish the job!
On wikipedia they have a gif of the 4 move tower--it's about half way down the page.
http://en.wikipedia.org/wiki/Tower_of_Hanoi
http://en.wikipedia.org/wiki/Tower_of_Hanoi
.
somewhat but with more bars introduced the steps take more switching which makes it more complicated, i can't explain it, just when I think I have the idea on what needs to happen moves have an exponential increase in complexity( added moves)dzjepp wrote:For the tall columns, are you supposed to anticipate moves in advance or is it all elementary math at the core? (albeit very, very, very repetitive).
Re: .
There's a simple algorithm that works for any number of disks with the slight hitch that there is a small difference between solving it for an odd or even number of disks.Tsakali_ wrote:somewhat but with more bars introduced the steps take more switching which makes it more complicated, i can't explain it, just when I think I have the idea on what needs to happen moves have an exponential increase in complexity( added moves)dzjepp wrote:For the tall columns, are you supposed to anticipate moves in advance or is it all elementary math at the core? (albeit very, very, very repetitive).
Setting the # of disks to 3 and 4, while it may seem too easy, will make it much easier to discover the algorithm.
Start with 3 disks, instead of thinking about it strictly in terms of "winning", think about it in terms of making mental rules for yourself that "always work". Then move on to 4 disks, try the same thing and you'll find you need slightly different rules to make it "always" work, because of the odd/even discrepency.
Once you have that, solving it for higher number of disks is just as straightfoward, albeit the more disks you have the easier it is to lose track of what you're doing and make a mistake.
---
a couple hints:
1) With only 3 disks, see what happens when your very first move is to the middle pole vs. to the third pole, and analyze why only one of those moves will solve it in the least possible number of steps.
2) The bottom most disk must only be moved once if you want to solve it in the least possible number of steps - from its initial position to the third pole. This is why the discrpency arises between how you solve it for odd vs. even numbers of disks.