Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2018/ia/paper-4/6e/solution

The Hamming distance satisfies the triangle inequality coordinate by coordinate: if , then or . Summing these indicator inequalities proves the claim. A word at distance exactly from is obtained by choosing the coordinates to flip, so
For a -code, radius- balls about codewords are disjoint, giving . Conversely, take a maximal code of minimum distance . Its radius- balls cover , since an uncovered word could otherwise be added, so . Maximizing gives the requested coding bounds.
For , translate a codeword to . Every other word has weight at least three, but any two distinct length-four words of weight at least three have distance at most two. Thus at most one can accompany , while works. Hence .

New to topics? Read the docs here!