The shape of the lesson
By the end of the lesson, learners can
- What a check digit catches: Check digits protect data entry: a person typing a code, or a scanner reading one.
- The ISBN-13 method: Use the lab to calculate an ISBN-13 check digit, then change one digit or swap two and see the check fail.
- Automatic repeat query: Send packets in the lab's ARQ mode.
- Check digit: calculated from the other digits; recalculated on entry; mismatch = entry error.
- ISBN-13: weights 1, 3, 1, 3 ...; add; MOD 10; 10 minus the remainder (0 stays 0).
- ARQ: positive acknowledgement if correct, negative acknowledgement if not.
- Timeout: no acknowledgement within the set time, so the sender resends.
One picture every idea returns to
A check digit is an extra digit calculated from the other digits of a number and added to the end. When the number is entered, the check digit is recalculated and compared; if it does not match, a data entry error has been made. Check digits are used in ISBNs and barcodes. Automatic repeat query (ARQ) checks transmitted data: the receiver sends a positive acknowledgement if the data is correct or a negative acknowledgement if not, and the sender resends if it gets a negative acknowledgement or if a timeout passes with no acknowledgement.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Check it, or ask again.. A check digit catches mistakes when a person types a number or a scanner misreads a barcode. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: What a check digit catches | Check digits protect data entry: a person typing a code, or a scanner reading one. | Whole class, then pairs |
| 13 to 21 min | Teach and check: The ISBN-13 method | Use the lab to calculate an ISBN-13 check digit, then change one digit or swap two and see the check fail. Project tab 4 of the lab (ISBN-13 check digit) and let a student drive it while the class predicts. Model the worked example Calculate on the board, one line at a time. Your turn: Calculate the check digit for an ISBN beginning 978123456789. | Pairs |
| 21 to 30 min | Teach and check: Automatic repeat query | Send packets in the lab's ARQ mode. Project tab 5 of the lab (Automatic repeat query (ARQ)) and let a student drive it while the class predicts. Your turn: A packet is lost completely on the way. The receiver never sees it, so it sends nothing. How does ARQ recover? | Anticipation / Reaction Guide |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 17 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in Automatic repeat query, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Anticipation / Reaction Guide
Before the lesson, students mark five statements true or false. After the teaching they mark them again and justify any change of mind in one sentence each. The statements come from the examiner traps below.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| A check digit detects errors in data entry. | Parity, checksums and echo checks detect errors in transmission. Mixing these up loses marks. |
| Do not stop at the remainder. | The remainder 3 is not the check digit: subtract it from 10 (unless the remainder is 0). |
| The timeout is on the sender. | Write "the sender waits a set time for an acknowledgement; if none arrives, it resends the data". |
Check digits and automatic repeat query (ARQ): worksheet
6 questions, 17 marks. Written in the style of the papers; no past paper question is reproduced.
Describe how a check digit is used to detect errors when a product barcode is scanned.
The ISBN-13 check digit is calculated using the method in this lesson. Calculate the check digit for the ISBN that begins 979824681357. Show your working.
A librarian enters the ISBN 9780141306144. The correct ISBN is 9780141036144. Show how the check digit detects the error and name the type of error.
Give two types of data entry error that a check digit can detect.
Describe how automatic repeat query (ARQ) is used to make sure data is received without error.
A student says: "A check digit is the best way to check that a file has been transmitted correctly over the internet." Explain why the student is wrong.
Answer key and marking notes
- The check digit is calculated from the other digits and stored as the last digit of the barcode.
- When the barcode is scanned, the check digit is recalculated from the other digits using the same algorithm.
- If the recalculated digit does not match the scanned check digit, an error has occurred and the barcode is rescanned (or typed in).
- Products: 9, 21, 9, 24, 2, 12, 6, 24, 1, 9, 5, 21; total = 143.
- 143 MOD 10 = 3; check digit = 10 − 3 = 7.
- Recalculate from the first 12 digits entered (978014130614): total = 92.
- 92 MOD 10 = 2, so the check digit should be 8, but 4 was entered: the error is detected.
- It is a transposition error (two digits, 0 and 3, swapped).
- An incorrect digit (one digit entered wrongly).
- Transposed digits / an omitted digit / an extra digit (any one).
- The receiver checks the received data for errors (using an error detection method).
- If there is no error, the receiver sends a positive acknowledgement to the sender.
- If there is an error, the receiver sends a negative acknowledgement and the sender resends the data.
- The sender starts a timer (timeout) when the data is sent.
- If no acknowledgement is received before the timeout, the data is resent automatically; this continues until a positive acknowledgement is received.
- A check digit detects errors in data entry (typing or scanning a number), not errors in transmission.
- A transmission error check such as a parity check, checksum or ARQ should be used instead.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
What type of error is a check digit designed to detect?
- AErrors made when a number is typed or scanned
- BErrors caused by interference while data is being transmitted
- CErrors where packets arrive at the receiver out of order
- DErrors where a hacker has changed the data on purpose
An ISBN-13 check digit is found by multiplying the first 12 digits alternately by 1 and 3, adding the results, finding the total MOD 10 and subtracting this from 10 (a remainder of 0 gives a check digit of 0). What is the check digit for an ISBN that begins 978014143951?
- A8
- B2
- C0
- D4
In automatic repeat query (ARQ), what does the receiver send if the data it receives is correct?
- AA positive acknowledgement
- BA negative acknowledgement
- CA copy of the data
- DA new check digit
Using ARQ, a sender transmits a block of data and starts a timer. The timeout passes and no acknowledgement has arrived. What does the sender do?
- AResends the block of data
- BAssumes the data arrived and sends the next block
- CSends a negative acknowledgement to the receiver
- DWaits until an acknowledgement eventually arrives
The ISBN 9780141439518 is typed as 9780141349518, with two digits swapped. The computer recalculates the check digit from the first 12 digits typed (weights 1, 3, 1, 3, ...; check digit = 10 − total MOD 10, or 0 if the remainder is 0). What happens?
- AThe error is detected: the recalculated check digit is 0, not 8
- BNo error is detected: the recalculated check digit is still 8
- CThe error is detected: the recalculated check digit is 2, not 8
- DNo error is detected: check digits cannot catch swapped digits
Why does ARQ need a timeout as well as positive and negative acknowledgements?
- AWithout it, a lost block or lost reply would never be resent
- BThe timeout lets the receiver recalculate the check digit before replying
- CThe timeout tells the receiver how many packets it should expect
- DWithout a timeout, negative acknowledgements would be treated as positive ones
Quiz key
A check digit is recalculated when a number is typed in or scanned, so it detects data entry errors such as a wrong digit or two digits swapped. Transmission errors are detected with parity checks, checksums, echo checks or ARQ. Packets arriving out of order is normal and is fixed using packet numbers. Deliberate tampering is a security issue, not what a check digit is designed for.
Products: 9, 21, 8, 0, 1, 12, 1, 12, 3, 27, 5, 3. Total = 102. 102 MOD 10 = 2, so the check digit is 10 − 2 = 8. 2 is the remainder, not the check digit. 0 would only be correct if the remainder were 0. 4 comes from multiplying the wrong digits by 3 (starting the weights 3, 1, 3, ... instead of 1, 3, 1, ...).
If the received data passes its error check, the receiver sends a positive acknowledgement, so the sender knows it does not need to resend. A negative acknowledgement means an error was found. Sending a copy of the data back is an echo check, not ARQ. Check digits are for data entry, not part of ARQ.
In ARQ, if no acknowledgement arrives before the timeout, the sender assumes something went wrong and resends the data. Assuming success would risk losing data. Acknowledgements are sent by the receiver, not the sender. Waiting indefinitely is exactly what the timeout is there to prevent.
Typed digits 9 7 8 0 1 4 1 3 4 9 5 1 give products 9, 21, 8, 0, 1, 12, 1, 9, 4, 27, 5, 3, total 100. 100 MOD 10 = 0, so the check digit should be 0, but 8 was typed, so the error is detected. It does not stay 8 because the swapped digits now get different weights. 2 is the remainder from the original, correct ISBN. Swapping adjacent digits is one of the main errors check digits are designed to catch.
If a block or its acknowledgement is lost, the receiver sends nothing the sender can see, so without a timeout the sender would wait forever. The timeout makes the sender resend when no reply arrives. ARQ does not use check digits. The timeout is about waiting time, not how many packets to expect. Positive and negative acknowledgements are distinct messages, so they cannot be confused because of a missing timeout.
What to project
The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.