Enter your search keyword(s): Click to search our directories-AllWebHunt, Encyclopedic, TopChoice, Or Google, Alexa, About & Yahoo:

Games and Puzzles
Home / Top / Science / Math / Recreations / Games and Puzzles See also:
Related articles

Edit | Discuss Article

# N-puzzle

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

It is possible to use parity arguments to show that some 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 labelled states into equivalence classes of reachable and unreachable states.

## How Sam Loyd made his fortune

In its most famous version, the fifteen puzzle 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.

Thus, the goal is to produce this configuration:

If the pieces 14 and 15 are exchanged, resulting in the following initial configuration:
then the puzzle is not soluble.

The "hook" in the fifteen puzzle is 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.

This allowed Sam Loyd, who invented the puzzle in the 1870s, to offer a prize of \$1000 which could never be claimed, fueling the popularity of the game. The game became a craze in both the USA and in Europe.

For larger versions of the fifteen puzzle, the problem of finding a solution is easy. The problem of finding the shortest solution is NP-hard.

Quia! Mathematics Activities
Educational activities for teaching mathematics including concentration, matching, flash cards, word search puzzles, and Java games.
http://www.quia.com/dir/math/

Interactive Mathematics Miscellany and Puzzles
Java-based math resource including articles, puzzles and links.
http://www.cut-the-knot.com/content.html

A+ Math
Interactive math help for K-12 students with flashcards, Math Wordfind, Homework Helper and worksheets.
http://www.aplusmath.com/

Colorful Mathematics
Educational software presents advanced mathematics to K-12 students in a game-oriented approach, using coloring and drawing techniques to illustrate concepts from graph theory and computer science.
http://www.math.ucalgary.ca/~laf/colorful/colorful.html

Pythabacus
Description and instruction of using the ancient Pythagorean Abacus to do arithmetic.
http://www.pythabacus.com/

Wu's Riddles
A collection of riddles, puzzles, and technical interview questions, with a discussion forum.
http://www.ocf.berkeley.edu/~wwu/riddles/intro.shtml

Mathematical Recreations
Detailed exploration of a selection of mathematical topics.
http://www.mathrec.org/

The Contest Center
Classic puzzles and riddles requiring only simple logic and elementary math.
http://www.contestcen.com/classic.htm

Riddles
A collection of riddles and logic puzzles with solutions.
http://www.julienstern.org/riddle.php3

15 Puzzle of Sam Lloyd
Play online Sam Lloyd's "15" puzzle The funny story of this game Mathematical implications of this game Some funny logical problems with the 15 game.
http://www.holotronix.com/samlloyd15.php

Torus and Klein Bottle Games
Collection of Java-based educational puzzles.
http://www.geometrygames.org/TorusGames/index.html

SMSU Problem Corner
Math challenges Southwest Missouri State University in three levels of difficulties.
http://math.smsu.edu/%7Eles/POTW.html

BCIT Mathematical Entertainment
Famous mathematical problems, puzzles, facts, games and trivia.
http://www.math.bcit.ca/entertainment/

Math Puzzles
Logic puzzles and riddles with some solutions.
http://www.math.utah.edu/~cherk/puzzles.html

Alien Tiles
Object of puzzle is to try to get color pieces to create certain patterns in cube.
http://www.alientiles.com/

Alphametic Puzzles
Nmerous puzzles, links, puzzle solver, and a generator.
http://www.tkcs-collins.com/truman/alphamet/

The rec.puzzles Archive
This newsgroup archive is a list of puzzles, categorized by subject area. Each puzzle includes a solution, compiled from various sources, which is supposed to be definitive.
http://einstein.et.tudelft.nl/~arlet/puzzles/

Scott Kim
Puzzles for web, computers, and print; ambigrams.
http://www.scottkim.com/

Sequence Puzzles and Problems
With links to related sites. Compiled by Torsten Sillke.
http://www.mathematik.uni-bielefeld.de/~sillke/SEQUENCES/

Clever Games for Clever People
Games that interest John Conway including Rim and Traffic Jam.
http://www.cs.uidaho.edu/%7Ecasey931/conway/games.html

Contest Center Cryptarithms
Examples of cryptarithms, with prize competitions for subscribers.
http://www.contestcen.com/rithms.htm

Alphametics and Cryptarithms
Puzzles in which letters or symbols are substituted for the digits in an arithmetical operation like addition.
http://www.mathematik.uni-bielefeld.de/~sillke/PUZZLES/ALPHAMETIC/

Alphametics Page
Compiled by Mike Keith. Examples of various genres.
http://members.aol.com/s6sj7gt/mikealp.htm

Logic Puzzles
Collection of original numerical-logic puzzles. Many are long and difficult, involve sorting and comparing long lists and are intended to be solved using a good spreadsheet program.
http://www.geocities.com/bob_kraus_2000

