Cobra Effect · Computing and information

The codes that fix their own mistakes

How a frustrated mathematician invented codes that find and fix their own errors.

7 cards, read aloud in 2:27, with a test and sources.

Tall racks of relay machinery with rows of small indicator lamps

In the late 1940s, Richard Hamming used a huge relay computer at Bell Labs.

Hamming was a mathematician who had worked on the Manhattan Project before joining Bell Labs in 1946. The machine could detect some errors in its own work. During the week, operators fixed them. At weekends, an error made the machine abandon the job.

Hamming left long calculations running over weekends, and came back to find nothing done.

An error early on had stopped his job, and the machine had moved on to the next. It happened more than once. If a machine can tell there is an error, he reasoned, why can’t it find it and fix it?

Simple checks could only say that something had gone wrong.

A parity check adds one extra bit, so that the number of ones is always even. If a single bit flips, the count turns odd, and the error shows up. But the check cannot say which bit was wrong.

Hamming found a way to use several overlapping checks.

In his seven bit code, four bits carry the message and three bits are checks. Each check covers a different group of bits, and the groups overlap. If one bit flips, the pattern of failed checks points to exactly which one it was.

Then the machine can simply flip that bit back.

The message is corrected, without anyone having to send it again. Claude Shannon’s 1948 paper had already described the code, crediting Hamming. Hamming published his own paper on it in 1950.

Error correcting codes are now everywhere.

They protect data in computer memory, on discs, and in signals sent across the world. Later codes can correct many errors at once, building on the same idea. In 1968, Hamming received the Turing Award, partly for this work.

So when a system keeps failing in the same way, ask why it cannot fix itself.

Hamming’s frustration was the starting point. He turned a machine that could only notice errors into one that could correct them. A good question born of irritation can outlast the problem that prompted it.

Sources

Nearby ideas

All stories

Cobra EffectIdeas worth knowing
Streak 0 daysRead 0 of 0Known 0Kept 0
Every story is written to a rule: framing can be invented, facts cannot, and a tale that is probably a legend says so. Narration and pictures are generated once and kept. Your progress is saved on this device and in a record of its own on the server, so you can pick it up on another one. Nothing else about you is collected, and there is a button to delete the lot. Privacy.