coruEveryday science

Flip one square. The message survives.

One damaged bit. No backup copy. Can three extra bits bring the message home?

Damage the transmission

Flip one of the seven bits, then ask the receiver to recover the four-bit message. Exactly one flipped bit is guaranteed to be repairable. A complete paper version follows.

Play on paper: a complete worked example

Start with message 1011. Put its four bits into positions 3, 5, 6 and 7. Positions 1, 2 and 4 are check bits. Fill them so that each group below contains an even number of 1s, counting zero as even.

Position1234567Bit0110011
Count the 1s in each group
CheckTilesBeforeTile 5 flipped
11, 3, 5, 72 · even3 · odd
22, 3, 6, 74 · even4 · even
44, 5, 6, 72 · even3 · odd

The received word is 0110111. Checks 1 and 4 fail. Add their labels: 1 + 4 = 5. Flip tile 5 back, then read positions 3, 5, 6 and 7: 1011. The receiver needed the received word and the checking rule, not a saved original.

Try all seven possible single flips. The failed-check labels always sum to the flipped position. With no error, they sum to zero. This guarantee assumes at most one flipped bit in the seven-bit word.

Two flips can mislead the repair: 0000000 → 0010100 (tiles 3 and 5) gives failed checks 2 and 4. Flipping tile 6 then produces 0010110, a different valid word, carrying message 1110.

Play on paper: a complete worked example

Start with message 1011. Put its four bits into positions 3, 5, 6 and 7. Positions 1, 2 and 4 are check bits. Fill them so that each group below contains an even number of 1s, counting zero as even.

Position1234567Bit0110011
Count the 1s in each group
CheckTilesBeforeTile 5 flipped
11, 3, 5, 72 · even3 · odd
22, 3, 6, 74 · even4 · even
44, 5, 6, 72 · even3 · odd

The received word is 0110111. Checks 1 and 4 fail. Add their labels: 1 + 4 = 5. Flip tile 5 back, then read positions 3, 5, 6 and 7: 1011. The receiver needed the received word and the checking rule, not a saved original.

Try all seven possible single flips. The failed-check labels always sum to the flipped position. With no error, they sum to zero. This guarantee assumes at most one flipped bit in the seven-bit word.

Two flips can mislead the repair: 0000000 → 0010100 (tiles 3 and 5) gives failed checks 2 and 4. Flipping tile 6 then produces 0010110, a different valid word, carrying message 1110.

The spare bits are not backup copies

The four message bits occupy tiles 3, 5, 6 and 7. Tiles 1, 2 and 4 carry three extra bits, chosen to make three overlapping groups balance: each group must contain an even number of 1s. Zero counts as even.

One flipped bit changes the balance of every group it belongs to. Crucially, each tile belongs to a different combination of groups. Tile 5 belongs to checks 1 and 4; tile 6 belongs to checks 2 and 4. Their failures leave different fingerprints.

Add the labels of the failed checks. Their sum is the damaged position. With no damage, all checks pass and the sum is zero. This is a Hamming (7,4) code: seven transmitted bits, four message bits. Richard Hamming described this construction in his 1950 paper.

You can break the guard, too

Try flipping tile 1, 2 or 4—the extra bits themselves. The receiver still finds the error. A check bit is not an untouchable referee outside the system: its position has an address just like every other tile.

The receiver uses only the seven bits it receives and the checking rule. It does not need to know which tile you pressed, or compare against the original message. In the second round, you become that receiver.

Why seven is enough

There are sixteen possible four-bit messages. Each is assigned a seven-bit word, plus room for its seven possible one-bit mistakes. That makes eight received patterns per message: the untouched word and seven damaged versions.

Sixteen times eight is 128. Seven bits also have exactly 128 possible patterns. This code fits those little neighbourhoods together without overlap: a single mistake cannot put you closer to the wrong message. The interactive uses the actual checking rule, not a remembered answer.

A second mistake can make it confidently wrong

The promise is one flipped bit in each seven-bit word. If two bits flip, this receiver can point at a third tile and turn a damaged word into the wrong valid word. The checks then all pass. Open “What if two tiles flip?” above, or use the paper example, to watch that happen.

An eighth overall check bit can extend this construction to correct one error while detecting two. That is a different code; this seven-tile receiver does not have the extra information.

For a paper challenge, write down the encoded word, ask someone to change exactly one bit, and look only at the result. They may change a check bit. The broken message will tell you where to look.

Sources & further reading

Help improve this guide