Constant weight of a binary simplex code 2026-10-14
When the columns of are every nonzero vector in , a nonzero row vector defines a nonzero linear functional . Exactly half the input vectors take value : translation by any vector on which the functional is pairs its zero and one fibres. Removing the zero input removes only a zero value. Thus every nonzero word in the binary simplex code has Hamming weight .
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 .
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 2017 ii Paper 3 3G Solution Created 2026-09-24 Updated 2026-10-05
Identify a binary word with its coefficient polynomial in . A cyclic code is exactly an ideal of : closure under multiplication by is closure under cyclic shift. Its inverse image in the principal ideal domain has a unique monic generator polynomial of a cyclic code dividing . PutThe cubics have no root in , hence are irreducible polynomials. The eight monic divisors yield all binary cyclic codes of length seven. A code generated by has basis and dimension , with the zero code treated separately.
For the dual of a cyclic code, let . Orthogonality of coefficient vectors to all cyclic shifts gives the generator . Here . Thus the complete pairing, with the respective dimensions, isThese are respectively the whole-space/zero, even-weight/repetition, and two Hamming code/binary simplex code pairs. The reciprocal formula follows because the product of a word polynomial and the reversed polynomial of an orthogonal word has zero coefficients in all cyclic positions; the resulting inclusion has the correct complementary dimension, hence is equality.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 2 3G Solution Created 2026-09-24 Updated 2026-10-03
Let and let be the parity-check matrix whose columns are the distinct nonzero vectors of the finite field vector space . The binary Hamming code isA perfect code has Hamming balls of radius about its codewords partitioning the whole ambient space, where is its minimum Hamming distance of a linear code.
No column of is zero and no two columns agree, so has no word of Hamming weight one or two. Three suitable columns sum to zero, so . For any received word , its syndrome is either zero or is the unique column of equal to that syndrome. In the first case ; in the second,so is at Hamming distance one from a codeword. Uniqueness follows from . Thus the radius-one balls partition , and the code is perfect.
For , the dual code is the binary simplex code of length seven. Every nonzero dual word evaluates a nonzero linear functional on the seven nonzero vectors of , and exactly four of those evaluations are one. Hence every nonzero word of has weight