Binary linear code 2026-10-14
A linear code over the two-element finite field. Its dimension gives codewords. Its weight enumerator in the convention is symmetric in exactly when the all-ones word belongs to : adding that word complements every bit and replaces weight by . Conversely symmetry makes the coefficient of equal the coefficient of , which is one.
Hamming code weight enumerator 2026-10-14
Here , and the weight enumerator convention is . The dual code is the binary simplex code, with enumerator . The MacWilliams identity gives the formula. For , the ordinary enumerator is ; for , the degenerate one-word code has enumerator .
For , a codeword in a Hamming code is a subset of the nonzero vectors of whose sum is zero. Ordered weight-three supports of a vector are determined by two distinct nonzero vectors, giving choices. For weight four, the third vector must avoid the three nonzero vectors in the linear span of the first two, giving choices. For weight five, the first three must be linearly independent, and the fourth must avoid all seven nonzero vectors in their linear span, giving choices. The final vector is their sum. Dividing by , , and counts unordered supports of a vector and proves the displayed weight enumerator coefficients.
MacWilliams identity 2026-10-05
For a binary linear code of dimension and its dual code, the weight enumerator convention givesTo prove it, insert into the enumerator sum. Summing independently over each coordinate of yields a factor if and if .
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 30 2 Solution Created 2026-10-03 Updated 2026-10-14
For a binary linear code , define the linear functional . This is the parity of the Hamming weight, so the even-weight subcode of a binary linear code isIf , then . Otherwise its image is all of , and rank-nullity theorem gives . The kernel of a linear map is a linear subspace, proving the required dichotomy including closure under addition.
Let be a full-rank generator matrix. Messages correspond bijectively to codewords . If the th column is nonzero, the coordinate is a nonzero linear functional. Choose with . Translation pairs the messages with coordinate zero and those with coordinate one, so exactly codewords contribute one at position . Summing over the columns proves the total weight of a full-support binary linear code formulaA zero column would contribute zero instead, explaining the hypothesis.
For the Hamming code, use a parity-check matrix whose columns are all nonzero vectors of , once each. Then and . The sum of all columns is zero: each coordinate occurs as one exactly times, which is even for . ConsequentlyUnder this column labelling, the support of a vector of a codeword is identified with a set of distinct nonzero columns whose sum is zero. No one-column or two-column support of a vector has this property, confirming .
We can count the low-weight coefficients of a binary Hamming code directly. For weight three, choose ordered distinct nonzero columns in ways. The third must be , which is nonzero and different from both. Every unordered support of a vector has orderings, so .
For weight four, the first two columns are again distinct and nonzero. The third must avoid , giving possibilities. The fourth is ; it is nonzero because , and cannot equal any of the first three because those are distinct. Conversely every ordered zero-sum four-tuple arises in this way. Dividing by gives .
For weight five, the first three columns must be linearly independent. If , the sum condition would force the fourth and fifth to coincide. Thus there are choices for the first three. Put . The fourth column must avoid all seven nonzero vectors of their linear span: would repeat a column; would force the fifth column to be zero; and would force the fifth column to be , respectively. Conversely, if avoids these seven vectors, is nonzero and distinct from . This gives choices for and determines . Dividing by yieldsAt , the last count is zero, as the argument also shows.
The dual code is the row space of , so its codewords are for . For nonzero , the linear functional takes value one on exactly half the vectors of , by the same translation-pairing argument used above. Removing the zero vector removes only a zero value, so the Hamming weight is still . Since has matrix rank , distinct give distinct codewords. This proves the constant weight of a binary simplex code and its full distribution:In particular, the ordinary weight enumerator of the binary simplex code is .
Apply the MacWilliams identity to this dual code, whose size is . For , the result isThe coefficient of in the second product is a value of the binary Kravchuk polynomialsThese bounds merely enforce and . Since , they agree with the bounds in the PDF. Therefore the requested formula isFor a further check on the low-weight counts, givesThus , , and . Substituting these into the boxed formula and using reproduces the three direct combinatorial counts above.
Finally, at the only possible term in the defining sum has , so , because is even. ConsequentlyThe unique length- binary word of weight is the all-ones word, exactly as proved by the parity-check matrix calculation.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 33 4 b Solution Created 2026-10-03 Updated 2026-10-14
Use the homogeneous weight enumerator conventionThus records ones, records zeros, and the ordinary weight enumerator is . For a binary linear code of dimension and its dual code , the MacWilliams identity isor, equivalently, . The second form applies the first to the dual and uses .
One can verify the variable order directly from the character identity . If is not orthogonal to , translation by a codeword having odd inner product pairs positive and negative terms, giving zero; otherwise all terms are one. After multiplying by and summing over , coordinate contributes when , and when . Their product is exactly the stated substitution.
For a Hamming code with , its dual is the binary simplex code, generated by the rows of the usual parity-check matrix . There are dual words. A nonzero message produces the evaluations as runs over all nonzero vectors of . Exactly of them are one: the nonzero linear functional takes each value equally often on the whole vector space, and removing zero removes a zero value only. This proves the constant weight of a binary simplex code.
Put , so . The dual enumerator is therefore . Applying the MacWilliams identity gives the Hamming code weight enumeratorIn one variable this isFor example, gives ; gives . For , the expression is , agreeing with the singleton code. Setting in the homogeneous formula gives , the correct number of codewords.
Past exam of the mathematics course of the University of Cambridge 2010 ii Paper 2 4H Solution Created 2026-09-24 Updated 2026-10-14
Take the parity-check matrixover . 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
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 3 4G Solution Created 2026-09-24 Updated 2026-10-14
For a binary linear code , its rank is its dimension of a vector space . Use the weight enumerator conventionwhere is the Hamming weight. This convention is essential here: counts words of weight , rather than zero words. There are codewords, so .
There is only one binary word of weight , namely . Thus precisely when . If this holds, the linear map is a bijection of and replaces weight by ; hence . Conversely this symmetry gives , because the zero word is the unique word of weight zero.
The repetition code consists of , givingThe single parity-check code consists of all words of even weight. Exactly words have weight , so the binomial theorem gives
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 1 10G i Solution Created 2026-09-24 Updated 2026-10-05
A linear code of length and rank is a -dimensional linear subspace of . The Hamming weight of a vector counts its nonzero coordinates. Thus the sum of the coefficients of the weight enumerator is the number of codewords:Since the zero vector is the unique word of weight zero, . Symmetry of the enumerator therefore implies . Conversely means that the all-one vector belongs to . Translation is then a bijection of which replaces weight by , proving the polynomial symmetry. For length zero the same conclusion holds with the unique empty vector.
The dual code is , using the standard bilinear form over . If , each summand of the character sum equals one. Otherwise choose with ; replacing by permutes the summands and reverses their sign. The sum equals its own negative and must be zero. ConsequentlyThis is character orthogonality for the additive group of the code.
Single parity-check code 2026-10-14
The code consisting of all even-weight binary words. For its dimension is , and its weight enumerator is , by selecting the even terms of the binomial theorem. The length-one code contains only zero.
Weight enumerator Created 2026-10-05 Updated 2026-10-07
The homogeneous weight enumerator of a length- linear code is the polynomialIts coefficients count words of each Hamming weight. In this convention ; some references interchange .