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 cH0.
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.