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 .
Kravchuk polynomials Created 2026-10-14 Updated 2026-10-18
These polynomials are orthogonal for a binomial distribution weight and encode the coefficient transformation in the MacWilliams identity. Their generating function follows by expanding the two factors:
For binary linear codes, . Expanding the factors gives , where binomial coefficients outside their usual integer range are zero. Orthogonality follows by multiplying generating functions and summing over with weight : the result is , whose coefficient of is zero for and for .
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 is
If , 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 formula
A 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 . Consequently
Under 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 yields
At , 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 is
The coefficient of in the second product is a value of the binary Kravchuk polynomials
These bounds merely enforce and . Since , they agree with the bounds in the PDF. Therefore the requested formula is
For a further check on the low-weight counts, gives
Thus , , 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. Consequently
The unique length- binary word of weight is the all-ones word, exactly as proved by the parity-check matrix calculation.
Use the homogeneous weight enumerator convention
Thus records ones, records zeros, and the ordinary weight enumerator is . For a binary linear code of dimension and its dual code , the MacWilliams identity is
or, 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 enumerator
In one variable this is
For example, gives ; gives . For , the expression is , agreeing with the singleton code. Setting in the homogeneous formula gives , the correct number of codewords.
For any vector , use its Hamming weight . The stated product identity also follows directly by summing each coordinate independently:
For , interchange the two finite sums with . Character orthogonality evaluates the inner sum over codewords, whereas the product identity evaluates the sum over all binary vectors. Thus
Multiply by to obtain the MacWilliams identity in the paper's weight-enumerator convention:
Both sides are polynomials, so equality for extends to as well; the intermediate quotient is not a restriction on the final identity.