Calculating a check digit with weights and modulus 11

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

Calculating a check digit with weights and modulus 11

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What is the first step when calculating a weighted check digit?
A Multiply each digit by its weight
B Divide the whole number by 11
2. After multiplying each digit by its weight, what do you do with the products?
A Multiply them together, then divide by 10
B Add them up, then divide the total by 11 and find the remainder
3. Digits 2, 5, 1 have weights 4, 3, 2. What is the weighted total?
A 28
B 25
4. A weighted total is 25. What is the remainder when it is divided by 11?
A 3
B 2
5. A scheme says the check digit is 11 minus the remainder. The remainder is 3. What is the check digit?
A 8
B 3

Match the Pairs

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

Left columnRight column
1total MOD 11 AThe remainder was used directly as the check digit. This scheme needs 11 minus the remainder, so the check digit should be 11 - 9 = 2.
211 - (130 MOD 11) = 2 BCheck digit 2 for the ISBN-10 digits 030640615 when the weighted total is 130
3Multiply each digit by its weight and add the results: digits 5, 2, 1 with weights 4, 3, 2 CA check digit must be a single character. In ISBN-10 a result of 10 is written as the letter X.
4Divide the total by 11, find the remainder, then take 11 minus the remainder to get the check digit D5*4 + 2*3 + 1*2 = 28
5Total = 130, 130 MOD 11 = 9, check digit = 9 EThe remainder left after dividing the weighted total by 11
611 - remainder = 10, so the ISBN-10 ends in 10 F28 MOD 11 = 6, 11 - 6 = 5

Definitions

weighted check digit

Fill in the Blanks

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

1.
remainder ← total MOD __
2.
check ← 11 - _________
3.
IF check = __ THEN check ← "X" ENDIF
4.
product ← digit _ weight total ← total + product
5.
total ← total + product remainder ← total ___ 11

Spot the Error

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

Question 1
A d ← [5, 1, 7]
B w ← [4, 3, 2]
C total ← 5*4 + 1*3 + 7*2
D rem ← total DIV 11
E check ← 11 - rem
Question 2
A total ← 37
B rem ← total MOD 11
C check ← 11 - rem
D IF check = 11 THEN check ← "X"
Question 3
A total ← 1
B FOR i ← 1 TO 4
C total ← total + d[i] * w[i]
D NEXT i
Question 4
A total ← 2*5 + 7*4 + 1*3
B rem ← total MOD 11
C check ← rem - 11
D OUTPUT check
Question 5
A total ← 0
B FOR i ← 1 TO 9
C total ← total + d[i] + w[i]
D NEXT i
E rem ← total MOD 11

Answer Key

Calculating a check digit with weights and modulus 11
Section A: Quick Questions
Q1
A — Multiply each digit by its weight
Q2
B — Add them up, then divide the total by 11 and find the remainder
Q3
B — 25
Q4
A — 3
Q5
A — 8
Section B: Match the Pairs
Q1
total MOD 11 → The remainder left after dividing the weighted total by 11
Q2
11 - (130 MOD 11) = 2 → Check digit 2 for the ISBN-10 digits 030640615 when the weighted total is 130
Q3
Multiply each digit by its weight and add the results: digits 5, 2, 1 with weights 4, 3, 2 → 5*4 + 2*3 + 1*2 = 28
Q4
Divide the total by 11, find the remainder, then take 11 minus the remainder to get the check digit → 28 MOD 11 = 6, 11 - 6 = 5
Q5
Total = 130, 130 MOD 11 = 9, check digit = 9 → The remainder was used directly as the check digit. This scheme needs 11 minus the remainder, so the check digit should be 11 - 9 = 2.
Q6
11 - remainder = 10, so the ISBN-10 ends in 10 → A check digit must be a single character. In ISBN-10 a result of 10 is written as the letter X.
Section C: Definitions
Q1
weighted check digit — Multiply each digit by its weight, add them up, divide by 11 and use the remainder (often 11 minus it) as the check digit. A 10 is written X in ISBN-10.
Section D: Fill in the Blanks
Q1
remainder ← total MOD 11
Q2
check ← 11 - remainder
Q3
IF check = 10 THEN check ← "X" ENDIF
Q4
product ← digit * weight total ← total + product
Q5
total ← total + product remainder ← total MOD 11
Section E: Spot the Error
Q1
D — DIV gives the whole-number quotient, but the check digit needs the remainder. It should be rem ← total MOD 11, which gives 37 MOD 11 = 4.
Q2
D — In ISBN-10 it is a check digit of 10 that is written as X, because 10 cannot fit in one digit. The test should be check = 10.
Q3
A — The running total must start at 0. Starting at 1 adds an extra amount to every sum, so the check digit comes out wrong. It should be total ← 0.
Q4
C — The scheme says the check digit is 11 minus the remainder, not the remainder minus 11, which would be negative. It should be check ← 11 - rem.
Q5
C — Each digit must be multiplied by its weight, not added to it. It should be total ← total + d[i] * w[i].