0% found this document useful (0 votes)
25 views5 pages

Check Digit ISBN

A check digit is a redundancy check used for error detection in identification numbers, calculated using specific formulas. It helps identify transcription errors in data entry, ensuring accuracy in various applications like bank accounts and ISBNs. The document explains how to calculate check digits for UPCs and ISBNs, and discusses their importance in verifying data integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views5 pages

Check Digit ISBN

A check digit is a redundancy check used for error detection in identification numbers, calculated using specific formulas. It helps identify transcription errors in data entry, ensuring accuracy in various applications like bank accounts and ISBNs. The document explains how to calculate check digits for UPCs and ISBNs, and discusses their importance in verifying data integrity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Application of Congruence

Check Digit
Q. What is check digit?
A. A check digit is a form of redundancy check used for error detection on identification
numbers, such as bank account numbers, credit cards, driver’s licenses, VIN numbers, zip
codes, ISBN numbers, bar codes/ Universal Product Codes (UPC) etc. Usually, the last digit
(right most digit) in such an identification number is the check digit which is calculated using
a particular formula. For example, if 036000241457 is the UPC of a product then the last digit
7 is the check digit.

Q. Why is check digit important?


A. Using a check digit, one can detect simple errors in the input of a series of characters (usually
digits) such as a single mistyped digit or some permutations of two digits. So check digits are
very useful to capture transcription errors. Transcription error is a specific type of data entry
error that is commonly made by human operators or by optical character recognition programs
(OCR). Human transcription errors are commonly the result of typographical mistakes.
Electronic transcription errors occur when the scan of some printed matter is compromised or
in an unusual font – for example, if the paper is crumpled, or the ink is smudged, the OCR may
make transcription errors when reading.

Q. How is check digit calculated?


A. It varies. Different formulae are used to calculate the check digit for different types of
identification numbers. For example, the check digit 𝑥12 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑥12 ≤ 9 of a UPC
𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7 𝑥8 𝑥9 𝑥10 𝑥11 like the one stated above is calculated using the formula:
3(𝑥1 + 𝑥3 + 𝑥5 + 𝑥7 + 𝑥9 + 𝑥11 ) + (𝑥2 + 𝑥4 + 𝑥6 + 𝑥8 + 𝑥10 ) + 𝑥12 ≡ 0 (𝑚𝑜𝑑 10)
While the check digit 𝑥𝑛+1 in a bit string 𝑥1 𝑥2 … … 𝑥𝑛 of length 𝑛 is calculated by the formula:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 + 𝑥𝑛+1 ≡ 0 (𝑚𝑜𝑑 2)

Q. Calculate the check digit of the UPC 03600024145.


A. Let 𝑥 be the check digit. Then we must have
3(0 + 6 + 0 + 2 + 1 + 5) + (3 + 0 + 0 + 4 + 4) + 𝑥 ≡ 0 (𝑚𝑜𝑑 10)
⇒ 42 + 11 + 𝑥 ≡ 0 (𝑚𝑜𝑑 10)
⇒ 53 + 𝑥 ≡ 0 (𝑚𝑜𝑑 10)
⇒ 𝑥 ≡ −53 (𝑚𝑜𝑑 10); [𝑠𝑖𝑛𝑐𝑒 − 53 ≡ −53 (𝑚𝑜𝑑 10)]

Page 1 of 5
⇒ 𝑥 + 60 ≡ −53 + 60 (𝑚𝑜𝑑 10); [𝑠𝑖𝑛𝑐𝑒 60 ≡ 60 (𝑚𝑜𝑑 10)]
⇒ 𝑥 ≡ 7 (𝑚𝑜𝑑 10); [𝑠𝑖𝑛𝑐𝑒 60 ≡ 0 (𝑚𝑜𝑑 10)]
Hence the check digit is 7 as stated before and the complete UPC is 036000241457.

Q. Suppose that we receive two bit strings 1101111 and 11001000, where the last bit in each
sting is a parity check bit. Verify whether these strings are correct or not.
A. For the first sting, note that 1 + 1 + 0 + 1 + 1 + 1 + 1 = 6 ≡ 0 (mod 2), so that either this
string is what was transmitted or it contains an even number of errors. For the second string,
note that 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 = 3 ≡ 1 (mod 2), so that the received string was not the
actual string that was sent; there is surely at least one error or an odd number of errors in this
string.

PRACTICE: From the book of Rosen: Read article 5.5 (Page 209) and practice example 5.13
(page 210), Exercise 5.5 (page 212) – Problem no. 2, 3, 5, 6, 7, 8.

