The Exercise
A string of bits sent through a noisy channel may arrive with some of its bits flipped. A binary linear code guards against this by admitting only the strings that pass a fixed set of parity checks, each check a sum of chosen bits modulo that must vanish. The Hamming code with checks labels each bit position by a nonzero string of bits, using every such string once, and its th check adds the bits whose label has a in place . The exercise asks for the length of this code, the number of bits in a codeword, for its dimension over and its minimum distance, and whether it corrects a flip of any single bit.
Linear Codes
A linear code over a field is a subspace of the strings with one entry from at each of its positions. The Hamming weight of a string is the number of its nonzero entries. The minimum distance of a linear code is the least Hamming weight of a nonzero codeword, (1)✦ and is infinite for the zero code, which has no nonzero codeword. A linear code corrects errors when .✦
The Hamming Code
Fix a natural number and let be the set of nonzero strings in ; these label the positions of the code. The Hamming parity check matrix is the matrix over whose column at position is the string itself: (2)✦ The Hamming code is the binary linear code with parity check matrix .✦ Its codewords are the strings with one bit at each position that pass all checks: (3)✦
The Claim
Theorem 1. For every natural number , the Hamming code has length (4)✦ and dimension over (5)✦ Let moreover . Then the minimum distance of is (6)✦ and corrects one error: (7)✦
What Is Checked
The claim is stated over the Hamming code of (3), built on the parity check matrix of (2), and over the minimum distance (1) of a linear code with the correction of errors defined from it. What the library proves about these constructions is the theorem above, all four of its parts.