A Primer on Cryptarithmetic
http://www.geocities.com/Athens/Agora/2160/primer.html

Nick's Mathematical Puzzles
A collection of puzzles, with hints, solutions, and links to relevant mathematical topics.
http://www.qbyte.org/puzzles/

Nikora's Puzzles
A set of puzzles and riddles, ranging from basic math to college level, with full solutions.
http://www.nikora.com/puzzles/

Paul Hsieh's Puzzles
Logical and mathematical brain teasers, with an indication of difficulty. Hints are provided; solutions are available by email.
http://www.azillionmonkeys.com/qed/puzzles.html

Mathwizz
Interactive math problems for abilities ranging from middle school to university.
http://www.mathwizz.com/

Archive Creative puzzles
Interactive puzzle archive with descriptions for puzzle construction and a special childrens puzzle page.
http://www.creativepuzzels.nl

MatheMagic
A collection of mathematical puzzles, jokes and articles.
http://geocities.com/mathimoh

Mathschallenge.net
A website dedicated to the puzzling world of mathematics and computer programming.
http://mathschallenge.net/

Ken Duisenberg's Puzzle of the Week Archives
Challenging puzzles and problems.
http://www.ecst.csuchico.edu/%7Ekend/potw/archlist.html

Mathpuzzle.com
Celebrates math puzzles and mathematical recreations.
http://www.mathpuzzle.com/

Algebraic Math Puzzles
A collection of puzzles at high school level. Does not include answers.
http://www.lifesmith.com/mathpuz1.html

Group Games
Animations that develop the theory behind such puzzles as the Rubik cube.
http://www.dsm.univ.trieste.it/%7Elogar/duek2/index_engl.html

Free Puzzle Collections
Educational and recreational puzzles for teachers, students and parents. Each puzzle is graded by difficulty and has a hint. Solutions are available to members.
http://www.freepuzzles.com/

Aha! Puzzles
Puzzles, books, games and tests with designed by Lloyd King, author of "Test Your Creative Thinking".
http://www.ahapuzzles.com

A tough but simply defined problem which demonstrates key issues in probability.
http://www.anc.ed.ac.uk/~amos/doubleswap.html

Mathproblems.info
Over one hundred and fifty math problems ranging from basic math to differential equations.
http://mathproblems.info/

Math Forum
Resources, problems and forum for teachers and students in mathematics.
http://mathforum.org/

Brain Teasers and Maths Puzzles
Interactive logical and mathematical puzzles with feedback and detailed solutions.
http://www.syvum.com/teasers/

Logicville
Educational puzzles, brain teasers, and word games such as anagrams, cryptograms, alphametics, doublets, tangrams.
http://www.logicville.com/

MatheMajik
Indian site featuring calculation tricks and math puzzles.
http://mathemajik.tripod.com/

Polymorf - Symmetry of Polyhedra
A demonstration of the symmetry and transformational properties of the Platonic and Archimedean solids.
http://www.polymorf.net/

iQED!
Lateral puzzles from "Puzzles for the High IQ" author Lloyd King and founder of The Puzzle Wizards SiteRing.
http://homepage.ntlworld.com/atalanta

Pastime and activity links for various geometric patterns, polygons and polyhedra by Jill Britton.
http://www.camosun.bc.ca/~jbritton/jbpolyhedra.htm

Mr Titen's More Than Math
Mathematics teacher provides puzzles for students.
http://www.geocities.com/EnchantedForest/Tower/1133/

Curious Numbers
A tribute to the lighter side of math including puzzles, humor, trivia, quotes, inspirations, and math links.

The Puzzling World of Barry R. Clarke
Brain teasers, articles and puzzles forum.
http://barryispuzzled.com/

Tile Tris
Tile a spheroid working room aperiodically or periodically. Includes free demo download.
http://members.lycos.co.uk/tiletris/

Brain Teasers by QBrute
Original brain teasers with solutions.
http://www.angelfire.com/empire/qbrute/

Magic Math Kingdom
Learn math through games and quiz-oriented tutorial.
http://www.nes-lab.com/english2/

The Enigmatic World of Philip Carter
Collection of brain teasers from the author of IQ books.
http://www.knowl.demon.co.uk/

Perfect Times
Teaches and assesses fluency of multiplication and division tables using online cards. Submit data and compare results.
http://www.perfect-times.co.uk/

Mixed Up Math
Logic problems, where equations are mixed up. In various formats like boxes, crosses, diagonals, mazes. Free download.
http://www.kprobe.com/kprobe/mu.htm

The Null Set
Puzzles collected by Guy Kindler, most requiring some undergraduate mathematical knowledge. Some hints are provided.
http://www.princeton.edu/~mathclub/puzzles.html

 Help build the largest human-edited directory on the web. Submit a Site - Open Directory Project (modified) - Become an Editor