Misplaced Pages

15 puzzle: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 14:58, 1 August 2021 editSpinningspark (talk | contribs)89,216 editsm Miscellaneous: -[Tag: Reverted← Previous edit Latest revision as of 07:45, 9 July 2024 edit undoElectricmaster (talk | contribs)Extended confirmed users22,330 editsm Notable examplesTag: Visual edit 
(120 intermediate revisions by 69 users not shown)
Line 1: Line 1:
{{Short description|Sliding puzzle with fifteen pieces and one space}}
{{redirects|Magic 15|the numbered grid where each row and column sums to 15|Magic square}} {{redirect|Magic 15|the numbered grid where each row and column sums to 15|Magic square}}
]
{{Use British English|date=July 2022}}
The '''15 puzzle''' (also called '''Gem Puzzle''', '''Boss Puzzle''', '''Game of Fifteen''', '''Mystic Square''' and many others) is a ] having 15 square tiles numbered 1–15 in a frame that is 4 tiles high and 4 tiles wide, leaving one unoccupied tile position. Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively. The goal of the puzzle is to place the tiles in numerical order.
]
The '''15 puzzle''' (also called '''Gem Puzzle''', '''Boss Puzzle''', '''Game of Fifteen''', '''Mystic Square''' and more) is a ]. It has 15 square tiles numbered 1 to 15 in a frame that is 4 tile positions high and 4 tile positions wide, with one unoccupied position. Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively. The goal of the ] is to place the tiles in numerical order (from left to right, top to bottom).


Named for the number of tiles in the frame, the 15 puzzle may also be called a 16 puzzle, alluding to its total tile capacity. Similar names are used for different sized variants of the 15 puzzle, such as the '''8 puzzle''' that has 8 tiles in a 3×3 frame. Named after the number of tiles in the frame, the 15 puzzle may also be called a ''"16 puzzle"'', alluding to its total tile capacity. Similar names are used for different sized variants of the 15 puzzle, such as the '''8 puzzle,''' which has 8 tiles in a 3×3 frame.


The ''n'' puzzle is a classical problem for modelling ]s involving ]s. Commonly used heuristics for this problem include counting the number of misplaced tiles and finding the sum of the ]s between each block and its position in the goal configuration.<ref name="Korf,2000"/> Note that both are '']'', i.e. they never overestimate the number of moves left, which ensures optimality for certain search algorithms such as ].<ref name="Korf,2000"/> The ''n'' puzzle is a classical problem for ] ]s involving ]s. Commonly used heuristics for this problem include counting the number of misplaced tiles and finding the sum of the ]s between each block and its position in the goal configuration.<ref name="Korf,2000"/> Note that both are '']''. That is, they never overestimate the number of moves left, which ensures optimality for certain ]s such as ].<ref name="Korf,2000"/>


==Mathematics== ==Mathematics==
=== Solvability === === Solvability ===
] ]
{{harvtxt|Johnson|Story|1879}} used a ] argument to show that half of the starting positions for the ''n'' puzzle are impossible to resolve, no matter how many moves are made. This is done by considering a binary function of the tile configuration that is ] under any valid move and then using this to partition the space of all possible labelled states into two mutually inaccessible ]es of the same size. This means that half of all positions are unsolvable, although it says nothing about the remaining half.


The invariant is the ] of all 16 squares plus the parity of the ] (number of rows plus number of columns) of the empty square from the lower right corner. This is an invariant because each move changes both the parity of the permutation and the parity of the taxicab distance. In particular, if the empty square is in the lower right corner, then the puzzle is solvable only if the permutation of the remaining pieces is even.
{{harvtxt|Johnson|Story|1879}} used a ] argument to show that half of the starting positions for the ''n'' puzzle are impossible to resolve, no matter how many moves are made. This is done by considering a function of the tile configuration that is ] under any valid move, and then using this to partition the space of all possible labeled states into two ]es of reachable and unreachable states.


{{harvtxt|Johnson|Story|1879}} also showed that on boards of size ''m'' × ''n'', where ''m'' and ''n'' are both larger or equal to 2, all even permutations ''are'' solvable. It can be proven by induction on ''m'' and ''n'', starting with ''m'' = ''n'' = 2. This means that there are exactly two equivalency classes of mutually accessible arrangements, and that the parity described is the only non-trivial invariant, although equivalent descriptions exist.
The invariant is the ] of all 16 squares plus the parity of the ] (number of rows plus number of columns) of the empty square from the lower right corner. This is an invariant because each move changes both the parity of the permutation and the parity of the taxicab distance. In particular, if the empty square is in the lower right corner then the puzzle is solvable if and only if the permutation of the remaining pieces is even.


