Block code 2026-10-14
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 33 3 Solution Created 2026-10-03 Updated 2026-10-14
A binary block code of length is a nonempty subset . Its size is , the number of distinct codewords. The Hamming distance counts coordinates at which two words differ. The code's minimum Hamming distance is when there are at least two words. No pairwise minimum exists for a singleton code; it can be assigned as a convention when needed.
A binary linear code is a vector subspace of . If its dimension is , a generator matrix has a basis of as its rows, givingTo match the coordinate-row convention, take a parity-check matrix of size , with independent columns, and defineThe transpose is the usual parity-check matrix with one column per coordinate. By rank-nullity theorem, the displayed kernel has dimension . The two constructions agree when : the generator's row space lies in the parity-check kernel and has the same dimension, hence equals it. Conversely, for a given , choose the columns of as a basis of its dual code ; orthogonality and the dimension formula give exactly as the kernel.
For a nonzero linear code, is a nonzero codeword whenever are distinct codewords, and . Conversely compare any nonzero codeword with zero. Thus the minimum Hamming distance of a linear code is the least nonzero Hamming weight.
Write for the row associated with coordinate . A nonzero binary vector is a codeword exactly whenIts nonzero coordinate positions therefore index a linearly dependent set of rows. Conversely, a dependence among a set of rows has coefficients in , not all zero; putting these coefficients in the corresponding coordinates gives a nonzero codeword of weight no greater than the number of rows in that set. Taking minima in both directions proves the parity-check dependencies determine minimum distance criterion:Rows here are indexed by positions: equal row vectors at different positions are two distinct members of the indexed family. In the usual matrix convention, the same result refers to columns of . For the zero code, neither a nonzero codeword nor a dependent coordinate set exists, so both minima can consistently be interpreted as .
For the Hamming code, let , set , and let the rows of be all nonzero vectors of , each once. These rows include the standard basis, so has rank and the code has dimension and size . There is no dependence involving one row, because no row is zero, or two rows, because no rows are equal. For , any two distinct nonzero vectors have a distinct nonzero sum , which is another row. These three rows sum to zero. Thus for .
The perfectness of a Hamming code also has a direct decoding proof. Given any received word , its syndrome is . A zero syndrome means . Otherwise it equals exactly one row . The vector then has syndrome zero and is the unique codeword obtainable by changing one coordinate. There is no other codeword at distance at most one: its necessary correction would have to have the same syndrome, and among zero and all single-coordinate errors the syndromes are precisely the distinct vectors of . Therefore the radius-one Hamming balls about codewords partition .
Equivalently, each ball contains words; disjointness and show that none are uncovered. Hence every nondegenerate binary Hamming code is a perfect single-error-correcting code. For , the construction is the singleton code , whose one radius-one ball is also the whole ambient space. This deals with the degenerate boundary without falsely claiming its minimum distance is three.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 33 4 a Solution Created 2026-10-03 Updated 2026-10-14
Let the distinct codewords be . No linearity assumption is needed. Sum their Hamming distances over unordered distinct pairs:Each summand is at least the minimum Hamming distance , so .
For coordinate , let be the number of codewords whose th bit is . Exactly unordered pairs differ at that coordinate. Summing coordinate contributions givessince . Combining the two bounds and dividing by gives , hence . Under , division is legitimate, proving the Plotkin boundBecause is an integer, it also satisfies the floor of the right-hand side. The binary alphabet is essential to the coordinate count; this proof applies to arbitrary binary block codes, not just linear ones.
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 4G Solution Created 2026-09-24 Updated 2026-10-14
A binary block code is a subset ; its length is the common word length , its size is , and its minimum distance is the least Hamming distance between distinct words. There are words in a radius- Hamming ball, since one chooses the positions to change.
Put . Two radius- Hamming balls about different codewords cannot meet: otherwise the triangle inequality would make their centres at distance at most . Comparing their combined size with gives the Hamming boundFor the other direction, start with one word and repeatedly add any word at distance at least from every word already selected. Finiteness ensures that this process stops. At that point the radius- Hamming balls cover the entire cube; an uncovered word could otherwise be added. These balls may overlap, but their total size is at least . This gives the Gilbert–Varshamov bound
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 1 11I a i Solution Created 2026-09-24 Updated 2026-09-29
A binary block code of length is a subset . Its size is , and its minimum Hamming distance isThus an code consists of binary words of length whose distinct pairs differ in at least coordinates. When , every set of distinct words qualifies. Taking all of the binary vector space gives words, and no code can contain more words than its ambient space. Hence
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 1 3K i Solution Created 2026-09-24 Updated 2026-09-25
For a binary block code, is the common length of its codewords, is the number of codewords, andis its minimum Hamming distance.
The parity extension isEvery extended word has even Hamming weight. The distance between two words increases by one exactly when their original distance is odd, so