How computers fix their own mistakes
A flipped bit can turn one letter into another. See what a noisy wire does, say it three times, add a check bit and find the bad bit with three circles.
Key takeaways
- Bits get flipped by noise and scratches. Computers send extra bits so the receiver can notice and often fix the damage.
- Sending each bit three times and voting turns an error chance of p into 3p² minus 2p³, at three times the cost.
- One parity bit detects a single flip but cannot say which bit it was, and misses two flips.
- The Hamming code uses three checks for four message bits. The failed checks spell out the place of the flipped bit. It fixes any single flip and fails on two.
- Real codes are stronger. A QR code can lose 7 to 30 per cent of its data and still be read, depending on the setting.
Sources
Some of these sites could not be opened while this page was written, so some facts were checked through search results that quote them. Hamming’s code published in 1950 and the story of the relay machine that moved on after errors at weekends, the (7,4) shape, the failed checks pointing at the position of the bad bit, Shannon’s theorem of 1948, the vote of three copies failing with chance 3p² minus 2p³, and the four QR code levels of 7, 15, 25 and 30 per cent each appeared in at least two places. Sources differ on whether the machine read punched tape or punched cards, so the page does not say. The page does not say how much of a disc or a QR code real scratches destroy. The sums for the noisy wire, the vote and the circles are exact and are computed on the page. The parity bit facts are standard coding theory.
- Wikipedia: Hamming codeThe code, its history and the (7,4) form.
- IEEE Computer Society: Richard HammingHamming and Bell Labs.
- Quantum Zeitgeist: Richard HammingThe weekend relay machine story.
- Wikipedia: noisy channel coding theoremShannon’s limit.
- MIT: notes on noisy codingRepetition codes and their cost.
- LibreTexts: repetition codesThe chance that a vote of three fails.
- CircuitBread: repetition codesThe same sum, worked in another way.
- DevExpress: QR code error correction levelsThe four levels of 7, 15, 25 and 30 per cent.
- Aspose: QR error levelsThe same four levels.