Chapter 9b. Applications of Modular Arithmetic
Chapter 9b. Applications of Modular Arithmetic
MATHEMATICS
AS A TOOL
CHAPTER 9.
Mathematical System–
Applications
of Modular Arithmetic
learning objectives
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
Exercises:
Determine the correct digit for the UPC.
a. Scrabble
6-53569-39973-?
b. Beethoven’s 9th Symphony, DVD
0-32031-13439-?
c. T1-84 Silver Edition Calculator
0-33317-20083-?
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
o 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
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
Exercises:
Page 310 Exercise Set – Item # 7
Page 312 Extensions – Item #65a #65b
#65c
End of Discussion…