0% found this document useful (0 votes)
320 views

Checking Digits and Codes

The document discusses the use of modular arithmetic to generate and verify check digits for identification numbers. It provides examples of check digit formulas for common identification systems like UPC, ISBN, USPS postal codes, and credit cards. The formulas involve taking the digits of the number, multiplying them by weighted values, taking the result modulo 10 or 11, and subtracting from the modulus to get the check digit. The document then works through examples of applying the formulas to generate check digits for new identification numbers and verify existing numbers.

Uploaded by

Tawki Baki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
320 views

Checking Digits and Codes

The document discusses the use of modular arithmetic to generate and verify check digits for identification numbers. It provides examples of check digit formulas for common identification systems like UPC, ISBN, USPS postal codes, and credit cards. The formulas involve taking the digits of the number, multiplying them by weighted values, taking the result modulo 10 or 11, and subtracting from the modulus to get the check digit. The document then works through examples of applying the formulas to generate check digits for new identification numbers and verify existing numbers.

Uploaded by

Tawki Baki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

MATHEMATICS AS A TOOL:

Checking Digits and Codes

Math & Physics Department MATM 111


MODULAR ARITHMETIC

MATM111 – Mathematics in the Modern World


MODULAR ARITHMETIC
In symbols: a ≡ b (mod m) where m is
greater than zero
Congruence if the difference of
a and b is divisble by m.

When b divides by m, then


r ≡ b (mod m),
r is the least residue remainder (r) =
𝒂−𝒃
or
𝒃−𝒂
= zero
𝒎 𝒎
(remainder)
VERIFY IF THE CONGRUENCE ARE TRUE

TRUE congruence if r is divisible by m

1.) 7 ≡ 9 (mod 2) TRUE

2.) 7 ≡ 15 (mod 3) not TRUE

3.) 19 ≡ 15 (mod 4) TRUE


HOW TO SOLVE THE LEAST RESIDUE

b divides m, then get the remainder:

Find the least residue (r) of the following:


1. 19 (mod 3) 1
2. 45 (mod 4) 1
3. 80 (mod 7) 3
4. 20 (mod 2) 0
EVALUATING MODULAR ARITHMETIC:
Perform the indicated operation
Divide the result by the mod
Then find the residue

Solve the following modular arithmetic:


1. 90 – 4 (mod 5) 1
2. 21 + 7 (mod 3) 1
3. 18+ 6 (mod 7) 3
CHECK DIGITS AND CHECK CODES

MATM111 – Mathematics in the Modern World


1. Universal Product Code (UPC)
2. International Standard Book Number (ISBN)
3. United States Postal Services (USPS)
4. Credit Card (CC)
There are several methods in
producing identification numbers which
are unique. Modular arithmetic is used
to produce and verify identification
numbers.
1. UPC – UNIVERSAL PRODUCT CODE

It is mainly used in products sold in department


stores and groceries. The UPC consists of barcodes
with 12 digits where the last one digit is the check
digit.

Check Digit Formula:


d12 = 10 – (3d1 + d2 + 3d3 + d4 + 3d5 + d6 + 3d7 + d8 + 3d9 + d10 + 3d11) (mod 10)
2. ISBN – INTERNATIONAL STANDARD BOOK NUMBER

It is used on books where usually found at the last


page of the book. ISBN can be ISBN-10 or ISBN-13
where the 10 digits or 13-digits string of numbers
respectively with the last digit is the check digit.
ISBN – 10 AND ISBN-13

Check Digit Formula:


d10 = 11 – (10d1 + 9d2 + 8d3 + 7d4 + 6d5 + 5d6 + 4d7 + 3d8 + 2d9) (mod 11)

d13 = 10 – (d1 +3d2 +d3 +3d4 +d5 +3d6 +d7 +3d8 +d9 +3d10 +d11 +3d12) (mod 10)
3. USPS – UNITED STATES POSTAL SERVICES

Consist of 11 digits, the last digit is the check digit.

Check Digit Formula:


d11 = 9 – (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 ) (mod 9)
CC – CREDIT CARD
Consist of 16 digits, the last digit is the check digit.

Check Digit Formula:


d16 = 10 – (2d1 + d2 + 2d3 + d4 + 2d5 + d6 + 2d7 + d8 + 2d9 + d10 + 2d11 + d12 + 2d13 +
d14 + 2d15 )(mod 10)

*Note: Add all the digits, treating the two-digit numbers as two single digit.
Example 1: UPC
Determine the check digit for a new product given that the first 11
digits are 8 2 1 3 - 4 5 6 7 - 1 3 2 X
Example 2: UPC
Determine the check digit for a new product given that the first 11
digits are 9 2 1 3 - 7 5 46 - 1 8 2 X
Example 3: UPC
Determine the check digit for a new product given that the first 11
digits are 8712-5349 -981X
Example 4: ISBN
Determine the check digit of book with an ISBN-10: first 9 digits are 0173-1644- 4X
Example 5: ISBN
Determine the check digit of book with an ISBN-10: first 9 digits are 1273-8634- 5X
Example 6: ISBN
Determine the check digit of book with an ISBN-13: first 12 digits are 1273-8634- 5143- X
Example 7: CC (Bank Card)
Verify the last digit

?
Example 8: CREDIT CARD
Determine the check digit of a credit card: first 15 digits are 1273 8634 5123 187X
END SESSION
Synchronous Learning
Thank you so much.
Keep safe everyone!

You might also like