Scratch a CD and it still plays. Smudge a QR code and it still scans. Voyager 1's photographs crossed billions of kilometers of static-filled space on a transmitter using far less power than a light bulb, and arrived intact. None of this is luck. It's a family of mathematical tricks called error-correcting codes, and the core idea is something you already do every time you read a typo: send enough structure that the receiver can figure out what you meant, even when part of what you said got mangled.
This article is part of a cluster on information and bits; the foundation — Shannon's discovery that information is a measurable quantity and that noisy channels have exact, provable limits — is in what information really is. Here we look at the machinery that lets real messages hit those limits.
You already own an error corrector
Read this: "tge cat sat on tge mat."
You fixed it instantly. How? Because English is redundant — not every string of letters is a word. "Tge" isn't legal, and there's exactly one legal word a single letter-swap away. Your brain snapped the corrupted word back to the nearest valid one without asking you.
That's the entire concept. Declare only some messages valid. Space the valid ones far apart. When noise nudges a message, snap it back to the nearest valid one. Everything else is engineering.
Step one: noticing errors — parity
The simplest scheme can't fix anything, only raise an alarm. Take 7 bits of data and append one parity bit, chosen so the total number of 1s is even. The receiver counts 1s: an odd count means some bit flipped in transit, so ask for a resend.
Cheap and useful, but weak. It can't tell you which bit flipped, and if two bits flip, the count is even again and the damage sails through undetected. To do better, we need to think geometrically.
The key picture: distance between codewords
Imagine every possible n-bit message as a point in space, where the distance between two messages is the number of positions where they differ (called Hamming distance, after Richard Hamming of Bell Labs). Noise moves a message: each flipped bit is one step to a neighboring point.
Now the design principle: don't allow all points to be valid messages. Choose a sparse subset — the codewords — spaced at least distance d apart, and agree that only these will ever be sent.
If your codewords are at least 3 apart, then a single bit-flip leaves the received message at distance 1 from the true codeword but at least distance 2 from every other. The nearest valid codeword is unambiguous: snap to it and you've corrected the error. Codewords 5 apart let you fix any two flips; 7 apart, any three. A code adds distance between valid messages, so noise has to be big to carry one all the way into another's territory. That single sentence is the whole subject.
The price is redundancy: to keep codewords far apart, most bit-patterns must be sacrificed as "illegal," so you transmit more bits than the raw message needs. Notice the pleasing symmetry with compression, which strips redundancy out: compression removes nature's accidental redundancy, then coding adds back engineered redundancy that's shaped exactly to the channel's noise. Your phone does both to everything it sends, in that order.
Hamming (7,4): fixing errors with pointing fingers
In the 1940s Hamming got tired of Bell Labs computers halting entire weekend runs whenever a relay error was detected but couldn't be fixed. His fix, the Hamming (7,4) code, protects 4 data bits with 3 added check bits — 7 sent in all.
The elegance is in what the checks say. Each check bit is a parity bit over a particular, overlapping subset of positions. On arrival, the receiver tests all three checks. Each test passes or fails, giving a 3-bit pass/fail pattern — and the subsets are arranged so this pattern spells out, in binary, the position of the flipped bit. Pattern 000: all clear. Pattern 101: bit five is wrong — flip it back, done. Three questions, each narrowing the suspect list by half, exactly the yes/no-question logic that defines the bit itself.
One flipped bit in seven, found and fixed, no resend needed. Variants of Hamming codes still guard server memory chips (ECC RAM) today.
Reed-Solomon: the workhorse in your pocket and beyond Pluto
Hamming codes fix single scattered errors, but real damage is often a burst — a scratch wipes out thousands of consecutive bits, a smudge kills a whole corner of a QR code. For bursts, the champion since 1960 has been the Reed-Solomon family.
Two ideas make it work. First, Reed-Solomon operates on multi-bit symbols (say, bytes) rather than single bits, and its math — think of it as fitting a polynomial through data points, with extra points added as redundancy — can reconstruct several completely destroyed symbols per block. A burst that annihilates 8 consecutive bits may ruin only one or two symbols, well within repair.
Second, systems add interleaving: shuffle the encoded data before writing or transmitting, unshuffle on receipt. A single long physical scratch becomes, after unshuffling, many tiny scattered errors — each trivially fixable. This is precisely why a visibly scratched CD plays flawlessly; the format can correct error bursts spanning millimeters of track. QR codes use Reed-Solomon at selectable strength — at the highest setting, around 30% of the pattern can be obliterated and it still scans, which is why a logo slapped in the middle costs nothing.
And it's why we have pictures of Neptune. Voyager 2's images from 1989 traveled about 4.5 billion kilometers on a transmitter of roughly 23 watts; by arrival the signal was astonishingly faint. The probe's coding — Reed-Solomon layered with a convolutional code — let Earth recover the data essentially error-free from a whisper. Same math as the QR code on a concert poster. Once you see that connection, everyday objects get more interesting — it's exactly the kind of hidden-engineering story that NerdSip's five-minute science reads are built around.
Turbo and LDPC: knocking on Shannon's door
Shannon proved in 1948 that every noisy channel has a capacity C, and that codes exist letting you transmit at any rate below C with error rates as small as you please. But his proof was non-constructive — it showed magnificent codes exist without exhibiting one. For 45 years, practical codes fell well short of the limit.
Then, in 1993, turbo codes arrived: two simple encoders working on interleaved copies of the data, with two decoders passing probabilistic guesses back and forth, each round refining the other's estimate — like two friends comparing crossword answers until the grid settles. Performance landed within a fraction of a decibel of the Shannon limit, so close to the theoretical wall that parts of the community initially found the claims hard to believe. Soon after, LDPC codes — invented by Robert Gallager in 1960 but computationally infeasible then, and rediscovered in the 1990s — proved equally powerful.
These two families now carry most of your life. Turbo codes powered 3G and 4G. LDPC codes run 5G data channels, modern WiFi (optional from 802.11n, standard in WiFi 6), satellite TV, and much of modern storage, from hard drives to SSDs. When your phone streams video in a crowded stadium, an LDPC decoder is executing millions of belief-passing operations per second, snapping noise-battered bits back to the nearest codeword. What "capacity" means precisely, and why it's a wall no code can pass, is the subject of why noise limits communication.
The takeaway
Error correction is geometry: declare only a sparse set of far-apart codewords valid, and noise must be violent enough to push one codeword more than halfway to another before it can fool you. A parity bit detects; Hamming (7,4) locates and repairs a single flip; Reed-Solomon, with interleaving, shrugs off the burst damage of scratches, smudges, and interplanetary distances; turbo and LDPC codes press against Shannon's capacity limit itself. Every scan, stream, call, and download you'll make today was corrupted in transit — and quietly healed before you ever saw it.
Comments 0
No comments yet. Be the first to share your thoughts.