{{harvtxt|Johnson|Story|1879}} also showed that the converse holds on boards of size ''m''×''n'' provided ''m'' and ''n'' are both at least 2: all even permutations ''are'' solvable. This is straightforward but a little messy to prove by induction on ''m'' and ''n'' starting with ''m''=''n''=2. {{harvtxt|Archer|1999}} gave another proof, based on defining ]es via a ]. {{harvtxt|Archer|1999}} gave another proof, based on defining ]es via a ].


{{harvtxt|Wilson|1974}} studied the generalization of the 15 puzzle to arbitrary ]s, the original problem being the case of a 4×4 ]. The problem has some degenerate cases where the answer is either trivial or a simple combination of the answers to the same problem on some subgraphs. Namely, for ] and ], the puzzle has no freedom; if the graph is ], only the connected component of the vertex with the "empty space" is relevant; and if there is an ] the problem reduces to the same puzzle on each of the ] components of that vertex. Excluding these cases, Wilson showed that other than one exceptional graph on 7 vertices, it is possible to obtain all permutations unless the graph is ], in which case exactly the even permutations can be obtained. The exceptional graph is a regular hexagon with one diagonal and a vertex at the center added; only {{sfrac|1|6}} of its permutations can be attained. {{harvtxt|Wilson|1974}} studied the generalization of the 15 puzzle to arbitrary ]s, the original problem being the case of a 4×4 ]. The problem has some degenerate cases where the answer is either trivial or a simple combination of the answers to the same problem on some subgraphs. Namely, for ] and ], the puzzle has no freedom; if the graph is ], only the connected component of the vertex with the "empty space" is relevant; and if there is an ], the problem reduces to the same puzzle on each of the ] components of that vertex. Excluding these cases, Wilson showed that other than one exceptional graph on 7 vertices, it is possible to obtain all permutations unless the graph is ], in which case exactly the even permutations can be obtained. The exceptional graph is a regular ] with one diagonal and a vertex at the center added; only {{sfrac|1|6}} of its permutations can be attained, which gives an instance of the ].


