Weight enumerators of repetition and single-parity-check codes #
The repetition code consists of constant words, and the single-parity-check code consists of words whose coordinate sum is zero. They are Euclidean duals. Their homogeneous weight enumerators give explicit examples of the MacWilliams transform, alongside the zero code and the whole word space.
For a coordinate type of cardinality n over a finite alphabet with q letters, the
positive-length repetition enumerator is X^n + (q - 1) Y^n, and the parity-check enumerator
satisfies q W(X,Y) = (X + (q - 1) Y)^n + (q - 1) (X - Y)^n over the integers at every length.
The nonempty hypothesis for the repetition formula matters: at length zero the repetition code
has one word, rather than q words.
Together, the repetition and parity-check enumerators give an independent check of the
MacWilliams identity. More generally, over a finite additive group A with q elements,
the words with coordinate sum a have enumerator
q W(X,Y) = (X + (q - 1) Y)^n + (q - 1) (X - Y)^n if a = 0,
q W(X,Y) = (X + (q - 1) Y)^n - (X - Y)^n if a ≠ 0.
References #
W. C. Huffman and V. Pless, Fundamentals of Error-Correcting Codes, Cambridge University Press (2003), §§1.2–1.4 and §7.2.
The positive-length repetition code has enumerator X^n + (q - 1) Y^n.
The weight enumerator of a coset of the parity-check code. Over a finite additive group
with q elements, the words of length n with coordinate sum a have enumerator W with
q W(X,Y) = (X + (q - 1) Y)^n + (q - 1) (X - Y)^n when a = 0, and
q W(X,Y) = (X + (q - 1) Y)^n - (X - Y)^n otherwise.
The integral weight-enumerator formula for a single-parity-check code at any length.