All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Towers of Hanoi (Posted on 2003-09-07)
You have three small poles and five hoops - XS, S, M, L, XL (as in extra small, small, medium, large and extra large). They are placed on pole 1 in order, with largest at the bottom.

You can move one hoop at a time, and the hoops you are not moving have to be on a pole. You also cannot place a hoop on top of a smaller one. How can you move the hoops so that they are in the same order as they are now, but on pole 3?

 See The Solution Submitted by Lewis Rating: 3.0667 (15 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 A non-recursive solution | Comment 15 of 21 |
This is the easiest solution I know:

* On odd turns, move the smallest hoop clockwise.
* On even turns, make the only possible move that doesn't involve the smallest hoop.

Depending on how many hoops there are, and which is your "target" pole, the first rule may read "anti-clockwise"; details left to the reader ;-)
 Posted by Federico Kereki on 2003-09-08 13:18:33

 Search: Search body:
Forums (0)