Thought Toys · Strategy & computation · Exhibit 56
Flip one bit anywhere in a 7-bit codeword and this trick finds it and fixes it — no hesitation, no ambiguity. Flip a second bit, though, and it just as confidently "fixes" something. Just not the right thing — and it hands back a message that looks every bit as legitimate as the real one.
Bit positions 1–7, sent · received · corrected parity data flipped by noise changed by decoder
—
—
Four bits of real message ride inside a 7-bit codeword, padded out with three parity bits — each parity bit a running XOR of a different, overlapping subset of the other positions. Send it down a noisy line, and the receiver recomputes those three checks on whatever actually arrived. Read together, the three checks form a number from 0 to 7: the syndrome. Flip zero bits and the syndrome comes back exactly 0. Flip exactly one, anywhere in the seven, and the syndrome comes back as exactly that bit's position — not "there's an error somewhere," but "it's this one, right here." Flip it back and the original 4 data bits are sitting there again, untouched.
Now push the noise slider to 2. The syndrome still comes back as some confident number between 1 and 7 — the decoder never shrugs. But that number is now, provably, the wrong position: fixing it doesn't undo the damage, it adds a third change on top of the two real ones, landing on a completely different 4-bit message that looks exactly as legitimate as the one that was actually sent. There is no warning light. The only way to know something went wrong is to already know what the message was supposed to be — which, out in the real world, is exactly the one thing you never have.
improve/verify/56-hamming.js): across every one of the 16
possible messages, all 128 zero-or-one-bit-flip cases recover the exact original data, the minimum distance
between any two codewords is exactly 3, and all 336 possible two-bit-flip cases decode to a different,
wrong message — 0 accidental matches. Counter-example: a decoder that simply refused to
"correct" anything at all would at least be honest about a 2-bit error — instead, every real Hamming
decoder reports full confidence on both an already-correct answer and a silently wrong one, using the
identical code path; that is precisely why systems that must survive 2-bit errors add one more overall
parity bit (SECDED) — upgrading "silently wrong" to "detected, but no longer fixable."
Also in Strategy & computation: Why more processors stop helping →
← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 56.