A Modern Treatment of The 15 Puzzle: Aaron F. Archer
A Modern Treatment of The 15 Puzzle: Aaron F. Archer
Aaron F. Archer
1 2 .1 4
5 6 7 8
q 10 11 12
13 14 15
Figure I. The starting position for the 15-puzzle. The shaded square is left empty.
Loyd writes of how he "drove the entire world crazy," and that " A prize of
$1,000, offered for the first correct solution to the problem, has never been
claimed, although there are thousands of persons who say they performed the
required feat." He continues,
People became infatuated with the puzzle and ludicrous tales are told of
shopkeepers who neglected to open their stores; of a distinguished clergyman
who stood under a street lamp all through a wintry night trying to recall the
way he had performed the feat. ...Pilots are said to have wrecked their
ships, and engineers rush their trains past stations. A famous Baltimore
editor tells how he went for his noon lunch and was discovered by his frantic
staff long past midnight pushing little pieces of pie around on a plate! [9]
The reason for this hysteria, of course, is that Loyd's puzzle has no solution. Each
move causes a transposition of the 16 blocks (where the empty square is consid-
ered to contain a blank block), and for the blank to end up in the lower right
The "15" puzzle for the last few weeks has been prominently before the
American public, and may safely be said to have engaged the attention of
nine out of ten persons of both sexes and of all ages and conditions of the
community. But this would not have weighed with the editors to induce them
to insert articles upon such a subject in the American Journal of Mathemat-
ics, but for the fact that the principle of the game has its root in what all
mathematicians of the present day are aware constitutes the most subtle and
characteristic conception of modern algebra, viz: the law of dichotomy
applicable to the separation of the terms of every complete system of
permutations into two natural and indefeasible groups, a law of the inner
world of thought, which may be said to prefigure the polar relation of left
and right-handed screws, or of objects in space and their reflexions in a
mirror. Accordingly the editors have thought that they would be doing no
disservice to their science, but rather promoting its interests by exhibiting this
a priori polar law under a concrete form, through the medium of a game
which has taken so strong a hold upon the thought of the country that it may
almost be said to have risen to the importance of a national institution.
Whoever has made himself master of it may fairly be said to have taken his
first lesson in the theory of determinants. [13, p. 404]
2. SOLUTION. It should be noted that the proof provided here was developed
independently of the previous proofs, but coincidentally shares some ideas with
Story's proof [13].
We call each of the 15 pieces blocks, and the 16 different squares on the board
we call cells. For reasons that soon become apparent, we number the cells in the
snakelike pattern shown in Figure 2. We can think of the empty cell as being
occupied by a blank block. Each legal move then consists of "moving the blank,"
that is, exchanging the blank block with one of its horizontal or vertical neighbors.
A placement is a bijection from the set of blocks (including the blank) to the set of
ceUs-in other words, a snapshot of the board between moves. Given an initial
placement, we wish to determine what other pl~cements are attainable through a
sequence of legal moves.
I 1
~=~ 14
~=~I i 6
TT9
I .
,!10 Till 112
-~ 1l5 -!14 no
--- I
Figure 2. The dashed line and the numbers in the corner of each cell indicate a special ordering of the
cells that we use to define equivalence classes of placements.
Notice that by moving the blank block along the snaking path of Figure 2 we can
move the blank to any cell without changing the order of the remaining blocks
along this path. This leads us to define an equivalence relation on the set of
placements, two placements being equivalent if we can obtain one from the other
by moving the blank along the snaking path. Each equivalence class is called a
configuration, and contains 16 placements, one for each cell the blank can occupy.
If block i occupies cell j and the blank occupies a higher numbered cell, then we
say block i is in slot j; otherwise it is in slot (j -1). Refer to Figure 3 for an
example. All placements in a given configuration have the 15 blocks in the same
slots, so we can denote a configuration by [al, ..., als], where a; is the slot that
block i occupies in the configuration.
Every move of the blank block effects a permutation on the slots occupied by
the blocks. For example, moving the blank from cell 10 to cell 15 causes the
permutation (10,11, 12,13,14) because the block originally in cell 15 (slot 14) is
moved to cell 10 (which becomes slot 10) and the blocks in cells 11 through 14 are
bumped up one slot. A configuration [al, ..., als] subjected to the permutation O"
is transformed into the configuration [al, ..., QIS]0" = [al O", ..., als O"]; since our
permutations act on the right, we multiply them left to right. See Figure 3 for
an example.
., '\ ...
o--E 16 -r-;:-
5 6 7 8
15 12 \4
-ri6r
~
-r14 -rill
13 9 11 10
Figure 3. The placement shown here corresponds to the configuration C = [1, 2,3, 4,8, 7, 6,
5, 14, 12, 13, 10, 15, 11,9]. Since the initial placement of Figure 1 corresponds to the configuration
I=[1,2,3,4,8,7,6,5,9,10,11,12,15,14,13],' subjecting the initial configuration to the permutation
u = (9, 14,11, 13X10, 12) yields C. This is an even permutation, so by Theorem 3, Cis obtainable
from I.
Let Ui,j denote the perinutation achieved by moving the blank from cell i to
cell j. Then clearly Ui,i+l is the identity, and Uj,i = Ui~]. This leaves 9 permuta-
tions for us to work out. These are tabulated in Table 1. The key point is that one
can move the blank along the snaking path of Figure 2 to any cell without changing
the configuration. Therefore, the first nine permutations listed in Table 1 and
their inverses may be applied in any order, so the problem reduces to identify-
ing the subgroup of SlS {the symmetric group on the 15 slots) generated by 1
these permutations. We prove that these permutations generate A1S {all even
permutations).
TABLE I. A summary of all possible permutations of slots attained by moving the blank block
Moving the blank from cell j to cell j effects the permutation Ui. j"
For n ~ 5, Lemma 1 also follows directly from the fact that An is simple, since
the set of 3-cycles is closed under conjugation. Let us call a 3-cycle consecutive if it
is of the form (k. k + 1. k + 2).
Proof Since the 3-cycles generate All , it suffices to show that the consecutive
3-cycles generate all 3-cycles. This is trivial for n = 3. For n ~ 4 we see by
induction that we can generate all 3-cycles not containing both I and n. To
generate (I,x,n), let y E {1,...,n}\{I,x,n}. Then (l,x,n) = (y,x,nXl,x,y).
Of course, (I, n, x) = (1, x, n)2. .
Proof Since all the cycles are odd, they are even permutations, so they generate a
subgroup of Ats. Note that for any permutation a we have a-t(at,...,ak)a=
(a]a,...,aka). Thus,
-n n .
(1,2,...,7) (3,4,5)(1,2,...,7) yIelds (1,2,3),...,(5,6,7);
-n n .
(5,6,...,11) (7,8,9)(5,6,...,11) yIelds (5,6,7),...,(9,10,11) and
-n n
(9,10,...,15) (11,12,13)(9,10,...,15) yields (9,10,11),...,(13,14,15)
as n assumes the values -2, -1,0, 1, and 2. This constitutes all consecutive
3-cycles in S IS' so by Lemma 2 it generates A IS. .
Thus, given any two placements PIt and Pl2 belonging to configurations Cfl
and Cf2' respectively, Pl2 is obtainable from PI, if and only if Cf2 is an even
permutation of Cft' Stated directly in terms of the placements, we see that if PI1
and Pl2 have the blank in the same cell then Pl2 is obtainable from PIt if and only
if Pl2 is an even permutation of the 15 numbered blocks in PIt' Let n be the
number of moves the blank cell in PIt is away from the blank cell in P12, Since
each move of the blank block causes a transposition of two blocks, then for n odd
(respectively even) Pl2 is obtainable from PIt if and only if Pl2 is an odd
(respectively even) permutation of the 16 blocks in PI.,
I
I
r;if,
,;;
November 1999] A MODERN TREATMENT OF THE 15 PUZZLE 7Q7
Figure 4. The graph P4 X P4
8 6
--
Q 10
Figure 5. For the famous Petersen graph, each labeling is obtainable from every other by a sequence of
legal moves. The vertices are numbered to indicate a hamiltonian path.
~
...
( /
group is PGL2(7L/57L) acting on the projective line over 7L/57L (a group of order
120 acting 3-transitively on a set of six elements), yielding six inequivalent label-
ings. For Cn, the group is «1,2, ..., n -1), yielding (n -2)! inequivalent label-
ings. The existence of such a simple complete characterization is surprising.
However, Wilson's proof, while elegant, requires considerably more sophisticated
mathematics than the simple and elementary proof provided here for the special
case of the 15-puzzle.
ACKNOWLEDGMENTS. The author thanks Professors Alan J. Goldman and Arthur T. Benjamin for
bringing this problem to his attention, and the latter for many helpful suggestions. Author supported by
the Fannie and John Hertz Foundation.
REFERENCES
1. W. W. R. Ball and H. S. M. Coxeter, Mathematical Recreations and Essays, 12th ed., U. of Toronto
Press, Toronto and Buffalo, 1974, pp. 313-316.
2. J. D. Beasley, The Mathematics of Games, Oxford U. Press, Oxford and New York, 1989,
pp. 80-81.
3. A. L. Davies, Rotating the fifteen puzzle, Math. Gazette 54 (1970) 237-240.
4. M. Gardner, Martin Gardner's Sixth Book of Mathematical Diversions from Scientific American,
U. of Chicago Press, Chicago, 1971, pp. 64-70.
5. I. N. Herstein and I. Kaplansky, Matters Mathematical, Chelsea, New York, 1978, pp. 114-115.
6. S. Hurd and D. Trautman, The knight's tour on the 15-puzzle, Math. Mag. 66 (1993) 159-166.
7. W. W. Johnson, Note on the "15" puzzle, Amer. I. Math. 2 (1879) 397-399.
8. H. Liebeck, Some generalizations of the 14-15 puzzle, Math. Mag. 44 (1971) 185-189.
9. S. Loyd, Mathematical Puzzles of Sam Loyd: Selected and Edited by Martin Gardner, Dover, New
York, 1959, pp. 19-20.
10. H. v. Mallison, An array of squares, Math. Gazette 24 (1940) 119-121.
11. E. L. Spitznagel, Jr., A new look at the fifteen puzzle, Math. Mag. 40 (1967) 171-174.
12. E. L. Spitznagel, Jr., Selected Topics in Mathematics, Holt, Rinehart and Winston, New York, 1971,
pp.143-148.
13. W. E. Story, Note on the "15"puzzle, Amer. I. Math. 2 (1879) 399-404.
14. F. J. W. Whipple, The sign of a term in the expansion of a determinant, Math. Gazette 13
(1926) 126.
15. R. M. Wilson, Graph puzzles, homotopy, and the alternating group, I. Combin. Theory (Series B)
16 (1974) 86-96.
AARON ARCHER earned his B.S. in mathematics from Harvey Mudd College in 1998, where his
research in chromatic graph theory earned him Honorable Mention for the Morgan Prize
(AMS/MAA/SIAM). An alumnus of both the Hampshire College Summer Studies in Mathematics
and the Budapest Semesters in Mathematics, his time in Hungary inspired him to write an online
i~
restaurant guide to Budapest. Aaron is now a Hertz Fellow working toward his Ph.D in operations
, research at Cornell University. His current research interests include combinatorial optimization and
f}:
,;d approximation algorithms.
~
Operations Research Department, Comell University, !thaca, NY !4853
~f
i~i' Harvey Mudd College, Claremont, CA 9!7!!
rt
, aarcher@orie. comell. edu
'i
'I"'.':
"