This works because our dual code is orthogonal to our space of codewords. And since H forms a basis of our dual code, this technique guarantees our dual space will be orthogonal as well to

This brings us to the generalized definition of a Hamming Code using the concept of a parity check matrix.

Let r be a positive integer and
. Consider any parity check matrix H whose columns are r-tuples, each of which cannot be represented as a scalar multiple of each other. Then the *Hamming code* Ham(r,q) consists of the vectors **c** for which **c**H**0**.

A little linear algebra calculation revolving around sizes of the matrices involved gives , (from the dimension of the solution of the nullspace).

The Hamming code is a perfect 1-error correcting code.

Bill Cherowitzo 2001-12-11