[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

8.0. "Tower of Hanoi" by HARE::STAN () Sun Jan 22 1984 11:22

Peter Gilbert recently asked me if I knew of any work done on
the classic Tower of Hanoi problem when there are more than 3 pegs.

I came up with the following reference for him:

Brother Alfred Brousseau, Tower of Hanoi with More Pegs.
	Journal of Recreational Mathematics. 8(1975-1976)169-176.

Brousseau comes up with some recursion formulae for the minimum
number of moves needed.

I've seen lots of computer programs around DEC for the classic case
of 3 pegs.  Does anyone out there have any program that uses more
than 3 pegs?
T.RTitleUserPersonal
Name
DateLines
8.1TURTLE::GILBERTTue Jan 24 1984 01:405
Indeed, I do.  It minimizes the number of moves.

Although Brousseau's formulae minimize the number of moves, they are given
without proof that they are minimal.  The problem is for a simple way to
prove the recurrence relations.
8.2RANI::LEICHTERJWed Jan 25 1984 00:5014
For a fascinating "different approach" to the Tower of Hanoi, see "Pattern
Analysis as a Tool for Inventing Algorithms", by Richard Hart (Software -
Practice and Experience, V10, pg. 405-417 (1980)).  He gives a non-recursive
"closed-form" algorithm, which reads as follows "Move the smallest piece to
the next spindle on the left.  Then make the only other move possible.  Repeat,
always moving the smallest disk in a circle - 3 to 2 to 1 to 3..."
The spindles are 1,2,3 = start, spare, finish, left to right.

The same paper also contains the strangest date conversion algorithm you
ever saw, and a description of a new sort that is alleged to be the fastest
one known.  All programs are given in uncommented, very basic BASIC (letter
and letter-digit variable names, for example); the sort program is totally
incomprehensible (to me).
							-- Jerry
8.3REX::POWERSThu Feb 23 1984 17:346
There is another interesting approach, though not as rigorous,
in the October 1983 "Computer Recreations" column in Scientific American.
The thrust of the column is directed to 'associative processing'
aka spreadsheets in genericalc.
The question is asked, but not pursued, regarding whether there is
a non-algorithmic approach to the Towers of Hanoi problem.
8.4TURTLE::GILBERTWed Apr 04 1984 18:028
For the 3-spire version of the Towers of Hanoi, consider the following
non-procedural solution:

Never move the same disk twice in a row.
Never place an odd-width disk on an odd-width disk.
Never place an even-width disk on an even-width disk.

This assumes that there is a solution to the problem!
8.5TURTLE::GILBERTWed Apr 04 1984 18:084
I'm still interested in a proof that recurrence relation or procedure gives the
smallest number of disk moves for the case of 4 or more spires.

Any takers?
8.6HARE::STANMon May 14 1984 16:474
An optimality proof can be found in

Helmut Jurgensen and Derick Wood, The Multiway Trees of Hanoi,
	Intern. J. Computer Math, 14(1983)137-153.
8.7TURTLE::GILBERTSun Aug 05 1984 08:1017
The "Multi-way Trees of Hanoi" describes a generalization of the Towers of Hanoi
which allows several small disks (of the same size) to sit atop a larger disk.
For example:

	1 1 1 1 1 1 1 1 1
	==2== ==2== ==2==
	========3========

This one requires at least 6 "places" (counterparts of spires in vanilla Hanoi)
to move the tree.

Unfortunately, the reference only considers having the fewest possible number of
places which allow the movement.

The request for proof of a recurrence giving the minimal number of moves for
four or more spires is still open.
					- Gilbert