ISBN
Q. What is ISBN?
A. The International Standard Book Number (ISBN) is a numeric commercial book identifier
which is intended to be unique. Publishers purchase ISBNs from an affiliate of the International
ISBN Agency. When a book is published, it is assigned an ISBN. From 1970 until 2007, this
number consisted of a 10-digit number, but it now consists of a 13-digit number. For example,
the ISBN of the book UMAP Modules is 0-912843-07-1, but the ISBN of Dan Brown’s The
lost Symbol is 978-0-385-50422-5.

Q. How is an ISBN number determined?


A. An International Standard Book Number consists of 4 parts (if it is a 10 digit ISBN) or 5
parts (for a 13 digit ISBN):
(i) for a 13-digit ISBN, a prefix element - so far 978 or 979 are the only ones available
(ii) the registration group element, (language-sharing country group, individual country or
territory)
(iii) the registrant element,
(iv) the publication element, and
(v) a check digit.
In the 10-digit ISBN above, the first digit, 0, indicates that the book was published in an
English-speaking country; the digits 912843 represent the publisher (COMAP, Inc.); 07 are the

Page 2 of 5
identifying numbers that COMAP has assigned to the book; and the final digit, 1, is called the
check digit of the ISBN.

Q. How is the check digit of an ISBN number calculated?


A. For a 10-digit ISBN: If 𝑥10 denotes the check digit if an ISBN 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7 𝑥8 𝑥9 then
we must have
10𝑥1 + 9𝑥2 + 8𝑥3 + 7𝑥4 + 6𝑥5 + 5𝑥6 + 4𝑥7 + 3𝑥8 + 2𝑥9 + 𝑥10 ≡ 0 (𝑚𝑜𝑑 11)
10

𝑖. 𝑒. ∑(11 − 𝑖)𝑥𝑖 ≡ 0 (𝑚𝑜𝑑 11) (∗)


𝑖=1

Note that in (*), we used modulo 11 which implies that the value of the check digit 𝑥10 can not
only be any of the single digits from 0 to 9 but also it can be 10 [since when you divide a
number by 11, the remainder can be any number from 0 to 10]. Thus 0 ≤ 𝑥10 ≤ 10. But as
only one character is assigned for the check digit, we write 𝑥10 as a capital X when the value
of 𝑥10 is 10.
Note also that, you can compute the check digit 𝑥10 by another formula reversing the weights
of the digits in (*), that is,
1𝑥1 + 2𝑥2 + 3𝑥3 + 4𝑥4 + 5𝑥5 + 6𝑥6 + 7𝑥7 + 8𝑥8 + 9𝑥9 + 10𝑥10 ≡ 0 (𝑚𝑜𝑑 11)
10

𝑖. 𝑒. ∑ 𝑖 𝑥𝑖 ≡ 0 (𝑚𝑜𝑑 11) (∗∗)


𝑖=1

For a 13-digit ISBN: If 𝑥13 denotes the check digit if an ISBN 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7 𝑥8 𝑥9 𝑥10 𝑥11 𝑥12
then we must have
𝑥1 + 𝑥3 + 𝑥5 + 𝑥7 + 𝑥9 + 𝑥11 + 𝑥13 + 3(𝑥2 + 𝑥4 + 𝑥6 + 𝑥8 + 𝑥10 + 𝑥12 ) ≡ 0 (𝑚𝑜𝑑 10)
13 13

𝑖. 𝑒. ∑ 𝑥𝑖 + ∑ 3𝑥𝑖 ≡ 0 (𝑚𝑜𝑑 10) (∗∗∗)


𝑖=1 𝑖=1
𝑖 ≠ 𝑒𝑣𝑒𝑛 𝑖 ≠ 𝑜𝑑𝑑

Note that in (***), we used modulo 10 which implies that the value of the check digit 𝑥13 can
only be any one of the single digit from 0 to 9.

Q. Calculate the check digit of the ISBN 0-201-06561.


A. See example 5.14 of Rosen (Page 211)

Q. Check whether the check digit of the ISBN 91-825-6407-8 is correct or not. Transpose the
3rd and 4th digits (from left) of this ISBN and determine whether the check digit of the new
ISBN (i.e. 91-285-6407) remains the same as before.

Page 3 of 5
A. Try yourself. (Solution: Yes, correct. Check digit of the new ISBN is 3 which is not same
as before)
Note: You can try finding the check digit of any new ISBN formed by transposing any two
adjacent digits of the original ISBN. The check digits will always be different.

