SLIDING TILES · EXACT ALGORITHM
How to Solve a Slide Puzzle (15 Puzzle): Layer Method & Parity Proof
Once you learn one clean corner-tuck maneuver, knowing how to solve a slide puzzle (the classic 4×4 15 Puzzle) turns chaotic tile shuffling into a calm, repeatable 60-second routine. Invented in 1874 by postmaster Noyes Palmer Chapman in Canastota, New York—and made famous worldwide in 1880 (before Sam Loyd's 1891 $1,000 prize challenge swapping tiles 14 and 15)—the 15-Puzzle also birthed modern permutation group theory in recreational mathematics.
Why Exactly Half of Random 15-Puzzle Arrangements Are Unsolvable
In an 1879 landmark paper in the American Journal of Mathematics (Vol. 2, pp. 397–404), mathematicians Wm. Woolsey Johnson and William E. Story proved that sliding tiles preserves a strict mathematical invariant:
- Read the
15numbered tiles in row-major order (ignoring the blank) and count inversions (I)—every pair where a larger number precedes a smaller number (e.g.,15before14=1inversion). - Let
Rbe the row number of the empty space counting from the bottom (1= bottom row,4= top row). - Solvability Theorem: On a
4×4grid, horizontal slides changeIby0andRby0; vertical slides jump a tile past3neighbors (flipping the parity ofI) while changingRby±1! Because the solved board hasI = 0and the blank on the bottom row (R = 1),(I + R)is always odd across every legal state. Out of16! = 20,922,789,888,000physical arrangements, exactly10,461,394,944,000(50%) are solvable—and Sam Loyd's14–15swap (I = 1, R = 1 → I + R = 2, even) is mathematically impossible! Every deal on 15 Puzzle Online is generated from legal scrambles so 100% of boards are guaranteed solvable (and computer scientist Ralph Brungardt, 1999 proved every solvable4×4position needs at most 80 single-tile moves, "God's Number").
Step-by-Step Fringe & Corner-Tuck Method (Works Every Time)
Never try to solve all 15 tiles at once! Shrink the 4×4 grid into smaller sub-boards in three clean phases:
| Phase | Tiles Locked Permanently | Remaining Active Area | Key Trick |
|---|---|---|---|
| Phase 1: Top Row | 1, 2, 3, 4 |
3 × 4 bottom rectangle |
Place 1 & 2 normally; pair 3 above 4 to tuck both into the right corner together! |
| Phase 2: Second Row | 5, 6, 7, 8 |
2 × 4 bottom two rows |
Exact same corner tuck: park 7 at r2c4 and 8 directly below it at r3c4 with the blank at r2c3, then slide left and up! |
| Phase 3: Left Pairs | 9 & 13, then 10 & 14 |
2 × 2 final square (11, 12, 15) |
Tuck 13 right behind 9 horizontally so they rotate into column 1 as a vertical pair! |
| Phase 4: Final 2×2 | 11, 12, 15 + blank |
Solved! | Rotate the remaining 3 tiles clockwise or counterclockwise in 1–3 clicks—parity guarantees 11, 12, 15 fall into order! |
How the "3-and-4 Corner Tuck" Works Without Disturbing 1 and 2
Beginners get stuck because sliding 3 into r1c3 leaves no room to bring 4 into r1c4 without kicking 3 back out. Do this instead:
- Lock
1intor1c1and2intor1c2—never touch those two squares again. - Keep
r1c3andr1c4open while positioning tile3into the top-right corner (r1c4) and tile4directly underneath it (r2c4) with the empty space atr1c3. Sliding3left (r1c4 → r1c3) and4up (r2c4 → r1c4) locks both3and4into place in two clicks! (If4accidentally slips under3whiler1c3is still occupied, simply back3down into row 2, clearr1c3, and repeat.) - Repeat the exact same two-tile train for
7&8on Row 2, then turn the idea 90 degrees sideways on the bottom two rows: place9atr4c1and13right beside it atr4c2with the blank atr3c1, then slide9up and13left!
Practice the corner tuck right now on 15 Puzzle Online, or test irreversible crate-pushing geometry in Sokoban Warehouse Puzzles.