ViewWiki

Lesson 4 of 5

The parity bit.

About 20 minutes · 5 practice questions

A noisy line flips bits: how many blocks arrive wrong, how one parity bit catches a flip, and what it cannot catch.

Step 1 of 5 · A noisy line

Step 1 of 5

A noisy line

The machine sends the word HELLO from a sender cabinet to a receiver cabinet, eight bits a character, in blocks of four bits. On the way, along the line, there is noise: now and then a spark strikes a card and turns it over, 00⁠ to 11⁠ or 11⁠ to 00⁠. That is a bit flip. A card that flipped gets a red edge, but only for you: the receiver cannot see it, and a wrong bit looks exactly like a right one.

Chance a bit flips is fixed at 5%, and each bit flips independently of the others. That is exactly the case of independent events from the probability Unit.

To the question

Step 2 of 5

A storm

A 5% chance per bit sounds small, but a block is hit if any of its bits flipped, so blocks are hit far more often than bits. The counter on the bench shows how many of the last 5050⁠ blocks arrived wrong, and the receiver’s display shows the characters that came out garbled.

Now the line is about to turn stormy. Think before it does.

To the question

Step 3 of 5

A quieter line

When the chance is small, hardly any block is hit twice, so the chance of a wrong block is close to the sum of its bits’ chances. As the noise grows, adding drifts away from the truth. Here you can change Chance a bit flips.

To the question

Step 4 of 5

Count the 1s

The receiver cannot see which bit flipped. It can only check. The simplest check is a parity bit: before sending, add one bit to each block, chosen so that the count of 1s in the block is even. If one bit flips on the way, the count turns odd, and the receiver knows something went wrong.

To the question

Step 5 of 5

What parity misses

A parity check answers one question only: is the count of 1s even? It does not say which bit went wrong, so all the receiver can do is ask for the block again. And even that one question is not always enough. To repair an error, not just catch it, takes several overlapping checks: that is the next Lesson.

To the question

Still of the Error-correcting codes 3D scene
Interactive scene

Loading the interactive version…

Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.

To the experiment

Practice · Calculate

Chance a bit flips is fixed at 5%. Each block carries four bits, and each bit flips independently of the others. What is the chance that a block arrives with at least one error? Answer in per cent.

To the experiment

Practice · Predict, then look

Now a storm hits the line: Chance a bit flips goes up to 15% for each bit. Roughly what share of four-bit blocks will arrive wrong?

To the experiment

Practice · Reach the target

Change Chance a bit flips until about one block in ten, 10%, arrives with an error, then press Check.

To the experiment

Practice · Choose

You send the four bits 1 0 1 1, and add a parity bit so that the count of 1s in all five bits is even. What is the parity bit?

To the experiment

Practice · Choose

A block of four data bits and a parity bit sets out, and on the way two of its bits flip. What does the receiver see when it counts the 1s?