Jump to content

15 puzzle: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Luckas-bot (talk | contribs)
m r2.5.2) (robot Adding: uk:П'ятнашки
No edit summary
Line 61: Line 61:
==External links==
==External links==
* [http://www.xs4all.nl/~hc11/15puzzle/15puzzen.htm The history of the 15 puzzle.] by [http://www.xs4all.nl/~hc11/ Harry Broeders]
* [http://www.xs4all.nl/~hc11/15puzzle/15puzzen.htm The history of the 15 puzzle.] by [http://www.xs4all.nl/~hc11/ Harry Broeders]
* [http://www.brian-borowski.com/Software/Puzzle/ Java applet that solves 8- and 15-puzzles] by [http://www.brian-borowski.com/ Brian Borowski]


[[Category:Puzzles]]
[[Category:Puzzles]]

Revision as of 00:45, 24 January 2011

A solved 15-puzzle

The n-puzzle is known in various versions, including the 8 puzzle, the 15 puzzle, and with various names (Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and many others). It is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. If the size is 3×3, the puzzle is called the 8-puzzle or 9-puzzle, and if 4×4, the puzzle is called the 15-puzzle or 16-puzzle. The object of the puzzle is to place the tiles in order (see diagram) by making sliding moves that use the empty space.

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

Solvability

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 function of the tile configuration that is invariant under any valid move, and then using this to partition the space of all possible labeled states into two equivalence classes of reachable and unreachable states.

The invariant is the parity of permutations of all 16 squares (15 pieces plus empty square) plus the parity of the taxicab distance moved by the empty square. This is an invariant because each move changes the parity of the permutation and the parity of the taxicab distance. In particular if the empty square is not moved the permutation of the remaining pieces must be even.

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. Archer (1999) gave another proof, based on defining equivalence classes via a hamiltonian path.

Wilson (1974) studied the analogue of the 15 puzzle on arbitrary finite connected and non-separable graphs. (A graph is called separable if removing a vertex increases the number of components.) He showed that, except for polygons, and 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 obtained.

For larger versions of the n-puzzle, finding a solution is easy, but the problem of finding the shortest solution is NP-hard.[1] For the 15-puzzle, lengths of optimal solutions range from 0 to 80 moves; the 8-puzzle can be solved in 31 moves or fewer (integer sequence A087725).

The symmetries of the fifteen puzzle form a groupoid (not a group, as not all moves can be composed);[2][3] this groupoid acts on configurations.

History

Sam Loyd's unsolvable 15-puzzle, with tiles 14 and 15 exchanged. This puzzle is not solvable because it would require a change of the invariant.
U.S. Political cartoon about finding a Republican presidential candidate in 1880

The puzzle was "invented" by Noyes Palmer Chapman,[4] 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. Copies of the improved Fifteen Puzzle made their way to Syracuse, New York by way of Noyes' son, Frank, and from there, via sundry connections, to Watch Hill, RI, and finally to Hartford (Connecticut), where students in the American School for the Deaf started manufacturing the puzzle and, by December 1879, selling them both locally and in Boston (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 Worcester, Massachusetts, garnered some attention by offering a cash reward for a solution to the Fifteen Puzzle.[4]

The game became a craze in the U.S. in February 1880, Canada in March, Europe in April, but that craze had pretty much dissipated by July. Apparently the puzzle was not introduced to Japan until 1889.

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.[4]

Sam Loyd

Sam Loyd's illustration

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), p. 235:

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".

This is false – Loyd had nothing to do with the invention or popularity of the puzzle, and in any case the craze was in 1880, not the early 1870s:[4]

Sam Loyd did not invent the 15 puzzle and had nothing to do with promoting or popularizing it. The puzzle craze that was created by the 15 Puzzle began in January 1880 in the US and in April in Europe. The craze ended by July 1880 and Sam Loyd’s first article about the puzzle was not published until sixteen years later, January 1896. Loyd first claimed in 1891 that he invented the puzzle, and he continued until his death a 20 year campaign to falsely take credit for the puzzle. The actual inventor was Noyes Chapman, the Postmaster of Canastota, New York, and he applied for a patent in March 1880.

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.[5] This was impossible, as had been shown over a decade earlier by Johnson & Story (1879), as it required a transformation from an even to an odd combination.

Miscellaneous

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

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. ^ 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.
  2. ^ The 15-puzzle groupoid (1), Never Ending Books
  3. ^ The 15-puzzle groupoid (2), Never Ending Books
  4. ^ a b c d The 15 Puzzle, by Jerry Slocum & Dic Sonneveld. ISBN 1-890980-15-3
  5. ^ Korf, Richard E. (2000), "Recent progress in the design and analysis of admissible heuristic functions" (PDF), SARA 2000. Abstraction, reformulation, and approximation: 4th international symposium, Texas, USA. LNCS 1864, Springer, pp. 45–55, doi:10.1007/3-540-44914-0_3, ISBN 978-3-540-67839-7, retrieved 2010-04-26 {{citation}}: Missing or empty |title= (help)

References

Template:Link GA