The encoding that we will consider here takes a block and produces a code word of length 6. As in the triple repetition code, each code word will differ from each other code word by at least three bits. As a result, any single error will not push a code word close enough to another code word to cause confusion. Now for the details.
Let
We call the generator matrix for the code, and let be our message. Define by
where
Notice that since matrix multiplication is distributive over addition, we have
for all This equality, may look familiar from the definition of an isomorphism, but in this case the function is not onto. If youโve read about homomorphisms, this is indeed an example of one.
One way to see that any two distinct code words have a distance from one another of at least 3 is to consider the images of any two distinct messages. If and are distinct elements of then has at least one coordinate equal to 1. Now consider the difference between and
Whether has 1, 2, or 3 ones, must have at least three ones. This can be seen by considering the three cases separately. For example, if has a single one, two of the parity bits are also 1. Therefore, and differ in at least three bits. By the same logic as with triple repetition, a single bit error in any code word produces an element of the code space that is contained in on of the balls of radius 1 centered about a code word.
Now consider the problem of decoding received transmissions. Imagine that a code word, is transmitted, and is received. At the receiving end, we know the formula for and if no error has occurred in transmission,
The three equations on the right are called parity-check equations. If any of them are not true, an error has occurred. This error checking can be described in matrix form.
The matrix is called the parity-check matrix for this code. Now define by We call the syndrome of the received block. For example, and
Note that has a similar property as that If the syndrome of a block is we can be almost certain that the message block is
Next we turn to the method of correcting errors. Despite the fact that there are only eight code words, one for each three-bit block value, the set of possible received blocks is with 64 elements. Suppose that is not a code word, but that it differs from a code word by exactly one bit. In other words, it is the result of a single error in transmission. Suppose that is the code word that is closest to and that they differ in the first bit. Then and
This is the first row of
Note that we havenโt specified or only that they differ in the first bit. Therefore, if is received, there was probably an error in the first bit and the transmitted code word was probably and the message block was The same analysis can be done if and differ in any of the other five bits.
In general, if the syndrome of a received string of bits is the th row of the parity check matrix, the error has occurred in the th bit.