Q. Prove that both the formulae (*) and (**) produce the same check digit for a particular ISBN.
A. Hints: 10 ≡ −1 (𝑚𝑜𝑑 11), 9 ≡ −2 (𝑚𝑜𝑑 11), 8 ≡ −3 (𝑚𝑜𝑑 11) 𝑎𝑛𝑑 𝑠𝑜 𝑜𝑛.

THEOREM: The check digit in a 10-digit ISBN will always change if


a) one digit of the number is changed, or
b) two digits (if they are different) of the number are interchanged.

PROOF: If 𝑎1 𝑎2 … … 𝑎9 are the first 9 digits of an ISBN, then the check digit 𝑎10 can be
determined by the formula ∑10 𝑖=1 𝑖 𝑎𝑖 ≡ 0 (𝑚𝑜𝑑 11) or equivalently 𝑎10 ≡
9
∑𝑖=1 𝑖 𝑎𝑖 (𝑚𝑜𝑑 11).
We begin with part (a). Suppose that for some j satisfying 1 ≤ 𝑗 ≤ 9, we change 𝑎𝑗 to 𝑏, where
0 ≤ 𝑎𝑗 , 𝑏 ≤ 9 𝑎𝑛𝑑 𝑎𝑗 ≠ 𝑏. For the check digit to remain unchanged, the old and new check
sums must be equal mod 11. Since the only difference between the two check sums occurs at
the 𝑗 𝑡ℎ term, this means that
𝑗𝑎𝑗 ≡ 𝑗𝑏 (𝑚𝑜𝑑 11)

Therefore it follows that 11 | (𝑗𝑎𝑗 − 𝑗𝑏), i.e. 11 | 𝑗(𝑎𝑗 − 𝑏) and since 11 is a prime, this means
that either 11 | 𝑗 or 11 | (𝑎𝑗 − 𝑏). Because 1 ≤ 𝑗 ≤ 9, it’s clear that 11 doesn’t divide 𝑗. Thus,
we must have 11 | (𝑎𝑗 − 𝑏), i.e. 𝑎𝑗 ≡ 𝑏 (𝑚𝑜𝑑 11). However, since 0 ≤ 𝑎𝑗 , 𝑏 ≤ 9, we can have
𝑎𝑗 ≡ 𝑏 (𝑚𝑜𝑑 11) only when 𝑎𝑗 = 𝑏 which contradicts our assumption that 𝑎𝑗 ≠ 𝑏. Thus if
𝑎𝑗 ≠ 𝑏, the check digit can never remain same.

The proof of part (b) is similar as that of (a). Suppose that the digits 𝑎𝑗 and 𝑎𝑘 are interchanged,
where 1 ≤ 𝑗, 𝑘 ≤ 9, 0 ≤ 𝑎𝑗 , 𝑎𝑘 ≤ 9, 𝑗 ≠ 𝑘 𝑎𝑛𝑑 𝑎𝑗 ≠ 𝑎𝑘 (since, if 𝑎𝑗 = 𝑎𝑘 , then the ISBN
won’t change). Now again for the check digit to remain unchanged, the old and new check
sums must be equal mod 11. Since these two ISBN numbers only differ in the 𝑗 𝑡ℎ and 𝑘 𝑡ℎ
position and all other digits are same, so the two check sums will be equal mod 11 iff
𝑗𝑎𝑗 + 𝑘𝑎𝑘 ≡ 𝑗𝑎𝑘 + 𝑘𝑎𝑗 (𝑚𝑜𝑑 11)

𝑜𝑟, 𝑗(𝑎𝑗 − 𝑎𝑘 ) ≡ 𝑘(𝑎𝑗 − 𝑎𝑘 ) (𝑚𝑜𝑑 11)

Equivalently, 11 | {𝑗(𝑎𝑗 − 𝑎𝑘 ) − 𝑘(𝑎𝑗 − 𝑎𝑘 )}, i.e. 11 | (𝑗 − 𝑘)(𝑎𝑗 − 𝑎𝑘 ). Since 11 is a prime,

either 11 | (𝑗 − 𝑘) or 11 | (𝑎𝑗 − 𝑎𝑘 ). [Rest of the proof is left as an exercise.]

Page 4 of 5
Note: This theorem can also be stated differently as a problem, e.g., ‘Show that in a 10-digit
ISBN, a single digit error or a transposition of any two different digits can always be detected
using the check digit’.

PRACTICE: Rosen (Page 213): Exercise 5.5 – Problem no. 9 to 13.

Page 5 of 5

You might also like