For larger versions of the ''n'' puzzle, finding a solution is easy, but the problem of finding the ''shortest'' solution is ]. It is also NP-hard to ] the fewest slides within an additive constant, but there is a polynomial-time constant-factor approximation.<ref>Daniel Ratner, Manfred K. Warmuth. ''Finding a Shortest Solution for the N × N Extension of the 15-PUZZLE Is Intractable''. National Conference on Artificial Intelligence, 1986.</ref><ref name="ratner+warmuth">{{cite journal|last=Ratner|first=Daniel|author2=Warmuth, Manfred|title=The (n<sup>2</sup>−1)-puzzle and related relocation problems|journal=Journal of Symbolic Computation|year=1990|volume=10|issue=2|pages=111–137|doi=10.1016/S0747-7171(08)80001-6|doi-access=free}}</ref> For the 15 puzzle, lengths of optimal solutions range from 0 to 80 single-tile moves (there are 17 configurations requiring 80 moves)<ref>Richard E. Korf, , ''Journal of the ACM'' Volume 55 Issue 6 (December 2008), Article 26, pp. 29-30. "For the 4 × 4 Fifteen Puzzle, there are 17 different states at a depth of 80 moves from an initial state with the blank in the corner, while for the 2 × 8 Fifteen Puzzle there is a unique state at the maximum state of 140 moves from the initial state."</ref><ref>A. Brüngger, A. Marzetta, K. Fukuda and J. Nievergelt, , ''Annals of Operations Research'' '''90''' (1999), pp. 45–63.<br>:"Gasser found 9 positions, requiring 80 moves...We have now proved that the hardest 15-puzzle positions require, in fact, 80 moves. We have also discovered two previously unknown positions, requiring exactly 80 moves to be solved."</ref> or 43 multi-tile moves;<ref name="multi-tile">. Domain of the Cube Forum</ref> the 8 puzzle always can be solved in no more than 31 single-tile moves or 24 multi-tile moves (integer sequence ). The multi-tile metric counts subsequent moves of the empty tile in the same direction as one.<ref name="multi-tile" /> For larger versions of the ''n'' puzzle, finding a solution is easy. But, the problem of finding the ''shortest'' solution is ]. It is also NP-hard to ] the fewest slides within an additive constant, but there is a polynomial-time constant-factor approximation.<ref name="Ratner1986">{{cite journal |last1=Ratner |first1=Daniel |last2=Warmuth |first2=Manfred |title=Finding a Shortest Solution for the N × N Extension of the 15-PUZZLE Is Intractable |journal=National Conference on Artificial Intelligence |date=1986 |url=https://www.aaai.org/Papers/AAAI/1986/AAAI86-027.pdf |url-status=live |archiveurl=https://web.archive.org/web/20120309151834/https://www.aaai.org/Papers/AAAI/1986/AAAI86-027.pdf |archivedate=2012-03-09}}</ref><ref name="ratner+warmuth">{{cite journal|last=Ratner|first=Daniel|author2=Warmuth, Manfred|title=The (n<sup>2</sup>−1)-puzzle and related relocation problems|journal=Journal of Symbolic Computation|year=1990|volume=10|issue=2|pages=111–137|doi=10.1016/S0747-7171(08)80001-6|doi-access=free}}</ref> For the 15 puzzle, lengths of optimal solutions range from 0 to 80 single-tile moves (there are 17 configurations requiring 80 moves)<ref>Richard E. Korf, , ''Journal of the ACM'' Volume 55 Issue 6 (December 2008), Article 26, pp. 29-30. "For the 4 × 4 Fifteen Puzzle, there are 17 different states at a depth of 80 moves from an initial state with the blank in the corner, while for the 2 × 8 Fifteen Puzzle there is a unique state at the maximum state of 140 moves from the initial state."</ref><ref>A. Brüngger, A. Marzetta, K. Fukuda and J. Nievergelt, , ''Annals of Operations Research'' '''90''' (1999), pp. 45–63.<br>:"Gasser found 9 positions, requiring 80 moves...We have now proved that the hardest 15-puzzle positions require, in fact, 80 moves. We have also discovered two previously unknown positions, requiring exactly 80 moves to be solved."</ref> or 43 multi-tile moves;<ref name="multi-tile">. Domain of the Cube Forum</ref> the 8 Puzzle always can be solved in no more than 31 single-tile moves or 24 multi-tile moves (integer sequence ). The multi-tile metric counts subsequent moves of the empty tile in the same direction as one.<ref name="multi-tile" />


The number of possible positions of the 24 puzzle is {{sfrac|25!|2}} ≈ {{val|7.76e24}} which is too many to calculate ]. In 2011, lower bounds of 152 single-tile moves or 41 multi-tile moves had been established, as well as upper bounds of 208 single-tile moves or 109 multi-tile moves.<ref>. Domain of the Cube Forum</ref><ref>. Sliding Tile Puzzle Corner.</ref><ref>. Domain of the Cube Forum.</ref><ref>. Domain of the Cube Forum.</ref> In 2016, the upper bound was improved to 205 single-tile moves.<ref>. Domain of the Cube Forum.</ref> The number of possible positions of the 24 puzzle is {{sfrac|25!|2}} ≈ {{val|7.76e24}}, which is too many to calculate ] feasibly using brute-force methods. In 2011, lower bounds of 152 single-tile moves or 41 multi-tile moves had been established, as well as upper bounds of 208 single-tile moves or 109 multi-tile moves.<ref>. Domain of the Cube Forum</ref><ref>. Sliding Tile Puzzle Corner.</ref><ref>. Domain of the Cube Forum.</ref><ref>. Domain of the Cube Forum.</ref> In 2016, the upper bound was improved to 205 single-tile moves.<ref>. Domain of the Cube Forum.</ref>


===Group theory===
The transformations of the fifteen puzzle form a ] (not a group, as not all moves can be composed);<ref>Jim Belk (2008) , The Everything Seminar</ref><ref>, Never Ending Books</ref><ref>, Never Ending Books</ref> this ] on configurations. The transformations of the 15 puzzle form a ] (not a group, as not all moves can be composed);<ref>Jim Belk (2008) , The Everything Seminar</ref><ref>, Never Ending Books</ref><ref>, Never Ending Books</ref> this ] on configurations.

