Sliding puzzles have a property almost nobody knows about, and it explains a frustration everybody has had: exactly half of all arrangements are impossible to solve. Not hard. Impossible - no sequence of legal moves will ever get there.

If you have ever popped the tiles out of a physical 15-puzzle, put them back in a different order, and then spent an hour failing to solve it, this is why. You did not create a hard puzzle. You created an unsolvable one.

The parity argument

The reasoning is elegant enough to follow without any mathematics background.

Every legal move slides one tile into the blank space. Think of that as swapping the tile with the blank. So every move is exactly one swap of two items.

Mathematicians classify arrangements by parity: whether the number of swaps needed to reach them from the solved state is odd or even. And there is a rule - performing one swap always flips an arrangement from odd to even or from even to odd.

Now add the second ingredient: the blank must return to its home corner for the puzzle to be solved, and moving the blank around the grid and back to where it started always takes an even number of moves. It is a closed loop on a chequerboard.

Put those together. Getting home requires an even number of blank moves, each move is one swap, so the total number of swaps is even. That means only arrangements with even parity can ever reach the solved state. The odd ones cannot - there is no path, and no amount of cleverness creates one.

Half of all arrangements are odd. Hence: half are unsolvable.

The famous swindle

This is not an obscure curiosity. In the 1880s the puzzle-maker Sam Loyd popularised a version of the 15-puzzle with the 14 and 15 transposed, and offered a substantial cash prize for a solution.

Swapping two adjacent tiles flips the parity. His arrangement was an odd permutation, so it was unsolvable, and the prize was never in any danger. People spent months on it.

Whether Loyd actually originated the puzzle is disputed by historians - he claimed credit for a good deal he did not invent - but the parity trap itself is real, and it is one of the better stories in puzzle history.

What this means for you here

A well-built digital implementation never generates an unsolvable board. There are two ways to guarantee it: check the parity of a random arrangement and reject or repair the odd ones, or - more commonly - start from the solved state and apply a long sequence of random legal moves. The second method cannot produce an unsolvable position, because every position it reaches is by construction reachable.

So when you play the sliding puzzle here and it will not come out, the puzzle is solvable and you are stuck. Which is, depending on temperament, either reassuring or much worse.

How to actually solve one

The method that works is layer by layer, and it is worth learning because improvisation stops working above a 3x3 grid.

  1. Solve the top row, left to right, leaving the last two tiles of the row for a special manoeuvre. Placing the final corner tile requires a small setup sequence that temporarily displaces the tile next to it.
  2. Solve the left column downward, using the same trick at the bottom.
  3. Repeat on the remaining sub-grid. Each completed row and column shrinks the problem, and you never disturb what is already placed.
  4. Finish the last 2x2 or 3x3 by rotation. The final square is solved by cycling three tiles around the blank.

The important discipline is the third step: once a row is done, it is off-limits. Beginners solve the top row, then wreck it while working on the second, and go round in circles forever.

That habit - protecting completed work while operating on the remainder - is the single most transferable idea in puzzle solving. It is exactly what keeps a patience game on track: In FreeCell, the winning approach is to plan a dig completely before starting it, precisely so you do not dismantle a structure you already built.

Parity is everywhere once you look

The reason this is worth more than a party fact is that parity arguments settle questions in a lot of games, usually by proving something is impossible rather than by finding a solution.

The clearest example on a board is the endgame counting rule in disc-flipping games - whether the number of remaining squares is odd or even determines who plays last, and the last move is permanent. Spend an evening with Reversi online and two evenly matched players can reach an identical-looking position where one of them has already lost on parity alone.

And it shows up in tile games as a solvability guarantee. A well-built matching board is generated backwards, by placing matched pairs in an order that ensures a solution exists - which is the same trick as scrambling a slide puzzle with legal moves. Take Mahjong online: the board you are given is solvable by construction, and a dead end is yours rather than the generator's.

The related puzzles here

Several games on this site share the constrained-movement structure that makes parity matter. Klotski is a sliding-block puzzle with rectangular pieces rather than a uniform grid, which makes it far harder to reason about and much more satisfying. Rush Hour applies the same idea to cars in a traffic jam, where each piece slides only along its own axis. Towers of Hanoi has a different but equally clean mathematical structure - the minimum number of moves is always exactly 2n - 1, and the optimal solution is a strict pattern.

Peg Solitaire is the best companion to this article, because it has its own famous impossibility result: certain starting and finishing positions can be proven unreachable using an argument very similar in spirit to the parity one above.

Try it on a real board

Solve a sliding puzzle using the layer method rather than by feel, and force yourself to never disturb a completed row. It is slower for the first two attempts and dramatically faster thereafter.

Then try Klotski, where the same discipline applies but the pieces are no longer interchangeable. The rules hub covers every puzzle here, the beginner guide suggests a starting order, and the glossary names the terms.

For why some of these puzzles are genuinely hard for computers as well as people, see the companion piece.