The 1995 Tiger Electronics toy Lights Out: a 5×5 grid of buttons; pressing one toggles itself and its four orthogonal neighbours. Reach all-off from a given lit pattern. Behind this children's puzzle is one of the cleanest examples of linear algebra over : a pattern p is a vector in , each button is a fixed "press vector" , and since presses commute and self-cancel mod 2, "which buttons to press" is itself a vector solving
where A is the symmetric 25 × 25 binary matrix with iff pressing button i toggles light j. In row-major coordinates, A is block tridiagonal:
where is the n × n off-diagonal "adjacency" tridiagonal matrix. View A as a graph operator: it is the reflexive adjacency matrix of the m × n grid graph (a vertex plus its neighbours). All of §27 chases one question — what does this matrix's kernel look like over , because
completely determines both how many patterns are solvable () and how many solutions each solvable pattern has (exactly ).
The 3 × 3 board's A is full rank — every pattern is solvable in at most 9 presses. The 5 × 5 board has : exactly patterns are solvable (a quarter of all ), each in distinct ways. Both boards below run Gaussian elimination and then pick the minimum-Hamming-weight coset representative. Diameter = 15 on 5 × 5.
The 5 × 5 kernel has basis . Geometric meaning: pressing exactly the marked buttons restores the all-off board. Adding any quiet pattern to a solution yields another valid solution — that is where the "4 solutions" come from. They also give the solvability test:
(Proof: A is symmetric, hence — the standard finite-dimensional fact, which still holds over .) Toggle cells and watch the two dot products update. A pattern is solvable iff it is orthogonal to both and .
The abstract sentence "A is full rank ⇒ solvable" does not tell you how to solve. Real solvers run row reduction over : starting from , swap rows and add rows (XOR over ) until reaching . Each step: in column c, find a non-zero entry at or below row r and swap it up as pivot; then XOR-clear every other row's c-column. After 9 pivots, b has been transformed into the solution x.
The whole process costs bit operations — on 25 × 25 that is about XORs, microseconds on a modern CPU. This contrasts sharply with the cube: the cube group is non-Abelian and optimal solving is NP-hard (§16); Lights Out, being Abelian, sits comfortably in P.
Every Lights Out player learns to chase the lights: hold the top row, then scan downward — if (r−1, c) is still lit, press (r, c) to kill it. This is one-pass forward elimination; it always clears every row above. But the bottom row's residual need not be zero — it depends on the top-row "kick". The top row has 32 possible kicks; on 5 × 5, exactly 4 of them (because dim ker = 2 and the bottom-row residual must land in the projection of ker onto the bottom row) let the chase finish. Two passes — "chase + correct top row + chase again" — solves any solvable pattern in ≤ 15 moves.
Chase-the-lights is essentially block upper-triangulation: write A using the first m − 1 rows as where S is the Schur complement. The space of admissible top-row kicks is exactly . On a 5 × n board, S is 5 × 5 and its kernel dimension equals dim ker A (so dim = 2 when n = 5). That is the algebraic reason "4 of the 32 top rows work".
Reduce Lights Out to a 1 × n line. Now A is the n × n reflexive tridiagonal-symmetric matrix . Its characteristic polynomial obeys a Chebyshev-style recurrence — Sutner's key observation:
Over , reduces to the Fibonacci polynomial mod 2. Consequence: if , else 0. Concretely:
Now close the line into a ring (index mod n addition) — the σ⁺ game on the cycle . The matrix A becomes cyclic-symmetric (an n × n circulant). Diagonalising over its discrete Fourier basis, one proves over :
Contrast: the line needs n ≡ 2 (mod 3) for a non-trivial kernel; the cycle needs n ≡ 0 (mod 3) and gives dimension 2 (not 1). Same local rule, different topology, completely different kernel. The cleanest small example of "boundary conditions change the global solution space".
For a general m × n board, the kernel dimension has a strikingly elegant algebraic formula — due to Sutner (1989) and crystallised by Anderson & Feil (1998). With from §27.5:
Key observation: A is the Kronecker sum . For each eigenvalue λ of over , A restricts on that eigenblock to , which is evaluated at x = λ + 1 (≡ −λ − 1 over ). So A is singular iff some λ satisfies and — i.e. the two polynomials share a root — i.e. their gcd has positive degree.
Compute dim ker for m, n = 1..8 (the table below runs gf2Reduce live in your browser) — a "gold-band" pattern appears: roughly one-third of sizes carry a non-trivial kernel.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 2 | 1 | 0 | 2 | 0 | 1 | 0 | 2 | 0 |
| 3 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 2 |
| 4 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 3 | 0 | 2 | 0 | 4 | 1 |
| 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
| 7 | 0 | 2 | 0 | 0 | 4 | 0 | 0 | 2 |
| 8 | 1 | 0 | 2 | 0 | 1 | 6 | 2 | 0 |
Sutner's 1989 paper introduced the σ-game on an arbitrary simple graph G = (V, E). Vertices are lights. Pressing vertex v:
Sutner's signature theorem — an "every graph can be all-lit" miracle:
Proof sketch: A + I is symmetric over , so . Key lemma: every kernel vector v ∈ ker(A + I) has even Hamming weight — its support is an "odd closed-neighbourhood subset" of G, and the handshake lemma forces it to be even. Therefore , so , so . QED. A delicious example of a combinatorial lemma getting algebraised.
Here are 5 small graphs. P₅ is a path, C₅ a 5-cycle, K₄ and K₅ complete, Petersen the famous 10-vertex 3-regular graph. Click "show all-ones solution" to see the press set Sutner's theorem guarantees (green ring).
Note Petersen has dim ker = 0 in σ⁺ (full rank), so its all-ones solution is unique. K₅'s A + I is the all-ones 5 × 5 matrix, rank 1 over with nullity 4 — the all-ones target has different solutions (pressing any 1, 3, or 5 of the vertices works).
Tiger and others have re-issued Lights Out many times; each variant is "swap (G, k)" — change graph G or coefficient ring . The well-studied ones:
| variant | graph G | ring | state space | dim ker |
|---|---|---|---|---|
| Lights Out (1995) | 5 × 5 grid | 2²³ = 8.4 M | 2 | |
| Mini Lights Out | 4 × 4 torus | 2¹⁶ = 65 K | 0 | |
| Lights Out 2000 | 5 × 5 grid | 3²² ≈ 31 G | 3 | |
| Lights Out Cube | 3 × 3 × 3 surface (54 lights) | 2⁴⁸ ≈ 281 T | 6 | |
| Lights Out Deluxe | 6 × 6 grid + diag neighbours | 2³⁶ ≈ 69 G | 0 | |
| XL-25 (1983, Vulcan) | 5 × 5 grid (earliest commercial) | 2²³ | 2 | |
| hex Lights Out | hexagonal honeycomb | size-dependent | varies |
The Cube variant's dim ker = 6 stems from the 3 × 3 × 3 surface graph's symmetry: the 24 outer cube rotations give 6 independent "face-symmetric" quiet patterns. The 24-rotation group is the same as the cube symmetries from §14 — but acting on a different algebraic object (adjacency vs permutation), the outcome is completely different.
Lights Out 2000 moves to mod 3: lights cycle through grey / green / red on each press. The same matrix now lives over . Its kernel dimension jumps to 3 — the extra "mod 3 quiet patterns" are invisible from the viewpoint. General fact: depends on p; the integer determinant tells you exactly which primes make A singular. On 5 × 5, over , and the Smith normal form shows the elementary divisors contribute singular behaviour at both mod 2 and mod 3.
Lights Out is literally a linear coding problem over . Think of "button configuration" as plaintext and "lit pattern" as codeword , then:
This links the toy puzzle to LDPC / coding theory. Conversely, any solvable -linear system can be re-cast as some Lights Out instance.
Three facts make Lights Out "easy":
Consequence: on an N = mn-cell Lights Out board, is it solvable? and what is a shortest solve? are both in time, or with (fastest known matrix multiplication). Contrast: optimal-solving the n × n × n Rubik's cube is NP-complete (Demaine et al. 2018). Drop any of the three properties above (press order matters → non-Abelian; or 4-state lights with non-linear rule), and Lights Out lands in NP-hard immediately.
The earliest commercial release was XL-25 (Vulcan Electronics 1983), invented by Hungarian László Mérő — 5 × 5 with both standard and knight's-move rules. Merlin (1978) had used a 3 × 3 with a different rule. Tiger Electronics released Lights Out in 1995 and made it a household toy; Lights Out 2000 (1997) / Cube / Deluxe followed. On the math side: Sutner (1989) introduced the σ-game framework with the recurrence and gcd formula — the foundational paper; Anderson & Feil (1998), "Turning Lights Out with Linear Algebra" in Mathematics Magazine, made it an undergraduate-textbook standard; Goldwasser, Klostermeyer, Trapp (1995–1997) gave the domino/monomino tiling characterisation. A specimen of "one toy puzzle, half a century of academic work".
Side by side with the cube: both emerged into popular culture around 1980 from Hungary / the US, both are symmetric, reversible, group-theoretic discrete systems. The single difference is Abelian vs non-Abelian — and that single bit determines whether linear algebra suffices, planting the two puzzles in different complexity classes (P vs NP-hard). Because Lights Out is in P, it lectures cleanly in elementary olympiad and undergrad linear algebra; the cube cannot, because the algorithms it needs are too special-purpose.