We shall also consider some variants of the basic problem, various solutions, and various questions about solutions.
For purposes of this exposition, we formalize the pegs by
Def otherPeg(x; y) == 6-(x+y)
We formalize the disks by consecutive numbers
We represent a stacking situation by a function of type Peg
We formalize a one disk move between stacking situations by
Def Moving disk k of n takes f to g
Def == (i:{1...n}. f(i) = g(i)
Peg
i
k)
Def == & (i:{1...k-1}. f(i)
f(k)
Peg & g(i)
g(k)
Peg)
{1...n}
Peg
{1...n}
Peg
{1...n}
i:{1...n}. f(i) = g(i)
i
k
Thm* n:
, f,g:({1...n}
Peg), k:{1...n}.
Thm* Moving disk k of n takes f to gMoving disk k of n takes g to f
A sequence of stacking situations, whether or not it represents a sequence of legal moves, will be represented as a function over a range of consecutive integers with explicitly indicated endpoints:
s {a...z}
{1...n}
Peg
A function over consecutive integers is used for convenience of relating positions in a sequence, and the endpoints are allowed to vary (rather than always starting at 1, say) to make combination of sequences somewhat more perspicuous (given the functional representation) than continually shifting the index sets. The property of being a sequence of stacking situations related by consecutive moves is
Def s is a Hanoi(n disk) seq on a..z
Def ==x,x':{a...z}.
Def == x+1 = x'(
k:{1...n}. Moving disk k of n takes s(x) to s(x'))
The
Finally, the subject of the towers of Hanoi problem, a restricted kind of sequence of stacking situations, is conveniently formulated as
s is a Hanoi(n disk) seq on a..z & s(a) = ( i.p) & s(z) = (
i.q)
which is a sequence whose first stacking situation locates all disks at
About:
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |