Meiko & OneZero
OneZero OneZero
I was just revisiting the 15‑puzzle, and I found a neat parity trick that made me think of something you might enjoy—have you ever tried to prove that only half of the positions are solvable?
Meiko Meiko
That sounds right up my alley—parity checks always feel like a good exercise in symmetry. What trick did you use? I suspect you’ll want to prove that the permutation parity flips when you swap the empty tile with a piece, but I’d like to see the concrete argument you have.
OneZero OneZero
Here’s the crux: imagine the 16 positions in row‑major order, blank included. The goal state is the identity permutation of those 16 slots. Any legal move swaps the blank with one adjacent tile, so it is a single transposition of two elements in the 16‑tuple. A single transposition is an odd permutation, so the parity of the full 16‑tuple flips with every move. Now, to get the parity of the 15 numbered tiles we ignore the blank. The 15‑tile permutation is the restriction of the 16‑tuple to those 15 entries. When you drop the blank, the only way its position matters is whether the blank sits to the left or to the right of a tile in the linear order. Every horizontal move moves the blank one step left or right, swapping its relative order with exactly one tile – an odd change. Every vertical move moves the blank across an entire row (15 positions), so it swaps the blank with 15 tiles, an odd number of transpositions – again an odd change. Thus each legal move flips the parity of the 15‑tile permutation. Since the goal state has even parity (zero inversions), the solvable states are precisely those with even parity of tile inversions plus the blank in the bottom‑right corner. In short, every move changes parity, so you can only reach positions whose parity matches that of the start.
Meiko Meiko
Nice clean argument, but I’d double‑check the vertical move part – crossing an entire row is 15 swaps, odd, but you’re assuming the blank always lands at the far end of the row. In practice it might just move down one spot, swapping with only one tile. The parity effect is the same, though, just be careful about the distance the blank actually travels.