Syllabus & Goals 3 min
Cambridge 2.2 · Methods of error detection Paper 1 · Computer Systems
By the end of this lesson you can:
- Explain what a check digit is and name the data-entry errors it detects.
- Use a given algorithm (ISBN-13 or modulo-11) to calculate and verify a check digit.
- Describe how an Automatic Repeat Request (ARQ) uses acknowledgements and a timeout.
Textbook: Chapter 2, §2.2.3–2.2.4 (pp. 59–62) — check digits and automatic repeat requests.
Recap / Warm-Up 5 min
Lesson 3 checked data after transmission: parity, checksum and echo check. Today adds a check on data typed or scanned in, and a smarter transmission check that re-sends by itself.
Quick starter
In a checksum, who recalculates the value — the sender or the receiver? And what happens if the values differ?
Reveal the answer
The receiver recalculates it. If the two values differ, it asks for the block to be re-sent.
Key Concept 14 min
1 · Check digits
A check digit is the final digit of a code. It is calculated from all the other digits. It is used on barcodes, book numbers (ISBNs) and Vehicle Identification Numbers (VINs). It catches mistakes made when a person types a code, or a scanner misreads a barcode.
| Error type | Correct code | What was entered |
|---|---|---|
| Incorrect digit | 5307 | 5327 |
| Transposition (two digits swapped) | 5307 | 5037 |
| Omitted digit | 5307 | 537 |
| Extra digit | 5307 | 53107 |
| Phonetic error (misheard) | 30 ("thirty") | 13 ("thirteen") |


2 · Two check-digit methods
ISBN-13 (the 13th digit)
- Add all the odd-position digits.
- Add all the even-position digits and multiply by 3.
- Add the two results; divide by 10.
- Remainder 0 → check digit 0. Otherwise check digit = 10 − remainder.
To verify: include the check digit in step 1. The code is correct if the remainder is 0.
Modulo-11 (any length)
- Give each digit a weighting, counting down from the left (8, 7, 6 … 2 for a 7-digit number).
- Multiply each digit by its weighting; add the results.
- Divide the total by 11.
- Check digit = 11 − remainder. If that gives 10, use X.
To verify: the check digit gets weighting 1. Correct if the remainder is 0.
3 · Automatic Repeat Request (ARQ)
An ARQ checks data after transmission. It uses acknowledgements and a timeout:
- The data arrives with an error-detection code (typically a CRC).
- No error found → the receiver sends a positive acknowledgement.
- Error found → it sends a negative acknowledgement and asks for the data again.
- The sender waits a set time — the timeout. If no acknowledgement arrives in time, it re-sends automatically.
- This repeats until a positive acknowledgement arrives, or a set number of re-sends has been tried.

