Talk:Tower of Hanoi

This is an old revision of this page, as edited by Jos.koot (talk | contribs) at 18:10, 5 November 2006 (four pegs and beyond). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 18 years ago by Jos.koot in topic four pegs and beyond

Cool! The algorithm I wrote on Know-How has found its way back here! :-) -- Tarquin 14:03 Dec 14, 2002 (UTC)

What in the world does "the treatment of executive functions" mean? P0M 18:04, 6 Jan 2004 (UTC)

We should keep the spelling consistent in this article. Disk or disc? My vote goes to disc - I use disc for anything other than hard disk and floppy disk. --Decrypt3 18:00, May 23, 2004 (UTC)

I remember that on one episode of Survivor: Thailand, the Tower of Hanoi puzzle was used as an immunity challenge. Should this be included in the article?

Apparent contradiction

There's an apparent contradiction in the entry.

- "The object of the game is to move the entire stack to another peg, obeying the following rules:

'only one disc may be moved at a time' "

- "Recursive algorithm ... 'move n−1 discs from A to C. This leaves disc #n alone on peg A' "

If only one disc may be moved at a time, then moving n-1 discs (where n-1 > 1) is an illegal move.

Or am I missing something here? - 200.141.105.210 20:01, 6 January 2006 (UTC)Reply

It's recursive: to move the n-1, you just apply the same three rules to the n-1 to move them.
You eventually just move 1 disc. This could be made clearer, however.
I agree. I'm no expert, but I've done more than the average joe's math and comp. sci, and I can't make heads or tails of that entire section.

Animated GIFs don't animate

There are two GIFS with 3 disks and 4 disks respectively. The captions indicate that they are animated GIFS that show the solution.

I couldn't get them to animate in Firefox 1.5.04, IE 6.0.2900.xpspblahblahblah or Windows Picture and Fax Viewer (the default viewer in Win XP).

I don't think they are animated GIFs anymore.

Can someone reload the animated GIFs. Otherwise the images have no purpose and will need to be removed.

looks fine to me, latest firefox. --71.226.119.121 06:31, 29 July 2006 (UTC)Reply

useless paragraph

I suggest to delete the first paragraph of the section "practical algorithm" which is more complicated than the rest and completely useless; the strategy is simply: "move the smallest one step in a fixed direction (e.g. always clockwise), and then make the only move possible with another disc". — MFH:Talk 14:26, 12 October 2006 (UTC)Reply

...what

"One could thus easily compute the positions of discs in a set of eighty discs after some mole of advancements, if the margin were but large enough to contain it."

This sentence seems irrelevant and is completely out of the blue. Is it supposed to be there? 134.173.200.102 05:10, 23 October 2006 (UTC)Reply

I think it's a joke.— MFH:Talk 01:16, 25 October 2006 (UTC)Reply

how to find the no. of moves

four pegs and beyond

It is stated that: "Although the three-peg version has a simple recursive solution as outlined above, the optimal solution for the Tower of Hanoi problem with four or more pegs is still an open problem." To me this seems incorrect. Represent the problem by an undirected graph, the nodes representing different distributions of disks among the pegs and the branches representing moves. Give each branch length 1. Use Dijkstra's algorithm to find the shortest path from one distribution to another one. It is not difficult to prove that the graph is connected, i.e. that at least one path exists from every node to every other node. Jos.koot 18:10, 5 November 2006 (UTC)JosKootReply