We consider the numbers 0, ..., 15 in their binary notation, i.e., sequences of length 4 where each element is either 0 or 1. So
A mistake in reading causes a wrong number to be read. The following can help to prevent this.
We denote any number as a vector in (Z/2Z)7. Such a vector is often written, in short, as a word in the alphabet {0,1}:
The first 4 coordinates form the binary notation of the number. The remaining 3 positions are filled in the following way:
| 0000000 = 0 | 0001101 = 1 | 0010011 = 2 | 0011110 = 3 |
| 0100110 = 4 | 0101011 = 5 | 0110101 = 6 | 0111000 = 7 |
| 1000111 = 8 | 1001010 = 9 | 1010100 = 10 | 1011001 = 11 |
| 1100001 = 12 | 1101100 = 13 | 1110010 = 14 | 1111111 = 15 |
Note that the 16 vectors form indeed a vector space. Caution: the vector space addition in (Z/2Z)7 does not correspond to the addition of the numbers connected to the vectors.
The following property is crucial for its coding capacity: any two vectors differ in at least 3 positions. So if we make at most one reading error, for example, we read 0110111 instead of 0110101, we can still decide that we are dealing with the number 6. Indeed, the vectors for all the other numbers differ in at least 2 positions from 0110111. Therefore, we are able to correct one reading error. We say that the code above for the numbers 0, ..., 15 is a 1-error correcting code.
A complication is that we do not know a priori how many reading errors have been made. If 6 errors are possible, the original could have been any number.