Fifteen puzzle
| It has been suggested that this article or section be merged into Sliding puzzle. (Discuss) |
The n-puzzle is known in various versions, including the 8 puzzle, the 15 puzzle, and with various names. It is a sliding puzzle that consists of a grid of numbered squares with one square missing, and the labels on the squares jumbled up. If the grid is 3×3, the puzzle is called the 8-puzzle or 9-puzzle. If the grid is 4×4, the puzzle is called the 15-puzzle or 16-puzzle. The goal of the puzzle is to un-jumble the squares by only making moves which slide squares into the empty space, in turn revealing another empty space in the position of the moved piece.
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*.
A simple parity argument shows 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 (see example below).
Noyes Chapman's Fifteen Puzzle
In its most famous version, the Fifteen Puzzle, initially known as the Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square, and many others, is a game in which 15 of the 16 squares of a 4×4 frame are filled with numbered sliding pieces, leaving one space in which to slide one piece at a time. The object is to slide the 15 pieces into numerical order with the empty space after the 15 block. In the initial configuration, pieces 14 and 15 are exchanged.
Solution
This puzzle is not solvable. The proof involves noting that there are two distinct sets of positions which can be assembled from the pieces with different parity, and there is no way of moving between them using the allowed moves, as they preserve parity. The parity in this context (the invariant) is the parity (odd or even) of the number of pairs of pieces in reverse order plus the row number of the empty square. For the order of the 15 pieces consider line 2 after line 1, etc., like words on a page.
Thus an even permutation of the order of the 15 pieces can only be obtained if the empty square is not moved or moved two rows, and an odd permutation of the order of the 15 pieces can only be obtained if the empty square is moved one or three rows.
By contrast, note that considering the parity of permutations of all 16 squares (15 pieces plus empty square) is not meaningful here, because it changes with every move.
History
Sam Loyd claimed from 1891 until his death in 1911 that he invented the puzzle. But he had
nothing to do with the invention or popularity of the puzzle.[1] 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. 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
For larger versions of the n-puzzle, finding a solution is easy, but the problem of finding the shortest solution is NP-hard.[2]
In the USSR the Minus Cube was manufactured, a 3D variant of the 15-puzzle.
Bobby Fischer is an expert at solving the 15-Puzzle, provided that it is in a configuration that can be solved, and he has been timed to be able to solve it every time within 25 seconds. Fischer demonstrated this on November 8, 1972 on The Tonight Show Starring Johnny Carson.
See also
References
- ^ a b
- ^ 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.
External links
- Fifteen Puzzle: A free flash version by logical-games.org. Daily Puzzles.
- Sliding Grid Puzzle: A simple demonstation of XHTML, CSS, Javascript and PHP implementing a rudimentary version of the Sliding Grid Puzzle by Andrew Tomazos. Generates solvable puzzles as well as unsolvable ones.
- Matt's Puzzle: A popular free Fifteen Puzzle game with video support by Matt Briggs.
- 8-Puzzles-Applet: A Java-Applet as mashup for all web-users, implemented by Stefan Baur.
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)



