A binary Hamming code
of length
(with
) is a linear code
with parity-check matrix
whose columns consist of all nonzero
binary vectors of length
,
each used once (Hamming 1950, MacWilliams and Sloane 1977).
is an
code. Hamming codes are perfect
single error-correcting codes.
If is a received row
vector, its syndrome is
,
with arithmetic in the two-element finite field.
A single error in position
adds the
th standard basis vector to
the transmitted codeword, so the syndrome
is column
of
. The decoder identifies that column and flips bit
. Under the assumption of at most one error, a zero
syndrome means that no bit was flipped (Hamming
1950, 3Blue1Brown 2020).
For , the family gives the Hamming
(7,4) code, which has parameters
.
The chessboard coin puzzle uses the same column-sum operation to send a chosen syndrome. It adds a zero column so a mandatory flip can leave that value unchanged.