aa r X i v : . [ m a t h . C O ] A ug TWIN TOWERS OF HANOI
ZORAN ˇSUNI´C
Dedicated to Antonio Machi on the occasion of his retirement
Abstract.
In the Twin Towers of Hanoi version of the well known Towers ofHanoi Problem there are two coupled sets of pegs. In each move, one chooses apair of pegs in one of the sets and performs the only possible legal transfer of adisk between the chosen pegs (the smallest disk from one of the pegs is movedto the other peg), but also, simultaneously, between the corresponding pair ofpegs in the coupled set (thus the same sequence of moves is always used inboth sets). We provide upper and lower bounds on the length of the optimalsolutions to problems of the following type. Given an initial and a final positionof n disks in each of the coupled sets, what is the smallest number of movesneeded to simultaneously obtain the final position from the initial one in eachset? Our analysis is based on the use of a group, called Hanoi Towers group,of rooted ternary tree automorphisms, which models the original problem insuch a way that the configurations on n disks are the vertices at level n of thetree and the action of the generators of the group represents the three possiblemoves between the three pegs. The twin version of the problem is analyzedby considering the action of Hanoi Towers group on pairs of vertices. Towers of Hanoi and Twin Towers of Hanoi
We first describe the well known Hanoi Towers Problem on n disks and 3 pegs.The n disks have different size. Allowed positions (which we call configurations) ofthe disks on the pegs are those in which no disk is on top of a smaller disk. Anexample of a configuration on 4 disks is provided in Figure 1). In a single move, thetop disk from one of the pegs can be transferred to the top position on another pegas long as the newly obtained position of the disks is allowed (it is a configuration). t t a * * i i a i i a
14 2 3
Figure 1.
A configuration on four disks
This material is based upon work supported by the National Science Foundation.
Label the three pegs by 0, 1 and 2. At any moment, regardless of the currentconfiguration, there are exactly three possible moves, denoted by a , a , and a .The move a ij transfers the smallest disk from pegs i and j between these two pegs.More precisely, if the smallest disk on pegs i and j is on i the move a ij transfers itto j , and if it is on j the move transfers it to i . For instance, the move a appliedto the configuration in Figure 1 transfers disk 2 from peg 1 to peg 0, a transfersdisk 1 from peg 2 to peg 0, and a transfers disk 1 from peg 2 to peg 1. We do notneed to specify the direction of the transfer, since it is uniquely determined by thedisks (by their size) that are currently on pegs i and j . In the exceptional case whenthere are no disks on either peg i or j , the move a ij leaves such a configurationunchanged.In the classical Towers of Hanoi Problem on n disks all disks are initially on oneof the pegs and the goal is to transfer all of them to another (prescribed) peg inthe smallest possible number of moves. It is well known that the optimal solutionis unique and consists of 2 n − n disks, what is the smallestnumber of moves needed to obtain the final configuration from the initial one. Itturns out that this problem always has a solution (regardless of the chosen initialand final configurations) and that the optimal solution is either unique or there areexactly two solutions. The latter happens for a relatively small number of choices ofinitial and final configurations. For a survey on topics and results related to HanoiTowers Problem see [Hin89] and for an optimal solution (represented/obtained bya finite automaton) for any pair of configurations see [Rom06]. Note that, in thissetting, none of the instances of the general problem is more difficult (in terms ofthe optimal number of moves) than the classical problem.In the Twin Towers of Hanoi version two sets of three pegs labeled by 0, 1 and2 are coupled up. We often refer to the two sets as the top and the bottom set.A coupled configuration on n disks is a pair of configurations on n disks, one ineach set (see, for instance, the coupled configuration on 4 disks in Figure 2). Amove a ij applied to a coupled configuration consists of application of the move a ij to each configuration in the coupled pair. For instance, the move a applied tothe coupled configuration in Figure 2 transfers disk 1 in the top set to peg 1 and,simultaneously, disk 1 in the bottom set to peg 0. The move a applied to thesame coupled configuration, transfers disk 1 in the top set and disk 2 in the bottomset to peg 2 (in their sets), and a changes nothing in the top set and transfersdisk 1 in the bottom set to peg 2.In the setting of Twin Towers we pose three problems. Problem 1 (Twin Towers Switch) . Given the initial coupled configuration in whichall disks in the top set are on peg 0 and all disks in the bottom set are on peg 2,how many moves are needed to obtain the final coupled configuration in which alldisks in the top set are on peg 2, and all disks in the bottom set are on peg 0?Note that the Twin Towers Switch Problem asks for simultaneous solution oftwo instances of the classical Hanoi Towers Problem (all disks are, simultaneously,using the same sequence of moves, transferred from peg 0 to peg 2 in the top set,and from peg 2 to peg 0 in the bottom set).
Problem 2 (Small Disk Shift) . Given the initial coupled configuration in Figure 2,how many moves are needed to obtain the final coupled configuration in which all
WIN TOWERS OF HANOI 31234
Figure 2.
Initial position for the Small Disk Shift Problemdisks are in the same positions as in the initial one, except the smallest disk in eachset is moved one peg to the right (disk 1 in the top configuration to peg 1, and disk1 in the bottom configuration to peg 2)?
Problem 3 (General Problem) . Given any initial coupled configuration and anyfinal coupled configuration what is the smallest number of moves needed to obtainthe final configuration from the initial one?We provide an upper bound for the Twin Towers Switch, exact answer for theSmall Disk Shift, and lower and upper bounds for the General Problem restrictedto basic coupled configurations (defined below).
Theorem TTS (Twin Towers Switch) . The smallest number of moves needed tosolve the Twin Towers Switch Problem on n disks is no greater than a ( n ) , where a ( n ) = ( , n = 1 , · n − ( − n , n ≥ . Remark.
The sequence a ( n ) satisfies the Jacobshtal linear recursion a ( n ) = a ( n −
1) + 2 a ( n − , for n ≥ , with initial condition a (1) = 1, a (2) = 5, and a (3) = 11. Conjecture TTS.
The smallest number of moves needed to solve the Twin TowersSwitch problem on n disks is exactly a ( n ) . Note that the Twin Towers Switch, requiring no more than roughly n moves isnot considerably more difficult than the classical problem of moving a single tower,which requires roughly 2 n moves. In fact, there are more difficult problems that canbe posed in the context of coupled sets (recall that there are no problems that aremore difficult than the classical problem when only one set of disks is considered).For instance, the next result implies that the Small Disk Shift Problem requiresmore moves than the Twin Towers Switch Problem. ZORAN ˇSUNI´C
Theorem SDS (Small Disk Shift) . The smallest number of moves d ( n ) needed tosolve the Small Disk Shift Problem on n disks is equal to d ( n ) = , n = 1 , , n = 2 , · n , n ≥ . In order to state our result on the General Problem, we need the notion ofcompatible coupled configurations. An initial coupled configuration I on n disks is compatible to the final coupled configuration F on n disks if F can be obtained from I in a finite number of moves. A coupled configuration is called basic if the smallestdisks in its top configuration and the smallest disk in its bottom configuration arenot on corresponding pegs (it is not the case that both are on peg 0, both on peg1, or both on peg 2).Note that, based on the branching structure of Hanoi Towers group describedby Grigorchuk and the author in [GˇS07], D’Angeli and Donno show in [DD07] thatHanoi Towers group acts distance 2-transitively on the levels of the rooted ternarytree. This provides a characterization of the pairs of compatible coupled configu-rations. In particular, their result implies that all basic coupled configurations arecompatible. We quote their result in more detail (Theorem 1), after we sufficientlydevelop the necessary terminology. Along the way we provide a different proof (weneed it for our upper bound estimate on the General Problem). Note that an inter-esting consequence of the result of D’Angeli and Donno is that the Hanoi Towersgroup induces an infinite sequence of finite Gel ′ fand pairs (see [DD07] for details). Theorem GP (General problem for basic configurations) . The number of movesneeded to obtain one basic coupled configuration on n disks from another is nogreater than × n = 3 . × n . Note that the coupled configurations in Theorem SDS are basic. Thus, The-orem SDS implies that for at least one pair of basic coupled configurations thesmallest number of moves that is needed to obtain one from the other is exactly2 × n .Obtaining good upper bound seems to be a difficult task, since one needs tosolve all instances of the problem in optimal or nearly optimal way. Lower boundsseem a bit easier to obtain since they may be derived from lower bounds from somespecific, well chosen, instances. The lower bound (2 × n ) and the upper bound(3 . × n ) provided here differ by less than a factor of two.All results mentioned so far will be recast in the following sections in the naturalsetting of group actions on rooted trees. The reason is that this setting provides aconvenient language and tools to prove our results. Acknowledgment.
The author is thankful to Tullio Ceccherini-Silberstein andAlfredo Donno for their help, useful remarks, and corrections.2.
Encoding by words and tree automorphisms
We start by an encoding of the original Hanoi Towers Problem on three pegs,as originally presented in [GˇS06] (and further elaborated in [GˇS07, GˇS08]), by agroup of rooted ternary tree automorphisms.
WIN TOWERS OF HANOI 5
Label the disks by 1 , , . . . , n according to their size (smallest to largest). Theconfigurations can be encoded by words over the finite alphabet X = { , , } . Theletters in this alphabet represent the pegs. The word x x . . . x n represents theunique configuration on n disks in which, for i = 1 , . . . , n , the disk i is on peg x i .For example, the word 2120 represents the configuration in Figure 1. Note thatthere are exactly 3 n configurations on n disks.The moves a ij are encoded as the transformations of the set of all finite words X ∗ over X defined by a (2 . . . u ) = 2 . . . u, a (1 . . . u ) = 1 . . . u, a (0 . . . u ) = 0 . . . u,a (2 . . . u ) = 2 . . . u, a (1 . . . u ) = 1 . . . u, a (0 . . . u ) = 0 . . . u,a (2 . . .
2) = 2 . . . , a (1 . . .
1) = 1 . . . , a (0 . . .
0) = 0 . . . , for any word u in X ∗ . Thus, a ij changes the first occurrence of i or j to the otherof these two symbols. The point of, say, a “ignoring” initial prefixes of the form2 ℓ is that such prefixes represent small disks on peg 2, and a should ignore suchdisks, since it is supposed to transfer a disk between peg 0 and peg 1. The firstoccurrence of 0 or 1 represents the smallest disk on one of these two pegs andchanging this occurrence of the symbol 0 or 1 to the other one in the code of thegiven configuration transfers the corresponding disk to the other peg. Note that if a ij is applied to (a code of) a configuration that has no occurrences of i or j it leavessuch a configuration unchanged. This corresponds to the situation in which thereare no disks on pegs i ad j and the move a ij has no effect on such a configurationsince there are no disks to be moved.In order to work with more compact notation, set a = a, a = b, a = c. In this notation, the moves a , b and c act on the set of all finite words X ∗ by a (2 . . . u ) = 2 . . . u, b (1 . . . u ) = 1 . . . u, c (0 . . . u ) = 0 . . . u,a (2 . . . u ) = 2 . . . u, b (1 . . . u ) = 1 . . . u, c (0 . . . u ) = 0 . . . u, (1) a (2 . . .
2) = 2 . . . , b (1 . . .
1) = 1 . . . , c (0 . . .
0) = 0 . . . . Hanoi graph on n disks, denoted by Γ n , is the graph on 3 n vertices representingthe configurations on n disks. Two vertices u and v are connected by an edgelabeled by s ∈ { a, b, c } if the configurations represented by u and v can be obtainedfrom each other by application of the move s (note that each of the moves is aninvolution). The Hanoi graph on 3 disks is depicted in Figure 3. Graphs verysimilar to the graphs we just defined have already appeared in the literature inconnection to Hanoi Towers Problem (see, for instance, [Hin89]). The difference isthat the edges are usually not labeled and there are no loops at the corners.The set of all words X ∗ has the structure of a rooted ternary tree in which theroot is the empty word, level n of the tree consists of the 3 n words of length n over X , and each vertex (each word) u has three children, u u u
2. Thetransformations a , b and c act on the tree X ∗ as tree automorphisms (in particular,they preserve the root and the levels of the tree). Thus, a , b and c generate a groupof automorphisms of the rooted ternary tree X ∗ . The group H = h a, b, c i , calledHanoi Towers group, was defined in [GˇS06]. The Hanoi graph Γ n is the Schreiergraph, with respect to the generating set { a, b, c } , of the action of H on the wordsof length n in X ∗ (Schreier graph of the action on level n in the tree). ZORAN ˇSUNI´C (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) c b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9)(cid:9) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • bc (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a Figure 3. Γ , the Hanoi graph on 3 disksA sequence of moves is a word over S = { a, b, c } . The order in which moves areapplied is from right to left as in the following calculation caba (0220) = cab (1220) = ca (1020) = c (0020) = 0010 . The structure of the Hanoi graphs is fairly well understood. In particular, for n ≥
0, the Hanoi graph Γ n +1 is obtained from the Hanoi graph Γ n as follows [GˇS07].Three copies of Γ n are constructed by appending the label 0, 1, and 2, respectively,to every vertex label in Γ n . Then the two loops labeled by c at the vertices 0 n n n n c ,the two loops labeled by b at the vertices 1 n n n n b , and the two loops labeled by a atthe vertices 2 n n n n a . Indeed, this “rewiring” on the next level (level n + 1) needs to bedone as indicated since c (0 n
1) = 0 n b (1 n
0) = 1 n a (2 n
0) = 2 n
1. In general,the graphs for even and odd n have the form provided in Figure 4 and Figure 5.These figures suffice for our purposes, since only the region near the path from 0 n to 2 n (near the bottom) and near the path from 0 n to 1 n (near the left side) playsignificant role in our considerations.The following lemma, providing a non-recursive, optimal solution to the classicalHanoi Towers Problem is part of the folklore (it has been proved and expressed inmany disguises and our setting may be considered one of them). WIN TOWERS OF HANOI 7 (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • ac (cid:7)(cid:7) (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c a b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • ac (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a Figure 4.
Hanoi graph on even number of disks
Lemma 1.
The diameter of the Hanoi Towers graph Γ n is n − . It is achievedas the distance between any two of the configurations n , n , and n . The uniquesequence of moves of length n − between any two of these configurations is givenin the following table. even n odd n from \ to 0 n n n n n n n × ( cab ) m ( n ) ( cba ) m ( n ) × a ( cba ) m ( n ) b ( cab ) m ( n ) n ( bac ) m ( n ) × ( bca ) m ( n ) a ( bca ) m ( n ) × c ( bac ) m ( n ) n ( abc ) m ( n ) ( acb ) m ( n ) × b ( acb ) m ( n ) c ( abc ) m ( n ) × where m ( n ) = (2 n − , for even n , and m ( n ) = (2 n − , for odd n . Our goal is to provide some understanding of the coupled Hanoi graph CΓ n on n disks. The vertices of this graph are the 3 n pairs of words (cid:0) u T u B (cid:1) of length n over X (representing the top and the bottom configuration on n disks in a coupledconfiguration). Two vertices in CΓ n are connected by an edge labeled by s in { a, b, c } if the coupled configurations represented by these vertices can be obtainedfrom each other by application of the move s . The coupled Hanoi graph on 1 diskis depicted in Figure 6. The coupled Hanoi graph CΓ n is the Schreier graph, withrespect to the generating set { a, b, c } , of the action of H on the pairs of words oflength n in X ∗ defined by s (cid:18) u T u B (cid:19) = (cid:18) s ( u T ) s ( u B ) (cid:19) , for s in { a, b, c } . ZORAN ˇSUNI´C (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • cc (cid:7)(cid:7) (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c b c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • bc (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a Figure 5.
Hanoi graph on odd number of disks( ) ( ) ( ) (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a c DDDDDDDDDDD b QQQQQQQQQQQQQQQQQQ (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c zzzzzzzzzzz b a DDDDDDDDDDD (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b mmmmmmmmmmmmmmmmmm a zzzzzzzzzzz c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) c b ( ) (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a ( ) ( ) ( ) ( ) ( ) Figure 6. CΓ , the coupled Hanoi graph on 1 disk3. Twin Towers Switch
In this section we provide an upper bound on the number of moves needed tosolve the Twin Towers Switch Problem. In the language of coupled Hanoi graphsthe same result is expressed as follows.
Theorem TTS ′ . The distance between the coupled configurations (cid:18) . . . . . . (cid:19) and (cid:18) . . . . . . (cid:19) WIN TOWERS OF HANOI 9 in the coupled Hanoi graph CΓ n (on n disks) is no greater than a ( n ) = ( , n = 1 , · n − ( − n , n ≥ . Proof.
Let n = 2. We have, by using (1), ababa (00) = abab (10) = aba (12) = ab (02) = a (22) = 22 . Since ababa is a palindrome, it has order 2 (as a group element) and, therefore, ababa (22) = 00. Thus the distance between the initial and the final coupled con-figurations is no greater than 5 (it can be shown that it is actually 5).Assume that n is even and n ≥
4. Consider the sequence of a ( n ) = · n − moves ababa ( cacababa ) (2 n − − . Notice the pattern (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • that repeats along the bottom edge in Figure 4, indicating that the result of theaction of cacababa and ( cba ) on the leftmost vertex in the pattern is the same andit is equal to the rightmost vertex in the pattern (which is the leftmost vertex inthe next occurrence of the pattern). Therefore, by (1) and Lemma 1, ababa ( cacababa ) (2 n − − (000 . . .
0) = ababa ( cba ) (2 n − (000 . . .
0) == ababaabc ( cba ) (2 n − (000 . . .
0) = abac (222 . . .
2) == aba (122 . . .
2) = ab (022 . . .
2) == a (222 . . .
2) = 222 . . . . Since ababa ( cacababa ) (2 n − − is a palindrome it has order 2. Thus ababa ( cacababa ) (2 n − − (222 . . .
2) = 000 . . . a ( n ).Let n = 1. The distance between the coupled configurations (cid:0) (cid:1) and (cid:0) (cid:1) is 1 (seeFigure 6).Assume that n is odd and n ≥
3. Consider the sequence of a ( n ) = · n + moves aca ( cbcbcaca ) (2 n − − . Notice the pattern (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:7)(cid:7)(cid:7) c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:7)(cid:7)(cid:7) a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:7)(cid:7)(cid:7) b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • b (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • a (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • that repeats along the bottom edge in Figure 5, indicating that the result of theaction of cbcbcaca and ( cab ) on the leftmost vertex in the pattern is the same andit is equal to the rightmost vertex in the pattern (which is the leftmost vertex inthe next occurrence of the pattern). Therefore, by (1) and Lemma 1, aca ( cbcbcaca ) (2 n − − (000 . . .
0) = aca ( cab ) (2 n − (000 . . .
0) == acabb ( cab ) (2 n − (000 . . .
0) = acab (222 . . .
2) == aca (022 . . .
2) = ac (122 . . .
2) == a (222 . . .
2) = 222 . . . . Since aca ( cbcbcaca ) (2 n − − is a palindrome it has order 2. Thus aca ( cbcbcaca ) (2 n − − (222 . . .
2) = 000 . . . a ( n ). (cid:3) Remark.
There are several solutions of length a ( n ), for n ≥
2. For instance,another solution, for odd n , is cac ( ababacac ) (2 n − − and, for even n , is cbcbc ( acacbcbc ) (2 n − − . We rephrase Conjecture TTS as follows.
Conjecture TTS ′ . The distance between the coupled configurations (cid:18) . . . . . . (cid:19) and (cid:18) . . . . . . (cid:19) in the coupled Hanoi graph CΓ n (on n disks) is equal to a ( n ) . Small Disk Shift
For the considerations that follow, the concept of parity will be useful.
Definition 2.
For a configuration u = x . . . x n in X ∗ and x ∈ X , let p x ( u ) be theparity of the number of appearances of the letter x in u . For a coupled configuration U = (cid:0) u T u B (cid:1) , let p x ( U ) be the parity of the sum of the parities p x ( u T ) and p x ( u B ).Call any of the configurations 0 n , n , n a corner configuration . Call a coupledconfiguration a corner coupled configuration if at least one of the configurationsin it is a corner configuration. Application of a ij to any non corner configurationchanges the parities of both i and j . Therefore, application of a ij to a non cornercoupled configuration does not change any parities. Theorem SDS ′ (Small Disk Shift) . The distance between the coupled configura-tions (cid:18) . . . . . . (cid:19) and (cid:18) . . . . . . (cid:19) in the coupled Hanoi graph CΓ n (on n disks) is d ( n ) = , n = 1 , , n = 2 , · n , n ≥ . Proof of
Theorem SDS ′ : upper bound. Assume that n is even and n ≥
4. Considerthe sequence of 2 · n moves bab ( abc ) (2 n − a ( cba ) (2 n − c. WIN TOWERS OF HANOI 11
A simple and convincing way to verify that this sequence of moves accomplishes thegoal would be to trace the action in Figure 4. A more formal approach, using (1)and Lemma 1, gives bab ( abc ) (2 n − a ( cba ) (2 n − c (000 . . .
0) = bab ( abc ) (2 n − a ( cba ) (2 n − (000 . . .
0) == bab ( abc ) (2 n − a (222 . . .
2) = bab ( abc ) (2 n − (222 . . .
2) == babcba ( abc ) (2 n − (222 . . .
2) = babcba (000 . . .
0) == babcb (100 . . .
0) = babc (120 . . .
0) == bab (220 . . .
0) = ba (020 . . .
0) == b (120 . . .
0) = 100 . . . , and bab ( abc ) (2 n − a ( cba ) (2 n − c (100 . . .
0) = bab ( abc ) (2 n − a ( cba ) (2 n − (200 . . .
0) == bab ( abc ) (2 n − acba (200 . . .
0) = bab ( abc ) (2 n − acb (210 . . .
0) == bab ( abc ) (2 n − ac (010 . . .
0) = bab ( abc ) (2 n − a (020 . . .
0) == bab ( abc ) (2 n − (120 . . .
0) = bab (120 . . .
0) == ba (100 . . .
0) = b (000 . . .
0) == 200 . . . , where, in the transition between the first and second row, we used the fact that (2 n −
1) is odd.Assume that n is odd and n ≥
3. Consider the sequence of 2 · n moves bab ( abc ) (2 n − bcba ( cba ) (2 n − . A simple and convincing way to verify that this sequence of moves accomplishesthe goal would be to trace the action in Figure 5. A more formal approach, using (1)and Lemma 1, gives bab ( abc ) (2 n − bcba ( cba ) (2 n − (000 . . .
0) = bab ( abc ) (2 n − bcb (111 . . .
1) == bab ( abc ) (2 n − aabc (111 . . .
1) = baba ( bca ) (2 n − abc (111 . . .
1) == baba ( bca ) (2 n − ab (211 . . .
1) = baba ( bca ) (2 n − a (011 . . .
1) == baba ( bca ) (2 n − (111 . . .
1) = babcbaabca ( bca ) (2 n − (111 . . .
1) == babcbaa ( bca ) (2 n − (111 . . .
1) = babcba (000 . . .
0) == babcb (100 . . .
0) = babc (120 . . .
0) == bab (220 . . .
0) = ba (020 . . .
0) == b (120 . . .
0) = 100 . . . , and bab ( abc ) (2 n − bcba ( cba ) (2 n − (100 . . .
0) = bab ( abc ) (2 n − b (100 . . .
0) == bab ( abc ) (2 n − (120 . . .
0) = bab (120 . . .
0) == ba (100 . . .
0) = b (000 . . . . . . . When n = 1, a solution of length 2 is given by the sequence of moves ba and, for n = 2, a solution of length 6 is given by the sequence of moves bcacba . (cid:3) Remark.
Note that the above sequences of moves of length 2 · n are not unique.For instance, for even n , n ≥
4, one could use caba ( bac ) (2 n − b ( cab ) (2 n − . Proof of
Theorem SDS ′ : lower bound. Since the 0-parities for the initial and finalcoupled configurations are p (cid:18) . . . . . . (cid:19) = 1 and p (cid:18) . . . . . . (cid:19) = 0 , somewhere on the way from the initial to the final coupled configuration the 0-paritychanges. This parity cannot be changed at the corner coupled configurations (cid:0) n v (cid:1) and (cid:0) v n (cid:1) , where v is not a corner configuration. Since the 0-parity must be changed,any sequence of moves that starts at the initial coupled configuration (cid:0) ... ... (cid:1) andaccomplishes this change involves a corner a -loop of a corner b -loop application ineither the top or in the bottom configuration. The 4 possibilities are given as casesTop a , Top b , Bot a and Bot b (standing for top configuration involved in a corner a -loop, top configuration involved in a corner b -loop, etc.) in Table 1, where, in eachcase initial / / even n odd n Top a : (cid:0) ... ... (cid:1) / / (cid:0) n ∗ (cid:1) a / / (cid:0) n ∗ (cid:1) / / (cid:0) ... ∗ (cid:1) , · n − · n − b : (cid:0) ... ... (cid:1) / / (cid:0) n ∗ (cid:1) b / / (cid:0) n ∗ (cid:1) / / (cid:0) ... ∗ (cid:1) , · n − · n − a : (cid:0) ... ... (cid:1) / / (cid:0) ∗ n (cid:1) a / / (cid:0) ∗ n (cid:1) / / (cid:0) ∗ ... (cid:1) , · n − · n − b : (cid:0) ... ... (cid:1) / / (cid:0) ∗ n (cid:1) b / / (cid:0) ∗ n (cid:1) / / (cid:0) ∗ ... (cid:1) , · n − · n − Table 1.
Changing the 0-paritycase, ∗ denotes some configuration different from the one with which it is coupled.The last two columns provide the number of steps in the unique shortest path ofthe given form, for even and odd number of disks.Note that the above considerations already show that d ( n ) ≥ · n − g in H for which g (cid:0) ... ... (cid:1) = (cid:0) ... ... (cid:1) must act on thefirst letter as the permutation (012), which is an even permutation. Therefore, thelength of g must be even. To complete the proof, all we need to show is that noneof the shortest paths (sequences of moves) of length 2 · n − g of length 2 · n − a , even n , suchthat for the top configuration we have g (000 . . .
0) = 100 . . .
0, tracing the action inFigure 4 for the bottom configuration, we obtain( bca ) (2 n − ( cba ) (2 n − (100 . . .
0) = 201 . . . = 200 . . . . For the unique shortest path g of length 2 · n − a , even n , such thatfor the bottom configuration we have g (100 . . .
0) = 200 . . .
0, tracing the action inFigure 4 for the top configuration, we obtain( cbc )( abc ) (2 n − ( acb ) (2 n − (000 . . .
0) = 101 . . . = 100 . . . . WIN TOWERS OF HANOI 13
For the unique shortest path g of length 2 · n − b , even n , such thatfor the bottom configuration we have g (100 . . .
0) = 200 . . .
0, tracing the action inFigure 4 for the top configuration, we obtain ac ( bac ) (2 n − ( bca ) (2 n − c (000 . . .
0) = 102 . . . = 100 . . . . For the unique shortest path g of length 2 · n − b , odd n , suchthat for the top configuration we have g (000 . . .
0) = 100 . . .
0, tracing the action inFigure 5 for the bottom configuration, we obtain( bca ) (2 n − ba ( cba ) (2 n − (100 . . .
0) = 222 . . . = 200 . . . . For the unique shortest path g of length 2 · n − a , odd n , such thatfor the bottom configuration we have g (100 . . .
0) = 200 . . .
0, tracing the action inFigure 5 for the top configuration, we obtain( acb ) (2 n − a ( bca ) (2 n − c (000 . . .
0) = 111 . . . = 100 . . . . Finally, for the unique shortest path g of length 2 · n − b , odd n ,such that for the bottom configuration we have g (100 . . .
0) = 200 . . .
0, tracing theaction in Figure 5 for the top configuration, we obtain c ( bca ) (2 n − b ( acb ) (2 n − (000 . . .
0) = 122 . . . = 100 . . . . (cid:3) General Problem
In this section we describe the compatible coupled configurations (recovering theresult of D’Angeli and Donno from [DD07]) and then provide an upper bound onthe distance between any compatible coupled configurations.In order to accomplish the goals of this section, we need a bit more informationon the Hanoi Towers group H . In particular, we rely on the self-similarity of theaction of H on the tree X ∗ . More on self-similar actions in general can be foundin [Nek05]. For our purposes the following observations suffice.The action of a , b and c on X ∗ given by (1) can be rewritten in a recursive formas follows. For any word u over X , a (0 u ) = 1 u, b (0 u ) = 2 u, c (0 u ) = 0 c ( u ) ,a (1 u ) = 0 u, b (1 u ) = 1 b ( u ) , c (1 u ) = 2 u, (2) a (2 u ) = 2 a ( u ) , b (2 u ) = 0 u, c (2 u ) = 1 u. This implies that, for any sequence g of moves, there exist a permutation π g of X and three sequences of moves g , g and g such that, for every word u over X ,(3) g (0 u ) = π g (0) g ( u ) , g (1 u ) = π g (1) g ( u ) , g (2 u ) = π g (2) g ( u ) . The permutation π ( g ) is called the root permutation and it indicates the action of g on the first level of the tree (just below the root), while g , g and g are calledthe sections of g and indicate the action of g below the vertices on the first level.When (3) holds, we write g = π g ( g , g , g )and call the expression on the right a decomposition of g . Note that (3) may becorrect for many different sequences of moves g (or g or g ), but all these sequencesrepresent the same element of the group H . Decompositions of the generators a , b and c are given by(4) a = (01) (1 , , a ) , b = (02) (1 , b, , c = (12) ( c, , , where 1 denotes the empty sequence of moves (the trivial automorphism of thetree). Two decompositions may be multiplied by using the formula (see [Nek05]or [GˇS07])(5) gh = π g ( g , g , g ) π h ( h , h , h ) = π g π h ( g h (0) h , g h (1) h , g h (2) h ) . The decompositions of the generators a , b and c given in (4) and the decompositionproduct formula (5) are sufficient to calculate a decomposition for any sequence ofmoves. We refer to such calculations as decomposition calculations. Theorem 1 (D’Angeli and Donno [DD07]) . Two coupled configurations U = (cid:0) u T u B (cid:1) and V = (cid:0) v T v B (cid:1) on n disks are compatible if and only if the length of the longestcommon prefix of u T and u B is the same as the length of the longest common prefixof v T and v B . Remark.
Note that Theorem 1 implies that the n +1 sets CΓ n, , CΓ n, , . . . , CΓ n,n ,where CΓ n,i consists of the coupled configurations (cid:0) u T u B (cid:1) such that the length of thelongest common prefix of u T and u B is i , are the connected components of thecoupled Hanoi graph CΓ n . The largest of these sets is CΓ n, . It consists of 6 · n − vertices, which are the basic coupled configurations (defined in the introduction).More generally, the set CΓ n,i has 3 i · · n − − i vertices, for i = 0 , . . . , n −
1, andCΓ n,n has 3 n vertices (moreover, CΓ n,n is canonically isomorphic to Γ n throughthe isomorphism u ↔ (cid:0) uu (cid:1) ).Since every tree automorphism preserves prefixes, the connected components ofthe coupled Hanoi graph must be subsets of the sets CΓ n,i . Thus, only the otherdirection (showing that each of the sets CΓ n,i is connected) is interesting and needsto be proved.Consider the subgroup A = h cba, acb, bac i ≤ H (introduced in [GNˇS06] andcalled Apollonian group, because its limit space is the Apollonian gasket). It isknown that this subgroup has index 4 in H and H/A = C × C (where C is cyclicof order 2). A sequence of moves g belongs to A if and only if the parities of thenumber of occurrences of the moves a , b and c in g are all odd or all even. Theelements 1 , a, b, c form a transversal for A in H . The Schreier graph of the subgroup A in H is given in Figure 7. The vertices are denoted by the coset representatives(for instance, the vertex b is the coset bA ). (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • aa cb >>>>>>>> (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • ba (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • cb (cid:0)(cid:0)(cid:0)(cid:0)(cid:0)(cid:0)(cid:0)(cid:0) (cid:15)(cid:14)(cid:13)(cid:12)(cid:8)(cid:9)(cid:10)(cid:11) • c Figure 7.
The Schreier graph of A in H Lemma 3.
The Apollonian subgroup acts transitively on every level of the tree X ∗ .Proof. The claim follows from the fact that H acts transitively on every level ofthe tree and that, for every generator s in { a, b, c } , there is a loop labeled by s inthe Hanoi graph Γ n .Indeed, if g ( u ) = v , for some sequence of moves g , and g is in, say, the coset aA ,then g ′ g ( u ) = v and g ′ g is in A , where g ′ = h − ah and h is any sequence of moves WIN TOWERS OF HANOI 15 from v to the vertex 2 n (note that g ′ ∈ aA and g ′ ( v ) = h − ah ( v ) = h − a (2 n ) = h − (2 n ) = v ). (cid:3) Remark.
A small modification of the above argument (using the corner loops tomodify the parity of the number of occurrences of any generator) shows that thecommutator subgroup H ′ also acts transitively on every level of the tree. The factthat H ′ acts transitively was proved in a different way by D’Angeli and Donno andused in their proof of Theorem 1. We provide a different proof of Theorem 1, basedon the transitivity of the action of A , enabling us to provide good estimates in theGeneral Problem for basic coupled configurations. Lemma 4.
The set CΓ n, of basic coupled configurations on n disks is connected.Proof. Let (cid:0) u T u B (cid:1) and (cid:0) v T v B (cid:1) be coupled configurations in CΓ n, .Since H acts transitively on every level of the tree, there exists a sequence ofmoves h such that h ( u T ) = v T . Let h ( u B ) = v ′ B .Without loss of generality, assume that the top configuration v T starts by 2,while the bottom configuration v B starts by 0. The configuration v ′ B may start byeither 0 or 1. If it starts by 1, a single application of the sequence of 3 moves cab = (01) ( a, cb, , does not affect v T (note the trivial section at 2), and changes the first letter in thebottom configuration to 0. Thus, we may assume that both v ′ B and v B start by 0.We are interested in sequences of moves g that do not affect any configurationsthat start by 2 (and thus do not affect v T ) and keep the first letter in the bottomconfiguration equal to 0. In other words, we are interested in sequences of movesthat decompose as g = ( g , ∗ , , where ∗ represents the section at 1, in which we are not interested.Three such sequences are (this can be verified by direct decomposition calcula-tions) cabcab = ( cba, ∗ , bacacaba = ( acb, ∗ , ,bcbcacac = ( bac, ∗ , . Since h cba, acb, bac i = A , these three decompositions imply that, for every sequenceof moves g in A , there exists a sequence of moves g in H , and in fact in A , suchthat g = ( g , ∗ , . Let v ′ B = 0 v ′ and v B = 0 v . Since A acts transitively on each level of the tree,there exists g in A such that g ( v ′ ) = v . Therefore, there exists g in A such that g ( v ′ B ) = v B and g ( v T ) = v T , completing the proof that CΓ n, is connected. (cid:3) The rest of the proof of Theorem 1 follows, essentially, the same steps as theoriginal proof of D’Angeli and Donno and, being short, is included for completeness.Indeed, once it is known that the largest sets CΓ n, are connected, it is sufficientto observe that H is a self-replicating group. Lemma 5.
Hanoi Towers group H is a self-replicating group of tree automor-phisms, i.e., for every word u over X and every sequence of moves g in H , thereexists a sequence of moves h in H such that, for every word w over X , h ( uw ) = ug ( w ) . Proof.
Let w be any word over X . Since a (2 w ) = 2 a ( w ) , cbc = 2 b ( w ) , bcb (2 w ) = 2 c ( w ) , it is clear that, for every sequence of moves g , there exists a sequence of moves h such that h (2 w ) = 2 g ( w ). By symmetry, for every letter x in X and every sequenceof moves g , there exists a sequence of moves h such that h ( xw ) = xg ( w )and the claim easily extends to words over X (and not just letters). (cid:3) Proof of Theorem 1.
Let u and u ′ be words of length i and (cid:0) uw T uw B (cid:1) and (cid:0) u ′ w ′ T u ′ w ′ B (cid:1) betwo coupled configurations in CΓ n,i . Since H acts transitively on the levels of thetree, there exists a sequence of moves h ′ in H such that h ′ (cid:0) uw T uw B (cid:1) = (cid:0) u ′ w ′′ T u ′ w ′′ B (cid:1) , for some w ′′ T and w ′′ B (in fact, one may easily find such h ′ for which w ′′ T = w T and w ′′ B = w B ,but this does not matter). Since CΓ n − i, is connected, there exists a sequence ofmoves g such that g (cid:0) w ′′ T w ′′ B (cid:1) = (cid:0) w ′ T w ′ B (cid:1) . By the self-replicating property of H , there existsa sequence of moves h in H such that hh ′ (cid:18) uw T uw B (cid:19) = h (cid:18) u ′ w ′′ T u ′ w ′′ B (cid:19) = (cid:18) u ′ g ( w ′′ T ) u ′ g ( w ′′ B ) (cid:19) = (cid:18) u ′ w ′ T u ′ w ′ B (cid:19) . (cid:3) Theorem GP ′ (General Problem for basic configurations) . The diameter D ( n ) ofthe largest component CΓ n, of the coupled Hanoi graph CΓ n (on n disks) satisfies,for n ≥ , the inequalities × n ≤ D ( n ) ≤ . × n . Proof.
We follow the proof of Lemma 4, but keep track of the lengths of the se-quences of moves involved and, when we have a choice (and know how to make it),try to use short sequences.Let U = (cid:0) u T u B (cid:1) and V = (cid:0) v T v B (cid:1) be coupled configurations in the largest componentCΓ n, of the coupled Hanoi graph. Without loss of generality, assume that the topconfiguration v T starts by 2, while the bottom configuration v B starts by 0.There exists a sequence of moves h of length at most 2 n +2 such that h ( u T ) = v T and h ( u B ) = v ′ B , for some configuration v ′ B that starts by 0. Indeed, at most 2 n − u T to v T , and then at mostthree more steps (recall that cab = (01)( a, cb, v ′ B = 0 v ′ and v B = 0 v . We claim that there exists a sequence of moves g in A such that g ( v ′ ) = v and the number of moves in the sequence g is nogreater than 2 n −
1. Indeed, if the shortest sequence of moves g s between v ′ and v happens to be in A we may set g = g s (note that v ′ and v are vertices in theHanoi graph Γ n − of diameter 2 n − − g s happens to be, say, in the coset aA , we may set g = g (2) ag (1) , where g (1) is the shortest sequence of moves from v ′ to 2 n − and g (2) is the shortest sequence of moves from 2 n − to v . The lengthof the sequence g = g (2) ag (1) is no greater than 2(2 n − −
1) + 1 = 2 n −
1. Since
WIN TOWERS OF HANOI 17 the sequence of moves g − s g (2) g (1) represents a closed path in the graph Γ n − thatdoes not go through any of the corner loops and since all cycles in Γ n − other thanthe three corner loops are labeled by elements in A , the sequence g − s g (2) g (1) is in A . Therefore g A = g (2) ag (1) A = ag (2) g (1) A = ag s A = aaA = A, which is what we needed.Direct decomposition calculations give bab ( cba ) bab = ( acaba, ∗ , abc ( acb ) cba = ( babcb, ∗ , ,cb ( cba ) bc = ( cbcac, ∗ , , and therefore, for any k ≥ bab ( cba ) k +2 bab = ( a ( cab ) k +1 a, ∗ , ,abc ( acb ) k +2 cba = ( b ( abc ) k +1 b, ∗ , , (6) cb ( cba ) k +2 bc = ( c ( bca ) k +1 c, ∗ , . This calculation justifies the entries in the top three rows of Table 2. In thiscase f f ℓ ( f ) ℓ ( f ) ratio a − ←− a bab ( cba ) k +2 bab a ( cab ) k +1 a k + 12 3 k + 5 2 . b − ←− b abc ( acb ) k +2 cba b ( abc ) k +1 b k + 12 3 k + 5 2 . c − ←− c cb ( cba ) k +2 bc c ( bca ) k +1 c k + 10 3 k + 5 2 cabcab cba c − ←− a cabcb ( cba ) k +2 bab cb ( cab ) k +1 a k + 14 3 k + 6 2 . bacacaba acb . a − ←− b bacacac ( acb ) k +2 cba ac ( abc ) k +1 b k + 16 3 k + 6 2 . bcbcacac bac . b − ←− c bcbcacbcb ( cba ) k +1 bc ba ( bca ) k +1 c k + 14 3 k + 6 2 . bcbcacbcab baba
10 4 2 . b − ←− a bcbcacbcb ( cba ) k +2 bab bab ( cab ) k +1 a k + 18 3 k + 7 2 . cabacaba cbcb c − ←− b cabacac ( acb ) k +2 cba cbc ( abc ) k +1 b k + 16 3 k + 7 2 . babcbabc acac a − ←− c bab ( cba ) k +3 bc aca ( bca ) k +1 c k + 14 3 k + 7 2 Table 2.
Sequences of moves fixing v T and moving v ′ B table, f is a sequence of moves and f is the corresponding section at 0. The firstletter of any word is fixed by f and the section at 2 is trivial. In other words, f decomposes as f = ( f , ∗ , . The lengths of the sequences f and f , as written, are ℓ ( f ) and ℓ ( f ), and the ratioin the last column is the ratio ℓ ( f ) /ℓ ( f ) (in the rows that depend on k , the ratiois the maximum possible ratio, taken for k ≥ c − ←− a , by direct decomposition calculation,(7) cabcab = ( cba, ∗ , cabcb ( cba ) k +2 bab = ( cabc )( abba ) b ( cba ) k +2 bab ) = ( cabcab )( bab ( cba ) k +2 bab ) == ( cba, ∗ , a ( cab ) k +1 a, ∗ ,
1) = ( cbaa ( cab ) k +1 a, ∗ ,
1) == ( cb ( cab ) k +1 a, ∗ , . All other cases are equally easy to verify (by verifying directly the basic case,and then multiplying it by a corresponding equality from (6) to obtain the casesdepending on k ).Consider g as defined above. There is no occurrence of aa , bb or cc in thissequence (since we always chose the shortest paths as we built g ) and it is in A .The sequence g is a product of factors each of which has the form of one of theentries in column f in Table 2 or their inverses. Moreover, the decompositionis such that the length of g is the sum of the lengths of the factors. Indeed,the entries in column f and their inverses are all possible sequences of moves in A without occurrence of aa , bb or cc for which no proper suffix is in A . Suchsequences correspond precisely to paths without backtracking in the Schreier graphin Figure 7 that start at 1, end at 1 and do not visit the vertex 1 except at thevery beginning and at the very end. There are 18 such types of paths, three choicesfor the first step ( a , b or c ) to leave vertex 1, three choices for the last step ( a , b or c ) to go back to vertex 1, and two choices for the orientation (order) used toloop around the three vertices (cosets) a , b and c before the return to 1 (positiveor negative orientation). The column f in the table only lists the 9 possible pathswith negative orientation (and classifies the 9 cases by the first and last move), sincethe other 9 are just inverses of the entries in the table. For instance, the notation c − ←− a indicates paths (sequences of moves) that start by the move a and end bythe move c .Once g is appropriately factored, Table 2 can be used to define g of length nogreater than 2 . ℓ ( g ) ≤ . n −
1) such that g (cid:0) v T v ′ B (cid:1) = (cid:0) v T v B (cid:1) .Thus, we may arrive from the initial coupled configuration (cid:0) u T u B (cid:1) to the finalcoupled configuration (cid:0) v T v B (cid:1) in no more than (2 n + 2) + 2 . n − ≤ . × n moves. (cid:3) It is evident that good understanding of the structure of CΓ n, , for all n , providesgood understanding of CΓ n,i , for all n and i . For instance, the understanding of thegraphs CΓ , (6 vertices, diameter 2) and CΓ , (54 vertices, diameter 6) enabled theauthor to determine the exact values of the diameter of the two smallest nontrivialcomponents CΓ n,n − and CΓ n,n − , for any number of disks. For instance, thediameter of CΓ n,n − is, for n ≥
1, equal to76 2 n − − n . WIN TOWERS OF HANOI 19
The details will appear in a future work.
References [DD07] Daniele D’Angeli and Alfredo Donno. Self-similar groups and finite Gelfand pairs.
Alge-bra Discrete Math. , (2):54–69, 2007.[GNˇS06] Rostislav Grigorchuk, Volodymyr Nekrashevych, and Zoran ˇSuni´c. Hanoi towers groups.
Oberwolfach Reports , 19:11–14, 2006.[GˇS06] Rostislav Grigorchuk and Zoran ˇSuni´k. Asymptotic aspects of Schreier graphs and HanoiTowers groups.
C. R. Math. Acad. Sci. Paris , 342(8):545–550, 2006.[GˇS07] Rostislav Grigorchuk and Zoran ˇSuni´c. Self-similarity and branching in group theory. In
Groups St. Andrews 2005. Vol. 1 , volume 339 of
London Math. Soc. Lecture Note Ser. ,pages 36–95. Cambridge Univ. Press, Cambridge, 2007.[GˇS08] Rostislav Grigorchuk and Zoran ˇSuni´c. Schreier spectrum of the Hanoi Towers group onthree pegs. In
Analysis on graphs and its applications , volume 77 of
Proc. Sympos. PureMath. , pages 183–198. Amer. Math. Soc., Providence, RI, 2008.[Hin89] Andreas M. Hinz. The Tower of Hanoi.
Enseign. Math. (2) , 35(3-4):289–321, 1989.[Nek05] Volodymyr Nekrashevych.
Self-similar groups , volume 117 of
Mathematical Surveys andMonographs . American Mathematical Society, Providence, RI, 2005.[Rom06] D. Romik. Shortest paths in the Tower of Hanoi graph and finite automata.
SIAM J.Disc. Math. , 20:610–622, 2006.
Department of Mathematics, Texas A&M University, College Station, TX 77843-3368, USA
E-mail address ::