Worked Example 12 min
(a) Generate and verify an ISBN-13 check digit
Question: the barcode photo shows ISBN 978-984-96088-0-?. Calculate the check digit, then verify the full ISBN.
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Digit | 9 | 7 | 8 | 9 | 8 | 4 | 9 | 6 | 0 | 8 | 8 | 0 |
| Odd / even | odd | even | odd | even | odd | even | odd | even | odd | even | odd | even |
- Odd positions: 9 + 8 + 8 + 9 + 0 + 8 = 42.positions 1, 3, 5, 7, 9 and 11.
- Even positions: 7 + 9 + 4 + 6 + 8 + 0 = 34, then 34 × 3 = 102.the × 3 weighting is what catches most swapped digits.
- 42 + 102 = 144; 144 ÷ 10 = 14 remainder 4.
- Remainder is not 0, so check digit = 10 − 4 = 6. This matches the photo: 978-984-96088-0-6.
- Verify: add the check digit to the odd total: 42 + 6 = 48. Then 48 + 102 = 150; 150 ÷ 10 = 15 remainder 0 → the ISBN is correct.the check digit sits in position 13, which is odd.
- Now suppose the 11th digit is mistyped as 3. The odd total (with the check digit) becomes 43, and 43 + 102 = 145 → remainder 5, not 0, so the error is caught.
(b) Generate a modulo-11 check digit, then catch a transposition
Question: find the modulo-11 check digit for the 7-digit product code 3825146.
| Digit | 3 | 8 | 2 | 5 | 1 | 4 | 6 | Total |
|---|---|---|---|---|---|---|---|---|
| Weighting | 8 | 7 | 6 | 5 | 4 | 3 | 2 | |
| Product | 24 | 56 | 12 | 25 | 4 | 12 | 12 | 145 |
- Multiply and add: 24 + 56 + 12 + 25 + 4 + 12 + 12 = 145.weights start at 8 because the code becomes 8 digits long.
- 145 ÷ 11 = 13 remainder 2 (13 × 11 = 143).
- Check digit = 11 − 2 = 9. Full code: 38251469.
- Verify with weights 8 … 1: 145 + 9 × 1 = 154 = 14 × 11, remainder 0 ✓.
- An operator swaps the 3rd and 4th digits:
38521469. New total: 24 + 56 + 30 + 10 + 4 + 12 + 12 + 9 = 157 → remainder 3, not 0, so the transposition is detected.different weights on each position mean swapped digits change the total.
The ISBN-13 check digit as an algorithm
Cambridge pseudocode
// ISBN-13 check digit from 12 digits
DECLARE Index : INTEGER
DECLARE Digit : INTEGER
DECLARE Total : INTEGER
DECLARE Remainder : INTEGER
DECLARE CheckDigit : INTEGER
Total ← 0
FOR Index ← 1 TO 12
OUTPUT "Enter digit ", Index
INPUT Digit
IF Index MOD 2 = 1
THEN
Total ← Total + Digit
ELSE
Total ← Total + Digit * 3
ENDIF
NEXT Index
Remainder ← Total MOD 10
IF Remainder = 0
THEN
CheckDigit ← 0
ELSE
CheckDigit ← 10 - Remainder
ENDIF
OUTPUT "Check digit is ", CheckDigitThe same in Python (IDLE)
# ISBN-13 check digit from 12 digits digits = [9, 7, 8, 9, 8, 4, 9, 6, 0, 8, 8, 0] total = 0 for position in range(1, 13): digit = digits[position - 1] if position % 2 == 1: total = total + digit else: total = total + digit * 3 remainder = total % 10 if remainder == 0: check_digit = 0 else: check_digit = 10 - remainder print("Check digit is", check_digit)
Output
Check digit is 6
Try It Yourself 12 min
Goal: use the ISBN-13 algorithm to find the check digit for 978186197876. Show every step.
Goal: use modulo-11 to find the check digit for 5207341. Then verify your 8-digit answer with weights 8 down to 1.
Goal: find the modulo-11 check digit for 3602158. Explain why the answer is not a digit at all, and prove your full code is valid.
Hint
Look closely at the remainder. What is 11 minus it, and what symbol does the method use for that value? When verifying, that symbol counts as 10.
📝 Exam Practice 10 min
Use the ISBN-13 algorithm to calculate the check digit for 978030640615. Show your working.
Mark scheme
- Working: odd total 27; even total 22 × 3 = 66; 27 + 66 = 93; 93 ÷ 10 remainder 3 (1).
- Check digit = 10 − 3 = 7 (1).
A company's vending machines send sales data to head office each night. Describe how an Automatic Repeat Request (ARQ) checks this data.
Mark scheme
- The data is sent with an error-detection code / CRC (1).
- The receiver checks it and sends a positive acknowledgement if no error (1).
- …or a negative acknowledgement / request to re-send if an error is found (1).
- The sender waits a set time — a timeout (1).
- If no acknowledgement arrives before the timeout, the data is re-sent automatically (1).
- …until a positive acknowledgement is received / a set number of attempts (1).
Any four.
Checksum and check digit are two terms often confused. Describe three differences between them.
Mark scheme
- A check digit checks data entry, whereas a checksum checks data after transmission (1).
- A check digit is a single digit at the end of a code, whereas a checksum is a value sent after a block of data (1).
- A check digit is calculated from one number / code, whereas a checksum is calculated from a whole block (1).
- A check-digit error means the operator re-enters the code, whereas a checksum error means the block is re-sent (1).
Any three.
Show that the 8-digit code 50317725 has a valid modulo-11 check digit. Use weights 8, 7, 6, 5, 4, 3, 2, 1.
Mark scheme
- Products: 40 + 0 + 18 + 5 + 28 + 21 + 4 + 5 (1).
- Total = 121 (1).
- 121 ÷ 11 = 11 remainder 0, so the code is valid (1).
Recap & Key Terms 3 min
A check digit is calculated from the other digits of a code and catches entry errors such as wrong, swapped, missing or extra digits. ISBN-13 and modulo-11 are two ways to make one. ARQ uses acknowledgements and a timeout to re-send data until it arrives correctly.
- Check digit
- An additional digit added to a number to check the number was entered without error; a data-entry check, not a transmission check.
- Transposition error
- An error where two digits are swapped over, e.g. 5037 entered instead of 5307.
- Automatic Repeat Request (ARQ)
- A method of checking transmitted data that uses acknowledgements and a timeout to request re-sending automatically.
- Acknowledgement
- A message sent back to say whether data was received correctly (positive) or not (negative).
- Timeout
- The time interval allowed to elapse before an acknowledgement is received; after it, the data is re-sent.
Homework 1 min
Task (≤ 15 min): a librarian types ISBN 9780306406175 into a computer. Use the ISBN-13 verification method to decide whether it was typed correctly. Then name the type of error that has probably happened. [4]
Model answer
- Odd positions (incl. check digit): 9 + 8 + 3 + 6 + 0 + 1 + 5 = 32 (1).
- Even positions: 7 + 0 + 0 + 4 + 6 + 7 = 24; 24 × 3 = 72 (1).
- 32 + 72 = 104; remainder 4, not 0, so the ISBN is not valid (1).
- Transposition error — the last two digits (7 and 5) were swapped; the real ISBN ends 157 (1).