MathLabs
TheoremProved

Loyd–Johnson 15-puzzle parity invariant

Statement

In the 4×44\times 4 sliding 1515-puzzle, let N(s)N(s) be the number of tile inversions (pairs (i,j)(i,j) with i>ji > j such that tile ii appears before tile jj in row-major snake order) and let r(s)∈{1,2,3,4}r(s) \in \{1,2,3,4\} be the row of the blank square when reading in standard row-major order, or equivalently let d(s)d(s) be the Manhattan distance of the blank from the bottom-right corner. Then the parity (N(s)+r(s)) mod 2(N(s) + r(s)) \bmod 2 is invariant under every legal slide. In particular, the configuration with tiles 1414 and 1515 swapped is insolvable.

Why is it true?

A horizontal slide leaves the row-major order of the 1515 numbered tiles completely unchanged, while a vertical slide jumps one tile past exactly 33 other tiles in row-major order (changing the inversion count by ±1\pm 1 or ±3\pm 3, always odd) and simultaneously changes the blank's row r(s)r(s) by ±1\pm 1.

Proof sketch

Step 1 (horizontal slides). When the blank slides left or right within the same row, no numbered tile changes its position in the row-major listing of the 1515 tiles, and the blank stays in row r(s)r(s). Thus ΔN=0\Delta N = 0 and Δr=0\Delta r = 0, so N(s)+r(s)N(s) + r(s) is unchanged.

Step 2 (vertical slides). When the blank slides up or down, the tile tt moving into the blank's old square shifts by 33 positions in the row-major sequence of the 1515 numbered tiles. Crossing each of those 33 tiles flips whether (t,u)(t, u) is an inversion, changing N(s)N(s) by +1+1 or −1-1 per tile. The total change is ΔN∈{−3,−1,+1,+3}\Delta N \in \{-3, -1, +1, +3\}, which is always odd. At the same time Δr∈{−1,+1}\Delta r \in \{-1, +1\} is also odd, so Δ(N+r)\Delta(N + r) is even.

Step 3 (swapping 14 and 15). Swapping tiles 1414 and 1515 with the blank fixed at row r=4r = 4 changes N(s)N(s) by +1+1 (from 00 to 11) while Δr=0\Delta r = 0. Hence (N+r) mod 2(N + r) \bmod 2 differs between the start state (1+4≡1(mod2)1 + 4 \equiv 1 \pmod 2) and the solved state (0+4≡0(mod2)0 + 4 \equiv 0 \pmod 2), proving no sequence of legal slides can reach the solved state.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. Arthur Engel (1998). Problem-Solving Strategies · DOI:10.1007/b97682
  2. Jessica Striker (2017). Dynamical Algebraic Combinatorics: Promotion, Rowmotion, and Resonance · DOI:10.1090/noti1539