and a message length:
giving a coding rate:
Hamming codes have parity checking matrices the columns of which consist of all the non-zero vectors of length .
Hence for a Hamming code the parity check matrix would be:
Which, (if I have done this correctly!), can give us a generator matrix:
The first three columns form an identity matrix, allowing us to use the first three bits of the received code as the original message.
(One interesting point to note is that we can run this process in reverse to compress data in a lossy form – eg we could compress 7 bits into three bits using this Hamming code, provided we were willing to tolerate the errors/losses.)