Chapter 9b. Applications of Modular Arithmetic
Chapter 9b. Applications of Modular Arithmetic
Mathematical System–
Applications
of Modular Arithmetic
learning objectives
• It is consisting of 13 digits.
!" , !$ , !%, - 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
…
Example:
The ISBN for the fourth edition of the American Heritage Dictionary is
978-0-395-82517-4. Suppose, how-ever, 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.
Correct ISBN: 978-0-395-82517-4
Incorrect ISBN: 978-0-395-28517-4
THE ISBN
Formula for the ISBN Check Digit
!"# = "% − !" + #!( + !# + #!) + !* + #!+ + !, + #!- + !. + #!"% + !"" + #!"( /01 "%
If !"# = "% , then the check digit is 0.
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-?.
Formula for the ISBN Check Digit
!"# = "% − !" + #!( + !# + #!) + !* + #!+ + !, + #!- + !. + #!"% + !"" + #!"( /01 "%
If !"# = "% , then the check digit is 0.
Solution: 978-0-7432-5820-?.
234 = 10 − (9 + 7 3 + 8 + 0 3 + 7 + 4 3 + 3 + 2 3 +
5 + 8 3 + 2 + 0(3)) mod 10
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.
Formula for the ISBN Check Digit
!"# = "% − !" + #!( + !# + #!) + !* + #!+ + !, + #!- + !. + #!"% + !"" + #!"( /01 "%
If !"# = "% , then the check digit is 0.
234 = 10 − (9 + 7 3 + 8 + 0 3 + 7 + 6 3 + 0 + 7 3 +
3 + 2 3 + 6 + 1(3)) mod 10
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-?
Solution: 7-86936-79798-?
234 = 10 − (7 3 + 8 + 6 3 + 9 + 3 3 + 6 + 7 3 +
9 + 7 3 + 9 + 8(3)) mod 10
234 = 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.
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?
End of Discussion…