ISBN-13 check digit

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

ISBN-13 check digit

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does an ISBN identify?
A A particular book
B A person who borrows books
2. Which weights does ISBN-13 use on its first 12 digits?
A 1, 3, 1, 3 ... alternating
B 10, 9, 8, 7 ... counting down
3. Which digit of an ISBN-13 is the check digit?
A The first digit
B The last (13th) digit
4. In ISBN-13, what weight is given to the 2nd digit?
A 3
B 1
5. The check digit is chosen so that the weighted total of all 13 digits is a multiple of what?
A 11
B 10

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1weights: 1 3 1 3 1 3 1 3 1 3 1 3 AThe first 12 digits of an ISBN-13 are multiplied by 1 and 3 alternately, starting with 1 for the first digit.
2(10 - total MOD 10) MOD 10 BThe weights are the wrong way round. The first digit must be multiplied by 1, not 3.
3The weighted total is 87, so the check digit must bring it up to 90. Ccheck = (10 - 87 MOD 10) MOD 10 # 3
4The ISBN-13 weights alternate 1 and 3, so digit 2 is multiplied by 3 and digit 3 is multiplied by 1. Dtotal = d1*1 + d2*3 + d3*1 + d4*3
5total = d1*3 + d2*1 + d3*3 + d4*1 EFinds the check digit: the number that must be added to the weighted total to reach the next multiple of 10.
6check = total MOD 10 FThe remainder is not the check digit. The check digit is the amount needed to reach the next multiple of 10, so 10 minus the remainder (or 0 if the remainder is 0).

Definitions

ISBN-13 check digit

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
total ← d1*1 + d2*_ + d3*1 + d4*3
2.
remainder ← total ___ 10
3.
check ← (10 - remainder) MOD __
4.
isbn10Valid ← (total MOD __) = 0
5.
FOR i ← 1 TO __ total ← total + digit[i] * weight NEXT i

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A total ← 0
B FOR i ← 1 TO 12
C w ← 1
D IF i MOD 2 = 1 THEN w ← 3
E total ← total + d[i] * w
F NEXT i
Question 2
A total ← 120
B r ← total DIV 10
C IF r = 0 THEN check ← 0
D ELSE check ← 10 - r
Question 3
A isbn ← "978030640615"
B total ← 93
C remainder ← total MOD 10
D check ← remainder
E OUTPUT check
Question 4
A total ← 0
B FOR i ← 1 TO 9
C total ← total + d[i]*(10-i)
D NEXT i
E r ← total MOD 11
F check ← 11 - r
Question 5
A total ← 0
B FOR i ← 1 TO 12
C total ← total + d[i] * w[i]
D NEXT i
E valid ← total MOD 10 = 0

Answer Key

ISBN-13 check digit
Section A: Quick Questions
Q1
A — A particular book
Q2
A — 1, 3, 1, 3 ... alternating
Q3
B — The last (13th) digit
Q4
A — 3
Q5
B — 10
Section B: Match the Pairs
Q1
weights: 1 3 1 3 1 3 1 3 1 3 1 3 → The first 12 digits of an ISBN-13 are multiplied by 1 and 3 alternately, starting with 1 for the first digit.
Q2
(10 - total MOD 10) MOD 10 → Finds the check digit: the number that must be added to the weighted total to reach the next multiple of 10.
Q3
The weighted total is 87, so the check digit must bring it up to 90. → check = (10 - 87 MOD 10) MOD 10 # 3
Q4
The ISBN-13 weights alternate 1 and 3, so digit 2 is multiplied by 3 and digit 3 is multiplied by 1. → total = d1*1 + d2*3 + d3*1 + d4*3
Q5
total = d1*3 + d2*1 + d3*3 + d4*1 → The weights are the wrong way round. The first digit must be multiplied by 1, not 3.
Q6
check = total MOD 10 → The remainder is not the check digit. The check digit is the amount needed to reach the next multiple of 10, so 10 minus the remainder (or 0 if the remainder is 0).
Section C: Definitions
Q1
ISBN-13 check digit — The last digit of an ISBN-13, found by weighting the first 12 digits 1 and 3 alternately, adding them, and choosing the digit that makes the total a multiple of 10.
Section D: Fill in the Blanks
Q1
total ← d1*1 + d2*3 + d3*1 + d4*3
Q2
remainder ← total MOD 10
Q3
check ← (10 - remainder) MOD 10
Q4
isbn10Valid ← (total MOD 11) = 0
Q5
FOR i ← 1 TO 12 total ← total + digit[i] * weight NEXT i
Section E: Spot the Error
Q1
D — The weights alternate 1, 3, 1, 3, so odd positions (1st, 3rd, ...) get weight 1 and even positions get weight 3. The test should be i MOD 2 = 0 so that only the even positions get weight 3.
Q2
B — DIV gives the whole-number quotient, not the remainder. The check digit depends on the remainder after dividing by 10, so the line should be r ← total MOD 10.
Q3
D — The check digit is the number that brings the total up to the next multiple of 10, so it is 10 - remainder (10 - 3 = 7). Using the remainder itself gives 3, which is wrong.
Q4
C — ISBN-10 weights the first 9 digits 10, 9, 8 ... 2. The weight for digit i is 11 - i, not 10 - i, which would give 9 down to 1.
Q5
B — When checking a complete ISBN-13, all 13 digits, including the check digit, must be weighted and added. The loop should run from 1 TO 13.