Hamming code weight enumerator (source code)

= Hamming code weight enumerator
{c}
{title2=$W_C(s,t)=2^{-l}\bigl((s+t)^N+(2^l-1)(t-s)^m(t+s)^{m-1}\bigr)$}

Here $N=2^l-1$, $m=2^{l-1}$ and the <weight enumerator> convention is $W_C(s,t)=\sum_{c\in C}s^{\operatorname{wt}(c)}t^{N-\operatorname{wt}(c)}$. The <dual code> is the <binary simplex code>, with enumerator $t^N+(2^l-1)s^m t^{m-1}$. The <MacWilliams identity> gives the formula. For $l=3$, the ordinary enumerator $W_C(z,1)$ is $1+7z^3+7z^4+z^7$; for $l=1$, the degenerate one-word code has enumerator $t$.