The quickest impossibility proofs: find a quantity that the operation preserves modulo something, and compare the start and the target.

InvariantTypical operation
parity of the sumchange two elements by each, or add to a pair
sum modulo operations that add a multiple of in total
xor of all elementsreplace by and , or by
gcd of all elementsreplace by (Euclid steps)
permutation parityswapping two elements flips it; a 3-cycle keeps it
chessboard colour countdominoes cover one black and one white cell
colouring mod tiles cover each colour class once
alternating sumadd 1 to two adjacent elements

The sliding puzzle (15-puzzle)

An board with tiles and a blank; slide a tile into the blank. The goal is in row-major order with the blank last.

bool slidingSolvable(int R, int C, const vector<int>& g) {
    vector<int> t; int blankRow = 0;
    for (int i = 0; i < R * C; i++) if (g[i]) t.push_back(g[i]); else blankRow = i / C;
    int inv = 0;                                            // O(n^2) is fine; use a BIT for big boards
    for (int i = 0; i < sz(t); i++) for (int j = i + 1; j < sz(t); j++) inv += t[i] > t[j];
    if (C % 2 == 1) return inv % 2 == 0;
    return (inv + blankRow) % 2 == (R - 1) % 2;
}

Mutilated chessboard and friends

  • An board with two opposite corners removed cannot be tiled by dominoes: both removed cells have the same colour, and each domino covers one of each.
  • A board cannot be tiled by tiles: colour cell by ; each tile covers each colour once, but the colour counts are .
  • Replacing by preserves the parity of the sum, so the parity of the final number is fixed.

Related: Invariants and Extremal Arguments, Counting Fundamentals (permutation parity).