A code that corrects its own errors: pack 4 data bits with 3 parity bits so that if any one of the 7 flips, three parity checks spell out — in binary — exactly which bit went wrong. Born of a man’s fury at a machine that crashed every weekend. And it runs in real I-13, on the very bitwise operators this campaign asked for.
THE TECHNIQUE three parity checks locate one flip
Bits sit in positions 1–7. Parity bits at the powers of two (1, 2, 4) each cover a set of positions. Flip any single bit and click it — the three checks read out its position in binary. live demo
click a bit to flip it — watch the syndrome find it
HISTORY & CREDIT invented in anger, on a weekend
Not a cool abstract result — a working engineer, calmly theorizing, actually furious at a machine. cited
1947–49 · Richard Hamming at Bell Labs runs jobs on a relay computer over the weekend, unattended. It hits an error, dumps the job, and wastes the whole weekend. Twice in a row. “Damn it, if the machine can detect an error, why can’t it locate the position and correct it?” — so he set out to make it. 1950 · he publishes Error detecting and error correcting codes; the (7,4) code and the Hamming distance are born — the start of coding theory. note · the paper was delayed by a Bell patent filing; Hamming was annoyed by that too.
Every QR code, every RAM ECC, every deep-space transmission descends from a man who refused to lose another weekend. foundational
RECOMMEND FOR I-13 the bitwise ask, powering error correction
The whole scheme is XOR parity and bit extraction — the exact operators darts 001 and 029 asked for and that were integrated. Now it runs:
$ i13 run hamming.i13 # bitwise on main
p_ok = 0 # 1010101 -> even parity, clean
p_err = 1 # 1010111 -> odd parity, a bit flipped
Recommend:nothing new — a no-wall, and a payoff. The bitwise operators the darts converged on (001 fast-inverse-sqrt, 029 Nim) do not just enable a game and a hack; they carry real error-correcting codes. This is the recommend loop paying a dividend: an ask, integrated, now doing load-bearing work. Honest note: a general Hamming(n,k) over long messages would want a bit-array, the recurring aggregate wall — but the (7,4) core, the thing that made coding theory, runs on the counted 13 symbols plus the merged bitwise.