Why Are Some Slide Puzzle Layouts Unsolvable?

If you shuffle number tiles at random, exactly half of the layouts are unsolvable, so a game has to check by calculation that its shuffle can be solved. The test is whether the number of inverted pairs is even or odd, and on boards with an even width such as 4x4 you also look at which row, counted from the bottom, the blank is in. When Gamemoa’s Slide Puzzle gets an unsolvable layout it swaps two tiles to fix it, so every board you start can be finished.

슬라이드 퍼즐을 맞추는 여성 모습 사진 AI-generated image

What does “some layouts are unsolvable” mean?

A 3x3 board has eight number tiles and one blank. There are 362,880 ways to arrange them in the nine cells, but only half of them, 181,440, can be reached by sliding tiles into the blank. A 4x4 board is the same: only half of all layouts, 10,461,394,944,000, are solvable. The other half never reaches the finished state however you slide. Those numbers are simply 9! and 16! divided by two.

How are inverted pairs counted?

Read the tiles from top left as one line, leaving out the blank. A pair where an earlier number is larger than a later one is an inverted pair. If the reading order is 2, 1, 3, then 2 and 1 are inverted, so there is one pair. The game code compares every pair of tiles in order and skips the blank (0). With at most 15 tiles, doing every comparison causes no visible delay.

Sliding a tile sideways never changes the reading order. Sliding vertically makes one tile jump past the other tiles in between, which is the row width minus one of them. On 3x3 that is two tiles, so the parity of inversions stays the same, and only a layout with an even inversion count connects to the finished state. On 4x4 a vertical slide jumps over three tiles, which flips the parity, and the blank’s row changes as well, so the two are judged together.

Judging and fixing a shuffled layoutShuffle tiles at random → Solvable by inversions (+ blank row)?; Solvable by inversions (+ blank row)? → Swap two number tiles (no); Solvable by inversions (+ blank row)? → Already solved? (yes); Swap two number tiles → Already solved?; Already solved? → Shuffle tiles at random (yes); Already solved? → Start the board (no)noyesyesnoShuffle tiles atrandomSolvable byinversions (+ blankrow)?Swap two numbertilesAlready solved?Start the board
Judging and fixing a shuffled layout — If unsolvable, swap two number tiles; if already solved, shuffle again

Why does swapping two tiles make it solvable?

Swapping two number tiles always flips the parity of inversions. An unsolvable layout has the wrong parity, so one swap moves it to the solvable side. The game code first swaps the first two cells, and if one of them is the blank it picks a non-blank cell instead. This keeps the blank’s row unchanged and flips only the parity, so one calculation is enough without reshuffling again.

What tips help when solving by hand?

Fill the top row first up to 1, 2, 3 (or 4), then the left column, and finish in the small remaining area. Leave rows you have already finished alone, which keeps the move count down. The move count goes up by one for each tile slid, and the timer starts at the first slide. The best record is the lowest move count, so get used to 3x3 first, then move to 4x4.

You can use arrow keys as well. They show the direction the tile moves, not the blank, so Up brings the tile below the blank upward. It can feel confusing at first, so think in terms of the tile you see moving.

How can a family enjoy it together?

The basic rule is that one person solves while the others wait without hints. After each round, say the move count and pass the device around to compare. A cooperative style also works: one person watches the screen and calls directions while another presses the keys. Because every new shuffle is guaranteed solvable, nobody has to wonder “is this one impossible?” and everyone can try to the end.

How can you tell when a puzzle is unsolvable?

If a paper slide puzzle or one you made yourself will not come out, you can use the calculation above to check whether the layout is solvable. On 3x3, read the numbers without the blank as one line, count the inverted pairs and see only whether the count is even. If it is odd, no amount of sliding will finish it. In Gamemoa this worry is removed because unsolvable layouts are filtered out at the shuffle step, so what is stuck is your sequence, not the layout. When you feel stuck, do not be afraid to break up a finished row, and try handling the last two rows together.

Round length by gameFamily Duel: 30 s; Word Catch: 45 s010203040Family Duel30 sWord Catch45 s
Round length by game — Read from the game data at build time

FAQ

Is New Shuffle always solvable?

Yes. If a shuffled layout is judged unsolvable, two number tiles are swapped to make it solvable. If the shuffle lands on an already solved state, it shuffles again.

Which way do the arrow keys move?

They show the direction the tile moves. Pressing Up lifts the tile below the blank upward into the gap.

What is the best record based on?

The lowest move count, saved separately for 3x3 and 4x4 in this device's browser. Time is shown on screen but is not the saving criterion.

Basis: Shuffle calculation and controls on the Gamemoa Number Slide Puzzle screen (3x3, 4x4, inversion count, blank row position). Sources checked on 2026-10-30. Game rules, times and formulas are the values used on the Gamemoa game screens; general figures are restated from the public references above.

Games related to this post