Repetition and Parity
The two oldest tricks for beating noise: say everything several times and let the copies vote, or add a single check bit that notices when something went wrong. Both work. Both have a price. Measuring that price is how we learn to do better.
Radio operators spell words with "Alpha, Bravo, Charlie" instead of "A, B, C". The long words are redundancy on purpose: "B", "D", "E" and "P" blur together through static, while "Bravo", "Delta", "Echo" and "Papa" are hard to confuse. When a message is really important, operators also read it back. Both habits spend extra time on the air to buy reliability.
Chapter 8 left us with a plan: compress away the redundancy you did not choose, then add back redundancy you did choose, designed to fight noise. This chapter tries the two simplest designs on the binary symmetric channel and measures what each one buys and what it costs.
Say it three times
The bluntest design is the repetition code: send every bit n times (n odd), and let the receiver take a majority vote. With three copies, one flip among the three is outvoted; it takes two flips in the same triple to fool the receiver. If one bit in a hundred flips (p = 1%), the chance of two or three flips in a triple is about 3 in 10,000. Errors fall by a factor of about 30.
The price is the rate: the fraction of transmitted bits that carry new data. Sending every bit three times has rate 1/3; the same message takes three times as long. Explore the trade below.
Repetition can make errors as rare as you like, but only by sending the rate toward zero.
One bit that notices
A much cheaper idea: add one extra bit to each block so that the total number of 1s is always even. This parity bit costs one bit per block: with 7 data bits, the rate is 7/8, far better than 1/3. If any single bit flips on the way, the count of 1s becomes odd, and the receiver knows something went wrong.
Detection alone is still valuable. When the receiver can talk back, it can simply ask for the block again. Much of the internet works this way: data travels in packets with check values, and damaged packets are re-sent. But a deep-space probe, a disc, or a memory chip has no one to ask. For those, the receiver must locate and fix errors on its own.
Locating an error with a grid
Here is a neat way to turn detection into location. Lay 16 data bits out in a 4 × 4 grid. Add a parity bit to every row and every column (and one in the corner to check the checks), so that every row and every column of the full 5 × 5 grid has an even number of 1s. Now a single flipped bit makes exactly one row and one column fail. They cross at the culprit.
The grid fixes any single error with 9 check bits for 16 data bits, far cheaper than tripling everything. But it is not the cleverest possible design. Each check bit answers a yes-or-no question ("is there an error in this row?"). With 16 data bits and 5 check bits there would be 21 places an error could hide, plus "no error at all": 22 situations to tell apart. Five well-chosen yes-or-no answers give 25 = 32 possible replies, enough to name every one of them. So 5 check bits could in principle do the job of the grid's 9, for fixing single errors. (The grid also notices every double error, which takes one more check bit, as Chapter 10 shows.) Chapter 1's twenty-questions logic, applied to errors! Richard Hamming found codes that achieve exactly that, and they are the subject of the next chapter.
A parity check detects; crossing several parity checks locates; and in binary, locating is correcting, because a wrong bit has only one other value it could be.
A received block passes its parity check. What can you conclude?
At p = 10%, the 25-copy repetition code makes decoded errors astronomically rare. Why is it still a poor answer to noise?
Connections
- Cybernetics, Chapter 4 lets you outvote noise with 3× and 5× repetition; here you see the full trade curve behind it.
- Computer Science, Chapter 11: Passing Notes Across Earth shows networks that detect damaged packets and send them again.
- Probability, Chapter 5: Branching Paths builds the counting behind "two flips out of three".
What you now see
- The rate of a code is the fraction of sent bits that carry new data.
- Repetition with majority vote cuts errors steeply, but driving errors toward zero drives the rate toward zero too.
- A single parity bit detects any odd number of flips at a tiny cost, misses even numbers, and cannot locate.
- Crossing row and column parities locates, and therefore fixes, any single error; two errors are detected but not located.
- Naming one position among N needs only about log₂ N yes-or-no checks: the grid uses more check bits than necessary.