Break one bit.
Three checks can bring it back.
Send four bits of information using seven bits. Even if one bit flips on the way, the receiver can find it and recover the message. Try breaking the transmission.
Each check wants an even number of 1s. Click a check to see the positions it watches. A failed check contributes its label to the total.
Your original messageTap a digit to change it. The three check bits update automatically.
01 / The trick is the overlap
One check only says
“something changed.”
Three can say where.
Positions 1, 2 and 4 hold check bits. The other four hold your message. The sender sets each check bit so its group contains an even number of 1s.
A single flip makes exactly the checks watching that position fail. Every position has its own combination. Add the failed check labels to find it.
Top: bit position. Below: checks that watch it. Three yes/no clues have 2³ = 8 possible patterns: seven error positions, plus “no error.” The check pattern is called a syndrome.
02 / Now break the promise
Two errors can make a confident decoder wrong.
That repair rule assumes at most one flipped bit. Choose two positions below and watch it “repair” a third, creating a different valid message.
One more bit can make the total number of 1s even across all eight positions. It gives the receiver a second kind of clue.
The extended eight-bit code can correct one error and flag two, assuming at most two errors. More errors can still fool it. Redundancy has a budget.
03 / Every message, every position
All 16 possible messages survive either no error or a flip in any one of the seven positions. This is an exhaustive calculation, not a random sample.
Open the full proof grid. Select a cell to replay that case.
| Message | None | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|
✓ = original four bits recovered. 16 clean cases + 112 single-flip cases. The code also has 336 distinct two-flip cases: with the seven-bit repair rule, all 336 decode to the wrong message.
Why the code can do this, and how to reproduce it
Any two valid seven-bit codewords differ in at least three positions. The 16 valid words, each with its seven one-flip neighbors, partition all 2⁷ = 128 possible received words. A receiver can choose the unique valid word within one flip, but cannot tell whether the sender actually started two flips away.
Put message bits into positions 3, 5, 6, 7. Set bit 1 to the XOR of bits 3, 5, 7; bit 2 to the XOR of 3, 6, 7; and bit 4 to the XOR of 5, 6, 7. XOR is 1 when an odd number of its inputs are 1. Recheck groups {1,3,5,7}, {2,3,6,7}, {4,5,6,7}. Add the labels of odd groups. If the sum is nonzero, flip that position.
04 / Be the receiver
Find the error without seeing the original.
Five transmissions. Each has at most one error. Read the checks, choose the position to flip, or choose 0 for no error.
Which position should the receiver flip?
Sources / classical bits, current question
Error correction is in the news: Quantinuum reported a quantum error-correction result on 19 October 2026. This lesson uses ordinary binary bits to make the idea tangible. It does not simulate quantum hardware or its error rates.
The code originates in R. W. Hamming, “Error Detecting and Error Correcting Codes,” Bell System Technical Journal, April 1950. Carnegie Mellon's lecture on Hamming(7,4) provides an introduction. All cases and totals here are calculated from the stated code, not measured error rates.