===Group Theory===
Because the combinations of the 15 puzzle can be generated by ], it can be proved that the 15 puzzle can be represented by the ] <math>A_{15}</math>.<ref>{{cite web | access-date=26 December 2020 | first1=Robert | last1=Beeler | url=https://faculty.etsu.edu/beelerr/fifteen-supp.pdf | title=The Fifteen Puzzle: A Motivating Example for the Alternating Group | publisher=East Tennessee State University | website=faculty.etsu.edu/}}</ref> In fact, any <math>2 k - 1</math> sliding puzzle with square tiles of equal size can be represented by <math>A_{2 k - 1}</math>.

== Alternate proof ==
{{norefs|section|date = April 2021}}
{{tone|section|date = April 2021}}
In an alternate view of the problem, we can consider the invariant to be the sum of the parity of the number of ] in the current order of the 15 numbered pieces and the parity of the difference in the row number of the empty square from the row number of the last row. (Let's call it row distance from the last row.) This is an invariant because each column move, when we move a piece within the same column, changes both the parity of the number of inversions (by changing the number of inversions by ±1, ±3) and the parity of the row distance from the last row (changing row distance by ±1); and each row move, when we move a piece within the same row, does not change any of the two parities. Now if we look at the solved state of the puzzle, this sum is even. Hence it is easy to prove by ] that any state of the puzzle for which the above sum is odd cannot be solvable. In particular, if the empty square is in the lower right corner (even anywhere in the last row) then the puzzle is solvable if and only if the number of inversions of the numbered pieces is even.


Because the combinations of the 15 puzzle can be generated by ], it can be proved that the 15 puzzle can be represented by the ] <math>A_{15}</math>.<ref>{{cite web | access-date=26 December 2020 | first1=Robert | last1=Beeler | url=https://faculty.etsu.edu/beelerr/fifteen-supp.pdf | title=The Fifteen Puzzle: A Motivating Example for the Alternating Group | publisher=East Tennessee State University | website=faculty.etsu.edu/ | archive-date=7 January 2021 | archive-url=https://web.archive.org/web/20210107214840/https://faculty.etsu.edu/beelerr/fifteen-supp.pdf | url-status=dead }}</ref> In fact, any <math>2 k - 1</math> sliding puzzle with square tiles of equal size can be represented by <math>A_{2 k - 1}</math>.
==History== ==History==
]'s unsolvable 15 puzzle, with tiles 14 and 15 exchanged. This puzzle is not solvable as it would require a change of the invariant to move it to the solved state.]] ]'s unsolvable 15 Puzzle, with tiles 14 and 15 exchanged. This puzzle is not solvable as it would require a change of the invariant to move it to the solved state.]]
] ]
The puzzle was "invented" by Noyes Palmer Chapman,<ref name="slocum-sonneveld" /> a postmaster in ], who is said to have shown friends, as early as 1874, a precursor puzzle consisting of 16 numbered blocks that were to be put together in rows of four, ]. Copies of the improved Fifteen Puzzle made their way to ], by way of Noyes' son, Frank, and from there, via sundry connections, to ], and finally to ] (Connecticut), where students in the ] started manufacturing the puzzle and, by December 1879, selling them both locally and in ], Massachusetts. Shown one of these, Matthias Rice, who ran a fancy woodworking business in Boston, started manufacturing the puzzle sometime in December 1879 and convinced a "Yankee Notions" fancy goods dealer to sell them under the name of "Gem Puzzle". In late January 1880, Dr. Charles Pevey, a dentist in ], garnered some attention by offering a cash reward for a solution to the Fifteen Puzzle.<ref name="slocum-sonneveld"/> The puzzle was "invented" by Noyes Palmer Chapman,<ref name="slocum-sonneveld" /> a postmaster in ], who is said to have shown friends, as early as 1874, a precursor puzzle consisting of 16 numbered blocks that were to be put together in rows of four, each summing to 34 (see ]). Copies of the improved 15 puzzle made their way to ], by way of Chapman's son, Frank, and from there, via sundry connections, to ], and finally to ], ], where students in the ] started manufacturing the puzzle. By December 1879, these were sold both locally and in ], ]. Shown one of these, Matthias Rice, who ran a woodworking business in Boston, started manufacturing the puzzle sometime in December 1879 and convinced a "Yankee Notions" fancy goods dealer to sell them under the name of "Gem Puzzle." In late January 1880, Charles Pevey, a dentist in ], Massachusetts, garnered some attention by offering a cash reward for a solution to the 15 Puzzle.<ref name="slocum-sonneveld"/>


