sandbox · exhibit 0008

The exact amount of damage

One sentence goes down a wire that flips bits at random. Six encodings carry it. Each one comes back perfect or ruined — a code does not degrade, it holds and then it stops holding, and the whole of coding theory is the question of where that edge sits. Everything below is measured on this page: the edge, the bounds that say it can be nowhere else, and the distance from all of it to what Shannon says is possible.

The channel

Noise — every bit on the wire, flipped with probability p
p = 0.0040
Encoding
On the wire — one cell per byte sent, dark where the noise missed
untouched 1 bit flipped 2+ flipped put back
What came out
All six, this noise, one hundred sentences each

The cliff

The accounting

Two bounds hold every code in this table. Singleton: a code cannot separate its words by more than the number of check symbols, plus one. Sphere-packing: the balls of radius t around the codewords are disjoint, so they cannot cover more of the space than there is. Neither is measured here — they are arithmetic — but the distance from each code to each of them is, and two of these codes have no distance at all.

What the Golay code weighs

Its 4,096 words, counted by how many ones they carry. Nothing on this page asserts that the matrix it was built from is the right one: the matrix comes from an icosahedron — twelve vertices, five neighbours each, B = J − A — and the count is what decides whether that was the Golay code or a near miss.

Shannon's line

The curve is 1 − H(p), the most information a bit of this wire can carry. Above it nothing works, at any block length, with any cleverness. Below it, Shannon proved in 1948 that something works — without saying what. Each dot is one of these codes, at its own rate, at the noise where it starts losing half the sentences it is handed.

Checks

Why a cliff and not a slope

The thing that surprises people about error correction is that it does not wear out gradually. Photocopy a photocopy and you get a worse photocopy; send a Golay-coded sentence through worse and worse noise and you get the sentence, the sentence, the sentence, and then nothing. There is no version of the sentence with a plausible typo in it. That is not a design decision, it is what the geometry is: the codewords sit in a space of 224 possible received words like balls packed in a crate, and a received word is either inside somebody's ball, in which case it is unambiguous which one, or it is in the gaps, in which case nothing can be done and the honest answer is to say so.

Which is why the number t is not a rule of thumb. Two codewords eight positions apart cannot both have a ball of radius four without the balls touching, so three is the most the Golay code can promise and three is exactly what it delivers — the table above walks all 2,024 three-bit patterns and all 10,626 four-bit ones and finds no exception in either direction. The Hamming code shows the other face of the same fact. Its balls do not merely fail to overlap, they fill the crate: 16 codewords × 8 words per ball = 128 = every 7-bit word there is. Nothing is in the gaps, because there are no gaps, so a two-bit error lands inside the wrong ball and is confidently repaired into the wrong sentence, all 21 times out of 21. Perfection, in the technical sense, costs you the ability to notice.

The gap to the line

The last chart is the one I would keep if I had to throw the others away. Every code here is a real code, several of them famous, and every one of them sits well under Shannon's curve — Hamming worst, at about a third of the wire wasted, and the shortened Reed–Solomon best. The ordering is not about the cleverness of the algebra. It is about block length: a code that decides 145 bytes at a time can rely on the errors averaging out, and one that decides four bits at a time cannot, and Shannon's proof is in the end a statement about long blocks. Closing that gap took until 1993 and the codes that closed it — turbo, then LDPC — are decoded by guessing and iterating rather than by solving anything. Nothing on this page is one of those. This page is the part of the story where the answers are exact.

Everything on this page is computed here, in the page — the field, the codes, the noise, the decoders and every number in every table. It fetches nothing, and could not: the wall serves it with no origins in its policy at all.
Second opinion in tests/test_codes.py, which builds the same codes again by other routes. Entry 0008.