Error detection finds out that data has changed. Error correction repairs the data. Questions often ask which one a method does, so the exact verb in your answer matters.
This lesson completes data transmission and checking. It builds on parity and checksums.
What does each method do?
| Method | What it does | Fixes the data? |
|---|---|---|
| Parity bit | Detects an odd number of flipped bits | No |
| Checksum | Detects most accidental changes | No |
| Check digit | Detects typing or scanning errors in a code | No |
| Echo check | Sender compares returned data with the original | No |
| ARQ | Receiver says “good” or “send again”; sender retries on timeout | Recovers by resending |
| Repetition code | Each bit sent several times; majority vote | Yes, for a limited number of flips |
Check with your syllabus which of these names appear, since Cambridge sets the content and may update it.
How does ARQ work?
- The sender transmits a packet with check data.
- The receiver runs the check.
- If it passes, the receiver sends a positive acknowledgement. If it fails, it sends a negative acknowledgement or says nothing.
- The sender waits for a timeout. With no acknowledgement, or a negative one, it resends. After a set number of tries it gives up.
ARQ does not repair the damaged data. It replaces it with a fresh copy.
Worked example: correcting with repetition
A sender wants to send the bits 1, 0, 1. It sends each bit three times: 111 000 111.
The receiver gets 111 010 111. For each group it counts the 1s and takes the majority.
ones ← 0
FOR i ← 1 TO 3
IF Group[i] = 1 THEN
ones ← ones + 1
ENDIF
NEXT i
IF ones >= 2 THEN
result ← 1
ELSE
result ← 0
ENDIF
Trace for the middle group 0, 1, 0: i=1 gives ones 0, i=2 gives ones 1, i=3 stays 1. Since 1 is less than 2, result = 0. So the middle bit is corrected to 0.
The groups 111 and 111 give 3 ones, so both results are 1. The message is repaired as 1, 0, 1 without asking for a resend. The cost is that the data takes three times as long to send.
What mistake do students make?
A common statement is: “Parity checks the data and corrects any errors.”
It does not. Parity only detects.
To correct, the receiver needs enough extra information to work out the right value, as in the majority vote above, or it must ask for a new copy. Write “detects” for parity and checksum, and “resends” for ARQ.
Check yourself
1. State whether each one detects or corrects: (a) parity bit, (b) majority vote on three copies of a bit.
Show answer
(a) Detects. (b) Corrects, if only one of the three copies is wrong.
2. A group of three bits arrives as 1, 1, 0. What bit was probably sent?
Show answer
Two 1s and one 0, so the majority is 1. The bit sent was probably 1.
3. An ARQ sender gets no reply before the timeout. What does it do?
Show answer
It resends the packet, up to the set number of tries.
Where this leads next
Take what you have learnt into the practice set, which mixes all five lessons. Return to the module overview if you need the order of topics.
Mixing up “detects” and “corrects” is an easy way to lose marks, and a teacher can drill the difference with you in online one-to-one Computer Science tuition.