The game became a ] in the U.S. in 1880.<ref>{{harvtxt|Slocum|Singmaster|2009|p=15}}</ref> The game became a ] in the U.S. in 1880.<ref>{{harvtxt|Slocum|Singmaster|2009|p=15}}</ref>


Noyes Chapman had applied for a patent on his "Block Solitaire Puzzle" on February 21, 1880. However, that patent was rejected, likely because it was not sufficiently different from the August 20, 1878 "Puzzle-Blocks" patent (US 207124) granted to Ernest U. Kinsey.<ref name="slocum-sonneveld">''The 15 Puzzle'', by Jerry Slocum & Dic Sonneveld, 2006. {{ISBN|1-890980-15-3}}</ref> Chapman applied for a patent on his "Block Solitaire Puzzle" on February 21, 1880. However, this patent was rejected, likely because it was not sufficiently different from the August 20, 1878 "Puzzle-Blocks" patent (US 207124) granted to Ernest U. Kinsey.<ref name="slocum-sonneveld">''The 15 Puzzle'', by Jerry Slocum & Dic Sonneveld, 2006. {{ISBN|1-890980-15-3}}</ref>


=== Sam Loyd === === Sam Loyd ===
] ]
] claimed from 1891 until his death in 1911 that he invented the puzzle, for example writing in the ''Cyclopedia of Puzzles'' (published 1914): "The older inhabitants of Puzzleland will remember how in the early seventies I drove the entire world crazy over a little box of movable pieces which became known as the '14-15 Puzzle'."<ref></ref>{{failed verification|reason=Loyd only claims invention of the unsolvable puzzle in this article|date=November 2019}} However, Loyd had nothing to do with the invention or initial popularity of the puzzle, and in any case, the craze was in 1880, not the early 1870s. Loyd's first article about the puzzle was published in 1886 and it was not until 1891 that he first claimed to have been the inventor.<ref name="slocum-sonneveld" /><ref>Barry R. Clarke, ''Puzzles for Pleasure'', pp.10-12, Cambridge University Press, 1994 {{ISBN|0-521-46634-2}}.</ref> From 1891 until his death in 1911, ] claimed that he had invented the puzzle. However, Loyd had no connection to the invention or initial popularity of the puzzle. Loyd's first article about the puzzle was published in 1886, and it was not until 1891 that he first claimed to be the inventor.<ref name="slocum-sonneveld" /><ref>Barry R. Clarke, ''Puzzles for Pleasure'', pp.10-12, Cambridge University Press, 1994 {{ISBN|0-521-46634-2}}.</ref>

