
Hacker News
July 20, 20266 min read
Share Week 03 of my learning series on Turing Award winners: Richard Hamming.
Richard Hamming, a mathematician, was trying to do what all of us do today. Submit a bunch of jobs Friday evening, expect the machine to keep running all weekend, and have stuff ready Monday morning.
It wasn’t as smooth for him. He’d come back with nothing done, because random bits were flipping mid-run, corrupting the computation and stopping it cold.
He decided the data could carry enough extra information to fix itself. A few extra bits added to whatever you’re transmitting is all it takes, and if a bit flips in transit, those bits tell you exactly which one flipped so you can fix it without retransmitting or restarting. This is now the foundation of everything we do. Think about RAM, SSDs, hard disks, QR codes, even deep space telemetry. Most error-correcting codes today trace back to this one 1950 paper.
Bit flipping happens way more than you’d expect. RAM is the worst case. Google published a study showing a typical server sees one to two bit flips a day in memory, and a data center has hundreds of thousands of machines with bits flipping constantly. Without error correction, servers silently compute the wrong answers. It would feel like the servers are hallucinating and giving you wrong answers.
The Mag-7, the hyperscalers, the H100 clusters training the next frontier model, they all run on hardware that self-corrects at the bit level, all because of Hamming’s work in 1950.
Richard Hamming won the Turing Award in 1968 “for his work on numerical methods, automatic coding systems, and error-detecting and error-correcting codes.”
The error-correcting code is what changed everything.
In the 1940s, computers at Bell Labs ran on punched cards and electromechanical relays. They were unreliable. Bits would flip. A calculation that ran overnight would finish with a wrong answer, and you’d have no idea where the error crept in.
Hamming worked weekdays. The machine ran his jobs on nights and weekends. Every error cost him a full week of waiting.
He spent his weekends furious about this.
Before Hamming, error detection existed. A single parity bit appended to a byte can tell you that some bit flipped, but not which one. To correct an error you need to know its location.
Hamming’s idea: add a few extra bits whose values are determined by the data bits. These “parity bits” are placed at specific positions so that any single flipped bit disturbs a unique combination of them.
The receiver checks all the parity bits and computes a number called the syndrome .
If it’s nonzero, the syndrome is literally the position of the bad bit. Flip it back. Done.
4 data bits become 7 bits total. Three parity bits buy you full single-error correction.
Step 2: Positions that are powers of 2 get parity bits. Everything else gets data.
position: 1 2 3 4 5 6 7 type: p1 p2 d1 p4 d2 d3 d4 bit: ? ? 1 ? 0 1 1 Step 3: Each parity bit covers specific positions based on binary representation.
Each parity bit is set so its group XORs to zero:
p1: 1 XOR 0 XOR 1 = 0 → p1 = 0 p2: 1 XOR 1 XOR 1 = 1 → p2 = 1 p4: 0 XOR 1 XOR 1 = 0 → p4 = 0 Final codeword: 0110011
Step 4: Transmit it. A bit flips. Position 5 changes from 0 to 1 .
sent: 0 1 1 0 0 1 1 received: 0 1 1 0 1 1 1 ↑ bit flipped
Step 5: Receiver recomputes all three groups:
p1 checks 1,3,5,7: 0 XOR 1 XOR 1 XOR 1 = 1 ✗ broken p2 checks 2,3,6,7: 1 XOR 1 XOR 1 XOR 1 = 0 ✓ fine p4 checks 4,5,6,7: 0 XOR 1 XOR 1 XOR 1 = 1 ✗ broken Stack the results: p4=1, p2=0, p1=1 → binary 101 → 5
The syndrome points directly to position 5. Flip it back. Extract data: 1011 ✓
No retransmit. No restart. The data fixed itself.
ECC Memory: Every server in every data center. RAM modules have extra chips that store Hamming parity bits. When a cosmic ray flips a bit, the memory controller computes the syndrome and corrects it silently.
QR Codes: Reed-Solomon error correction, a descendant of Hamming codes. You can scratch off 30% of a QR code and it still scans.
Hard Disks and SSDs: Every sector has error-correcting codes. Bits rot. Controllers fix them.
Deep Space: Voyager uses Reed-Solomon codes over GF(2⁸). It’s 15 billion miles away and still sending data through a 20-watt transmitter. Error correction makes that possible.
5G and Wi-Fi 6: LDPC codes (low-density parity-check), which trace their lineage to Hamming’s insight.
All of them use the same core idea: extra bits, placed carefully, that locate errors algebraically.
Encode any ASCII string into Hamming codewords
Inject single-bit errors at random positions
Auto-correct every injected error, no retransmit needed
> Hello world encoded: 11 bytes → 154 transmitted bits injected error: char 2 (hi nibble) bit 3 injected error: char 5 (lo nibble) bit 6 injected error: char 9 (hi nibble) bit 1 recovered: "Hello world" (3 error(s) auto-corrected) result: perfect match
With --verbose , each decode step shows the syndrome computation:
char 2: syndrome bits: s1=1 s2=1 s4=0 → 3 error at position 3, flipping decoded: hi=[1,1,0,0] lo=[0,0,0,0] byte=0x6C The syndrome is a binary number that names the bad position directly. That’s the invention.
Full code and worked example on GitHub: github.com/nirmal91/turing-award-series
Before Hamming, a flipped bit meant failure. Retransmit. Restart. Hope it doesn’t happen again.
After Hamming, a flipped bit is a number. Find it. Fix it. Move on.
That shift — from detection to correction, from “something’s wrong” to “position 5 is wrong” — is what made reliable computing possible.
RAM flips bits constantly. Cosmic rays. Alpha particles from chip packaging. Just random quantum noise. Without error correction, servers would hallucinate. Databases would corrupt. Training runs would diverge.
Hamming didn’t just build a better parity check. He proved that data could carry the instructions for its own repair. That the mathematics of geometry — Hamming distance, spheres on hypercubes — could locate errors in real hardware.
Every H100 in every cluster training the next frontier model has ECC memory correcting bit flips in real time. Every QR code you scan has Reed-Solomon correction letting you read it through scratches and smudges.
Hamming got mad at a machine that wasted his weekends. He wrote the mathematics to make it stop. And we’ve been building on that mathematics for 75 years.
This is Week 03 of the Turing Award Series. New entry every week. All code is on GitHub .
Read what's here, then head to the original whenever you're ready - never required.
Continue Reading on Hacker NewsMeasuring What Matters with Jules
Google Developers July 21, 2026