Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2010/ii/paper-2/4h/solution

Take the parity-check matrix
over . Its columns are all the nonzero vectors of . The Hamming code is . Since has rank three, is a binary linear code of length seven and dimension four. No nonzero codeword has weight one or two, since no column is zero and no two columns coincide. Columns give a codeword of weight three, so has parameters .
For a received vector , its syndrome is . A single error in position gives exactly column of , so the syndrome identifies that position uniquely; zero syndrome means no error under the one-error assumption. The radius-one Hamming balls around the codewords are disjoint and have total size , so this is also a perfect code.
There are weight-three codewords: every pair of columns determines the third, and each triple is counted three times. The all-ones vector is a codeword because the column sum is zero, so complementation gives seven weight-four codewords. Together with zero and the all-ones vector these account for all sixteen. The weight enumerator is therefore

New to topics? Read the docs here!