Data Transmission, Error Checking and Encryption: Question 7

Syllabus 2.2

Structured 7 marks

A library gives every book a 6-digit ID code. A 7th digit, the check digit, is added to the end of the code and is calculated as follows: add together all six digits of the ID, then find the remainder when this total is divided by 10. This remainder is the check digit.

A barcode scanner at the front desk scans a book's 6-digit ID and transmits it, followed by the check digit, to the library's server over a wireless connection. The 6-digit ID of a particular book is 5 2 8 1 6 3.

(a) Calculate the check digit for this ID, showing your working. [2]

(b) On one occasion, interference on the wireless connection changes the third digit of the ID from 8 to 3 during transmission, but does not affect the check digit. State the 6 digits as received, and show, with a calculation, how the server is able to tell that an error has occurred. [2]

(c) On a different occasion, interference instead swaps the order of the third and fourth digits of the ID (8 and 1) during transmission, without changing the value of any digit or the check digit. Explain, with reference to a calculation, why this check digit method is unable to detect that an error has occurred. [3]

Show worked solution Hide worked solution

Worked solution

Part (a): Calculating the check digit

Add together all six digits of the ID 5 2 8 1 6 3:

5 + 2 + 8 + 1 + 6 + 3 = 25

The check digit is the remainder when this total is divided by 10:

25 ÷ 10 = 2 remainder 5

So the check digit is 5, and the scanner transmits the full 7-digit sequence 5 2 8 1 6 3 5. [2 marks]: [1] for the correct total (25), [1] for the correct check digit (5).

Part (b): Detecting a single-digit error

Interference changes the third digit from 8 to 3, so the server receives the ID as:

5 2 3 1 6 3

Recalculating the check digit from these received digits:

5 + 2 + 3 + 1 + 6 + 3 = 20, and 20 ÷ 10 = 2 remainder 0

The recalculated check digit is 0, but the check digit actually received (unaffected by the interference) is still 5. Since 0 does not equal 5, the server can tell that an error has occurred somewhere in the received ID. [2 marks]: [1] for the correct received digits and recalculated total/check digit, [1] for correctly identifying the mismatch as evidence of an error.

Part (c): Why a transposition error goes undetected

This time, interference swaps the third and fourth digits (8 and 1) without changing their values, so the server receives the ID as:

5 2 1 8 6 3

Recalculating the check digit:

5 + 2 + 1 + 8 + 6 + 3 = 25, and 25 ÷ 10 = 2 remainder 5

This recalculated check digit (5) matches the received check digit (5) exactly, so the server does not detect any error. Even though the ID has actually been corrupted, since 5 2 1 8 6 3 is not the same book ID as 5 2 8 1 6 3.

The reason is that this check digit method only depends on the sum of the six digits, and addition gives the same result no matter what order the digits are added in. Swapping two digits’ positions does not change any digit’s value, so it cannot change the sum, which means the recalculated check digit is always identical to the original one whenever two digits have simply been transposed. A check digit based on a plain sum like this can therefore detect a digit being changed to a different value, but it can never detect two digits merely swapping places. [3 marks]: [1] for the correct recalculated total/check digit showing a match, [1] for stating that no error is detected, [1] for explaining that this is because reordering digits does not change their sum.

Final answers

  • (a) Check digit = 5 (sum = 25, remainder after dividing by 10 = 5)
  • (b) Received ID = 5 2 3 1 6 3; recalculated check digit = 0, which does not match the received check digit of 5, so an error is detected.
  • (c) Received ID = 5 2 1 8 6 3; recalculated check digit = 5, which matches the received check digit, so the transposition error is not detected, because swapping two digits leaves their sum unchanged.