Problem 5
A regular array of lights is defective: toggling the switch for one light causes each adjacent light in the same row and in the same column, as well as the light itself, to change state. Initially all lights are off. After some toggles, exactly one light is on. Find all possible positions of this light.
Step 1 of 6: Choose the first labels
Detailed analysis
Label the cells by the 0–1 matrix . Define the first value of a lighting state as the sum of labels at its on cells, considered modulo 2. For every cell, the labels on the local cross consisting of it and its adjacent same-row or same-column cells sum to an even number, so this parity is invariant.