Some later interest was fueled by Loyd's offer of a $1,000 prize ({{Inflation|US|1000|1891|fmt=eq}}) to anyone who could provide a solution for achieving a particular combination specified by Loyd, namely reversing the 14 and 15, which Loyd called the '''14-15 puzzle'''.<ref name="Korf,2000">{{Citation | first=R. E. | last=Korf | editor1-first=B. Y. | editor2-last=Walsh | editor2-first=T. | chapter-url=https://www.aaai.org/Papers/AAAI/2000/AAAI00-212.pdf | doi=10.1007/3-540-44914-0_3 | series=SARA 2000. Lecture Notes in Computer Science | pages=45–55 | publisher=Springer, Berlin, Heidelberg | year=2000 | isbn=978-3-540-67839-7 | access-date=2010-04-26 | chapter=Recent Progress in the Design and Analysis of Admissible Heuristic Functions | volume=1864 | editor1-last=Choueiry | title=Abstraction, Reformulation, and Approximation | url=http://www.cs.iastate.edu/~honavar/korf2000.pdf | archive-date=2010-08-16 | archive-url=https://web.archive.org/web/20100816065953/http://www.cs.iastate.edu/~honavar/korf2000.pdf | url-status=dead }}</ref> This is impossible, as had been shown over a decade earlier by {{harvtxt|Johnson|Story|1879}}, because it requires a transformation from an even to an odd permutation.


==Varieties of the 15 puzzle==
Some later interest was fuelled by Loyd offering a $1,000 prize for anyone who could provide a solution for achieving a particular combination specified by Loyd, namely reversing the 14 and 15, called by Loyd the '''14-15 puzzle'''.<ref name="Korf,2000">{{Citation | first=R. E. | last=Korf |editor1-first=B. Y. |editor2-last=Walsh |editor2-first= T. | chapter-url=https://www.aaai.org/Papers/AAAI/2000/AAAI00-212.pdf | doi=10.1007/3-540-44914-0_3 | series=SARA 2000. Lecture Notes in Computer Science | pages=45–55 | publisher=Springer, Berlin, Heidelberg | year=2000 | isbn=978-3-540-67839-7 | access-date=2010-04-26 | chapter=Recent Progress in the Design and Analysis of Admissible Heuristic Functions | volume=vol. 1864 |editor1-last=Choueiry | title=Abstraction, Reformulation, and Approximation | url=http://www.cs.iastate.edu/~honavar/korf2000.pdf }}</ref> This was impossible, as had been shown over a decade earlier by {{harvtxt|Johnson|Story|1879}}, as it required a transformation from an even to an odd permutation.
The ], manufactured in the ], is a ] puzzle with similar operations to the 15 Puzzle.


Versions of the 15 puzzle include a different number of tiles, such as the 8-puzzle or 24-puzzle.
==Miscellaneous==
The ], manufactured in the ], is a ] puzzle with similar operations to the 15 puzzle.


== Pop culture ==
] was an expert at solving the 15-Puzzle. He had been timed to be able to solve it within 25 seconds; Fischer demonstrated this on November 8, 1972, on '']''.<ref>, ''The Tonight Show'', 8 November 1972, Johnny Carson Productions, retireved 1 August 2021.</ref> ] ] was an expert at solving the 15 puzzle.<ref>Clifford A. Pickover, ''The Math Book: From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics'', p. 262, Sterling Publishing, 2009 {{ISBN|1402757964}}.</ref> He had been timed to be able to solve it within 25 seconds; Fischer demonstrated this on ], on '']''.<ref>, ''The Tonight Show'', 8 November 1972, Johnny Carson Productions, retrieved 1 August 2021.</ref><ref>Adam Spencer, ''Adam Spencer's Big Book of Numbers: Everything you wanted to know about the numbers 1 to 100'', p. 58, Brio Books, 2014 {{ISBN|192113433X}}.</ref>


==See also== ==See also==
Line 76: Line 76:
==External links== ==External links==
{{Commons category}} {{Commons category}}
* *
* *
* *

Latest revision as of 07:45, 9 July 2024

Sliding puzzle with fifteen pieces and one space "Magic 15" redirects here. For the numbered grid where each row and column sums to 15, see Magic square.

To solve the puzzle, the numbers must be rearranged into numerical order from left to right, top to bottom.

The 15 puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and more) is a sliding puzzle. It has 15 square tiles numbered 1 to 15 in a frame that is 4 tile positions high and 4 tile positions wide, with one unoccupied position. Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively. The goal of the puzzle is to place the tiles in numerical order (from left to right, top to bottom).

Named after the number of tiles in the frame, the 15 puzzle may also be called a "16 puzzle", alluding to its total tile capacity. Similar names are used for different sized variants of the 15 puzzle, such as the 8 puzzle, which has 8 tiles in a 3×3 frame.

The n puzzle is a classical problem for modeling algorithms involving heuristics. Commonly used heuristics for this problem include counting the number of misplaced tiles and finding the sum of the taxicab distances between each block and its position in the goal configuration. Note that both are admissible. That is, they never overestimate the number of moves left, which ensures optimality for certain search algorithms such as A*.

Mathematics

Solvability

A solved 15 Puzzle

Johnson & Story (1879) used a parity argument to show that half of the starting positions for the n puzzle are impossible to resolve, no matter how many moves are made. This is done by considering a binary function of the tile configuration that is invariant under any valid move and then using this to partition the space of all possible labelled states into two mutually inaccessible equivalence classes of the same size. This means that half of all positions are unsolvable, although it says nothing about the remaining half.

The invariant is the parity of the permutation of all 16 squares plus the parity of the taxicab distance (number of rows plus number of columns) of the empty square from the lower right corner. This is an invariant because each move changes both the parity of the permutation and the parity of the taxicab distance. In particular, if the empty square is in the lower right corner, then the puzzle is solvable only if the permutation of the remaining pieces is even.

Johnson & Story (1879) also showed that on boards of size m × n, where m and n are both larger or equal to 2, all even permutations are solvable. It can be proven by induction on m and n, starting with m = n = 2. This means that there are exactly two equivalency classes of mutually accessible arrangements, and that the parity described is the only non-trivial invariant, although equivalent descriptions exist.

Archer (1999) gave another proof, based on defining equivalence classes via a Hamiltonian path.

Wilson (1974) studied the generalization of the 15 puzzle to arbitrary finite graphs, the original problem being the case of a 4×4 grid graph. The problem has some degenerate cases where the answer is either trivial or a simple combination of the answers to the same problem on some subgraphs. Namely, for paths and polygons, the puzzle has no freedom; if the graph is disconnected, only the connected component of the vertex with the "empty space" is relevant; and if there is an articulation vertex, the problem reduces to the same puzzle on each of the biconnected components of that vertex. Excluding these cases, Wilson showed that other than one exceptional graph on 7 vertices, it is possible to obtain all permutations unless the graph is bipartite, in which case exactly the even permutations can be obtained. The exceptional graph is a regular hexagon with one diagonal and a vertex at the center added; only ⁠1/6⁠ of its permutations can be attained, which gives an instance of the exotic embedding of S5 into S6.

For larger versions of the n puzzle, finding a solution is easy. But, the problem of finding the shortest solution is NP-hard. It is also NP-hard to approximate the fewest slides within an additive constant, but there is a polynomial-time constant-factor approximation. For the 15 puzzle, lengths of optimal solutions range from 0 to 80 single-tile moves (there are 17 configurations requiring 80 moves) or 43 multi-tile moves; the 8 Puzzle always can be solved in no more than 31 single-tile moves or 24 multi-tile moves (integer sequence A087725). The multi-tile metric counts subsequent moves of the empty tile in the same direction as one.

The number of possible positions of the 24 puzzle is ⁠25!/2⁠ ≈ 7.76×10, which is too many to calculate God's number feasibly using brute-force methods. In 2011, lower bounds of 152 single-tile moves or 41 multi-tile moves had been established, as well as upper bounds of 208 single-tile moves or 109 multi-tile moves. In 2016, the upper bound was improved to 205 single-tile moves.

Group theory

The transformations of the 15 puzzle form a groupoid (not a group, as not all moves can be composed); this groupoid acts on configurations.

Because the combinations of the 15 puzzle can be generated by 3-cycles, it can be proved that the 15 puzzle can be represented by the alternating group A 15 {\displaystyle A_{15}} . In fact, any 2 k 1 {\displaystyle 2k-1} sliding puzzle with square tiles of equal size can be represented by A 2 k 1 {\displaystyle A_{2k-1}} .

History

Sam Loyd's unsolvable 15 Puzzle, with tiles 14 and 15 exchanged. This puzzle is not solvable as it would require a change of the invariant to move it to the solved state.
U.S. political cartoon about finding a Republican presidential candidate in 1880

The puzzle was "invented" by Noyes Palmer Chapman, a postmaster in Canastota, New York, who is said to have shown friends, as early as 1874, a precursor puzzle consisting of 16 numbered blocks that were to be put together in rows of four, each summing to 34 (see magic square). Copies of the improved 15 puzzle made their way to Syracuse, New York, by way of Chapman's son, Frank, and from there, via sundry connections, to Watch Hill, Rhode Island, and finally to Hartford, Connecticut, where students in the American School for the Deaf started manufacturing the puzzle. By December 1879, these were sold both locally and in Boston, Massachusetts. Shown one of these, Matthias Rice, who ran a woodworking business in Boston, started manufacturing the puzzle sometime in December 1879 and convinced a "Yankee Notions" fancy goods dealer to sell them under the name of "Gem Puzzle." In late January 1880, Charles Pevey, a dentist in Worcester, Massachusetts, garnered some attention by offering a cash reward for a solution to the 15 Puzzle.

The game became a craze in the U.S. in 1880.

Chapman applied for a patent on his "Block Solitaire Puzzle" on February 21, 1880. However, this patent was rejected, likely because it was not sufficiently different from the August 20, 1878 "Puzzle-Blocks" patent (US 207124) granted to Ernest U. Kinsey.

Sam Loyd

Sam Loyd's 1914 illustration of the unsolvable variation.

From 1891 until his death in 1911, Sam Loyd claimed that he had invented the puzzle. However, Loyd had no connection to the invention or initial popularity of the puzzle. Loyd's first article about the puzzle was published in 1886, and it was not until 1891 that he first claimed to be the inventor.

Some later interest was fueled by Loyd's offer of a $1,000 prize (equivalent to $33,911 in 2023) to anyone who could provide a solution for achieving a particular combination specified by Loyd, namely reversing the 14 and 15, which Loyd called the 14-15 puzzle. This is impossible, as had been shown over a decade earlier by Johnson & Story (1879), because it requires a transformation from an even to an odd permutation.

Varieties of the 15 puzzle

The Minus Cube, manufactured in the USSR, is a 3D puzzle with similar operations to the 15 Puzzle.

Versions of the 15 puzzle include a different number of tiles, such as the 8-puzzle or 24-puzzle.

Pop culture

Chess world champion Bobby Fischer was an expert at solving the 15 puzzle. He had been timed to be able to solve it within 25 seconds; Fischer demonstrated this on November 8, 1972, on The Tonight Show Starring Johnny Carson.

See also

Notes

  1. ^ Korf, R. E. (2000), "Recent Progress in the Design and Analysis of Admissible Heuristic Functions" (PDF), in Choueiry, B. Y.; Walsh, T. (eds.), Abstraction, Reformulation, and Approximation (PDF), SARA 2000. Lecture Notes in Computer Science, vol. 1864, Springer, Berlin, Heidelberg, pp. 45–55, doi:10.1007/3-540-44914-0_3, ISBN 978-3-540-67839-7, archived from the original (PDF) on 2010-08-16, retrieved 2010-04-26
  2. Ratner, Daniel; Warmuth, Manfred (1986). "Finding a Shortest Solution for the N × N Extension of the 15-PUZZLE Is Intractable" (PDF). National Conference on Artificial Intelligence. Archived (PDF) from the original on 2012-03-09.
  3. Ratner, Daniel; Warmuth, Manfred (1990). "The (n−1)-puzzle and related relocation problems". Journal of Symbolic Computation. 10 (2): 111–137. doi:10.1016/S0747-7171(08)80001-6.
  4. Richard E. Korf, Linear-time disk-based implicit graph search, Journal of the ACM Volume 55 Issue 6 (December 2008), Article 26, pp. 29-30. "For the 4 × 4 Fifteen Puzzle, there are 17 different states at a depth of 80 moves from an initial state with the blank in the corner, while for the 2 × 8 Fifteen Puzzle there is a unique state at the maximum state of 140 moves from the initial state."
  5. A. Brüngger, A. Marzetta, K. Fukuda and J. Nievergelt, The parallel search bench ZRAM and its applications, Annals of Operations Research 90 (1999), pp. 45–63.
    :"Gasser found 9 positions, requiring 80 moves...We have now proved that the hardest 15-puzzle positions require, in fact, 80 moves. We have also discovered two previously unknown positions, requiring exactly 80 moves to be solved."
  6. ^ "The Fifteen Puzzle can be solved in 43 "moves"". Domain of the Cube Forum
  7. "24 puzzle new lower bound: 152". Domain of the Cube Forum
  8. "m × n puzzle (current state of the art)". Sliding Tile Puzzle Corner.
  9. "208s for 5x5". Domain of the Cube Forum.
  10. "5x5 can be solved in 109 MTM". Domain of the Cube Forum.
  11. "5x5 sliding puzzle can be solved in 205 moves". Domain of the Cube Forum.
  12. Jim Belk (2008) Puzzles, Groups, and Groupoids, The Everything Seminar
  13. The 15-puzzle groupoid (1), Never Ending Books
  14. The 15-puzzle groupoid (2), Never Ending Books
  15. Beeler, Robert. "The Fifteen Puzzle: A Motivating Example for the Alternating Group" (PDF). faculty.etsu.edu/. East Tennessee State University. Archived from the original (PDF) on 7 January 2021. Retrieved 26 December 2020.
  16. ^ The 15 Puzzle, by Jerry Slocum & Dic Sonneveld, 2006. ISBN 1-890980-15-3
  17. Slocum & Singmaster (2009, p. 15)
  18. Barry R. Clarke, Puzzles for Pleasure, pp.10-12, Cambridge University Press, 1994 ISBN 0-521-46634-2.
  19. Clifford A. Pickover, The Math Book: From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, p. 262, Sterling Publishing, 2009 ISBN 1402757964.
  20. "Bobby Fischer solves a 15 puzzle in 17 seconds on Carson Tonight Show - 11/08/1972", The Tonight Show, 8 November 1972, Johnny Carson Productions, retrieved 1 August 2021.
  21. Adam Spencer, Adam Spencer's Big Book of Numbers: Everything you wanted to know about the numbers 1 to 100, p. 58, Brio Books, 2014 ISBN 192113433X.

References

External links

Categories: