Applications of Modular Arithmetic (ISBN & UPC)
Applications of Modular Arithmetic (ISBN & UPC)
Every book that is cataloged in the Library of Congress must be ISBN (International Standard
Book Number). This 13-digit number was created to help ensure that orders for book are filled
accurately and that books are catalogued correctly.
The first three digits of ISBN are 978 (or 979), followed by 9 digits that are divided into three
groups of various lengths. These indicate the country or region, the publisher, and the title of the of the
book. The last digit (the 13th one) is called the check digit.
If we label the first digit of an ISBN d 1, the second digit d 2, and so on to the 13th digit d 13, then
the check digit is given by the following modular formula.
d 13=10−( d 1 +3 d 2+ d 3+ 3 d 4 +d 5 +3 d 6 +d 7 +3 d 8 +d 9 +3 d 10 +d 11 +3 d 12 ) mod 10
It is this check digit that is used to ensure accuracy. For instance, the ISBN for the fourth edition of
American Heritage Dictionary is 978−0−395−82517−4 . Suppose, however, that a bookstore clerk
sends an order for the American Heritage Dictionary and inadvertently enters the number
978−0−395−28517−4 , where the clerk transposed the 8 and 2 in the five numbers that identify the
book.
¿ 10−124 mod 10
¿ 10−4=6
Because the check digit is 6 and not 4 as it should be, the receiving clerk knows that an incorrect ISBN
has been sent. Transposition errors are among the most frequent errors that occur. The ISBN coding
system will catch most of them.
Solution:
¿ 10−97 mod 10
¿ 10−7=3
The check digit is 3.
Try this! A purchase order for the book The Mathematical Tourist by Ivars Peterson includes the ISBN
978-0-716-73250-5. Determine whether this is a valid ISBN.
Another coding scheme that is closely related to ISBN is the UPC (Universal Product Code). This number
is place on many items and is particularly useful in grocery stores. A check-out clerk passes the product
by a scanner, which reads the number from a bar code and records the price on the cash register .if the
price of an item changes for a promotional sale, the price is updated in the computer, thereby relieving
a clerk of having to reprice each item. In addition to pricing items, the UPC gives the store manager
accurate information about inventory and the buying habits of the store’s costumers.
The UPC is a 12-digit number that satisfies a modular equation that is similar to the one for ISBNs. The
last digit is the check digit. If we label the 12 digits of the UPC as d 1 , d 2 , … , d 12 , we can write a formula
for the UPC check digit d 12.
Find the check digit for the UPC of the Blu-ray Disc release of the film Jurassic World. The first 11 digits
are 0-25192-21221-?
Solution:
¿ 10−65 mod 10
¿ 10−5=5
The check digit is 5.
The ISBN and UPC coding systems will normally catch transposition errors. There are instances,
however, when they do not.
The UPC for Crisco Puritan Canola Oil with Omega-DHA is 0-51500-24275-9
Suppose, however, that the product code is written 0-51500-24725-9, where 2 and 7 have been
transposed. Calculating the check digit, we have
Companies that issue credit cards also use modular arithmetic to determine whether a credit number is
valid. This is especially important in e-commerce, where credit card information is frequently sent over
the Internet. The primary coding method is based on the Luhn algorithm, which uses mod 10 arithmetic.
Credit card numbers are normally 13 to 16 digits long. The first one to six are used to identify the card
issuer. The table below shows some of the identification prefixes used by four popular card issuers.
The Luhn Algorithm, used to determine whether a credit card is valid, is calculated as follows: Beginning
with the next-to-last digits (the last digit is the check digit) and reading from right to left, double every
other digit. If a digit becomes a two-digit number after being doubled, treat the number as two
individual digits. Now find the sum of the new list of digits; the final sum must be congruent to 0 mod 10
. The Luhn Algorithm is demonstrated in the next example.
Solution:
Highlight every other digit, beginning with the next-to-last digit and reading from right to left.
5 2 3 4 8 2 1 3 3 4 1 0 1 2 9 8
10 2 6 4 16 2 2 3 6 4 2 0 2 2 18 8
Finally, add all digits, treating two-digit number as two single digits.
Try this! Is 6011 0123 9145 2317 a valid credit card number?
Prepared by: