SECTION 2
MATHEMATICS
AS A TOOL
CHAPTER 9.
Mathematical System:
Applications of Modular Arithmetic
Learning Objectives
1. discuss variety of applications of modular
arithmetic; and
2. solve problems involving modular arithmetic.
International Standard Book Number (ISBN)
Every book that is cataloged in the National Library has
an International Standard Book Number (ISBN) which
consists of 13-digit numbers.
𝒅𝟏 , 𝒅𝟐 , 𝒅𝟑 - first digit – composed of 978
𝒅𝟒 - next digit – indicates the country in which the
publisher is incorporated (either 0 or 1)
- next two to seven digits – indicate publisher
- next group of digits – indicates the title of
…
the book
𝒅𝟏𝟑 - last digit (13th digit) – is called check digit
International Standard Book Number (ISBN)
Formula for the ISBN Check Digit
𝒅𝟏𝟑 = 𝟏𝟎 − 𝒅𝟏 + 𝟑𝒅𝟐 + 𝒅𝟑 + 𝟑𝒅𝟒 + 𝒅𝟓 + 𝟑𝒅𝟔 + 𝒅𝟕 + 𝟑𝒅𝟖 + 𝒅𝟗 + 𝟑𝒅𝟏𝟎 + 𝒅𝟏𝟏 + 𝟑𝒅𝟏𝟐 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟑 = 𝟏𝟎 , then the check digit is 0.
It is this check digit that is used to ensure accuracy.
Example:
The ISBN for the fourth edition of the 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.
International Standard Book Number (ISBN)
Formula for the ISBN Check Digit
𝒅𝟏𝟑 = 𝟏𝟎 − 𝒅𝟏 + 𝟑𝒅𝟐 + 𝒅𝟑 + 𝟑𝒅𝟒 + 𝒅𝟓 + 𝟑𝒅𝟔 + 𝒅𝟕 + 𝟑𝒅𝟖 + 𝒅𝟗 + 𝟑𝒅𝟏𝟎 + 𝒅𝟏𝟏 + 𝟑𝒅𝟏𝟐 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟑 = 𝟏𝟎 , then the check digit is 0.
It is this check digit that is used to ensure accuracy.
Example:
Determine the ISBN check digit for the book The Equation
that Couldn't Be Solved by Mario Livio. The first 12 digits of
the ISBN are 978-0-7432-5820-?.
International Standard Book Number (ISBN)
Formula for the ISBN Check Digit
𝒅𝟏𝟑 = 𝟏𝟎 − 𝒅𝟏 + 𝟑𝒅𝟐 + 𝒅𝟑 + 𝟑𝒅𝟒 + 𝒅𝟓 + 𝟑𝒅𝟔 + 𝒅𝟕 + 𝟑𝒅𝟖 + 𝒅𝟗 + 𝟑𝒅𝟏𝟎 + 𝒅𝟏𝟏 + 𝟑𝒅𝟏𝟐 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟑 = 𝟏𝟎 , then the check digit is 0.
It is this check digit that is used to ensure accuracy.
Example:
A purchase order for the book The Mathematical Tourist
by Ivars Peterson includes the ISBN 978-0-760-73261-6.
Determine whether this is a valid ISBN.
UNIVERSAL CODE PRODUCT (UPC)
UPC (Universal Product Code) is a number placed on
many items and is particularly useful in grocery.
UPC gives the store manager accurate information about
inventory and the buying habits of the store’s customers.
The UPC is a 12-digit number that satisfies a congruence
equation that is similar to the one for ISBNs.
Formula for the UPC Check Digit
𝒅𝟏𝟐 = 𝟏𝟎 − 𝟑𝒅𝟏 + 𝒅𝟐 + 𝟑𝒅𝟑 + 𝒅𝟒 + 𝟑𝒅𝟓 + 𝒅𝟔 + 𝟑𝒅𝟕 + 𝒅𝟖 + 𝟑𝒅𝟗 + 𝒅𝟏𝟎 + 𝟑𝒅𝟏𝟏 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟐 = 𝟏𝟎 , then the check digit is 0.
UNIVERSAL CODE PRODUCT (UPC)
Formula for the UPC Check Digit
𝒅𝟏𝟐 = 𝟏𝟎 − 𝟑𝒅𝟏 + 𝒅𝟐 + 𝟑𝒅𝟑 + 𝒅𝟒 + 𝟑𝒅𝟓 + 𝒅𝟔 + 𝟑𝒅𝟕 + 𝒅𝟖 + 𝟑𝒅𝟗 + 𝒅𝟏𝟎 + 𝟑𝒅𝟏𝟏 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟐 = 𝟏𝟎 , then the check digit is 0.
Example:
1. Find the check digit for the DVD release of the film
Alice in Wonderland if the first 11 digits are 7-86936-
79798-?
2. Is 1-32342-65933-9 a valid UPC?
UNIVERSAL CODE PRODUCT (UPC)
Formula for the UPC Check Digit
𝒅𝟏𝟐 = 𝟏𝟎 − 𝟑𝒅𝟏 + 𝒅𝟐 + 𝟑𝒅𝟑 + 𝒅𝟒 + 𝟑𝒅𝟓 + 𝒅𝟔 + 𝟑𝒅𝟕 + 𝒅𝟖 + 𝟑𝒅𝟗 + 𝒅𝟏𝟎 + 𝟑𝒅𝟏𝟏 𝐦𝐨𝐝 𝟏𝟎
If 𝒅𝟏𝟐 = 𝟏𝟎 , then the check digit is 0.
Exercises:
Determine the correct digit for the UPC.
a. Scrabble
6-53569-39973-? Ans.: 5
b. Beethoven’s 9th Symphony, DVD
0-32031-13439-? Ans.: 3
a. T1-84 Silver Edition Calculator
0-33317-20083-? Ans.: 5
CREDIT CARD NUMBERS
Companies that issue credit cards also use modular
arithmetic to determine whether a credit card number is
valid.
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 four digits are used to identify the card
issuer.
LUHN ALGORITHM
It is used to determine whether a credit card
number is valid and is calculated as follows:
1. Beginning with the next-to-last digit (the last digit is
the check digit) and reading from right to left,
double every other digit.
2. If a digit becomes a 2-digit number after being
doubled, treat the number as two individual digits.
3. Find the sum of the new list of digits; the final sum
must be congruent to 0 mod 10.
Example:
Determine whether 5234 8213 3410 1298 is a valid
credit card number.
LUHN ALGORITHM
Example:
Determine whether 5234 8213 3410 1298 is a valid credit
card number.
DIGIT 5 2 3 4 8 2 1 3 3 4 1 0 1 2 9 8
Weight 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1
Product 1 2 6 4 7 2 2 3 6 4 2 0 2 2 9 8
The sum is 60
Hence, the credit card number is valid.
LUHN ALGORITHM
It is used to determine whether a credit card
number is valid and is calculated as follows:
1. Beginning with the next-to-last digit (the last digit is
the check digit) and reading from right to left,
double every other digit.
2. If a digit becomes a 2-digit number after being
doubled, treat the number as two individual digits.
3. Find the sum of the new list of digits; the final sum
must be congruent to 0 mod 10.
Example:
Is 6011 0123 9145 2317 a valid credit card number?
LUHN ALGORITHM
Example:
Is 6011 0123 9145 2317 a valid credit card number?
DIGIT 6 0 1 1 0 1 2 3 9 1 4 5 2 3 1 7
Weight 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1
Product 3 0 2 1 0 1 4 3 9 1 8 5 4 3 2 7
The sum is 53
Hence, the credit card number is invalid.
End of Discussion…