You are on page 1of 16

Our lady of Fatima university

COLLEGE OF ARTS AND SCIENCES


Math and Physics Department
Pampanga Campus

MATM111
MATHEMATICS AS A TOOL:
Check Digits and Check Codes
Engr. Dave Joseph V. Gangcuangco
Lecturer
V. Mathematics as a Tool: Check Digits and Check Codes

5.1 5.2. 5.3. Check


Coding Theory Cryptography Codes and
and Modular Digits
Arithmetic

Learning Outline
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
There are several methods in producing
identification numbers which are unique. In the following
methods, modular arithmetic is used to produce and
verify identification numbers.
The examples are;
• the Universal Product Code (UPC),
• United States Postal Services (USPS),
• the Credit Card, and
• the International Standard Book Number.
Each examples uses their last digit as the check
digits to verify the identification number.
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
CHECK CODES AND DIGITS
• The Universal Product Code
(UPC) is mainly used in
products sold in department
stores and groceries. The UPC
consists of barcodes with 12
digits where the last one is
the check digit.
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
CHECK CODES AND DIGITS
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
CHECK CODES AND DIGITS
• The International Standard Book
Number (ISBN) is used on books
where usually found at the last
page of the book. ISBN can be
ISBN-10 or ISBN-13 where they
used 10 digits or 13 digits string
of number respectively with the
last digit as the check digit.
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
CHECK CODES AND DIGITS
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
CHECK CODES AND DIGITS
• Lastly, the United States
Postal Services (USPS) is
consisting of 11 digits, while
the Credit Card uses 16 digits
where both of them uses
their last digits as the check
digits.
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
FORMULAS FOR THE CHECK DIGITS
i] UNIVERSAL PRODUCT CODE (UPC)
CHECK DIGIT : d12
d12= 10 – [(3d1 +d2 + 3d3 + d4 +3d5 +d6 + 3d7 + d8 + 3d9 + d10 + 3d11)(mod10)]

ii] INTERNATIONAL STANDARD BOOK NUMBER (ISBN-10)


CHECK DIGIT : d10
d10 = 11- [(10d1 + 9d2 + 8d3 + 7d4 + 6d5 + 5d6 + 4d7 +3d8 +2d9 )(mod 11)]
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
FORMULAS FOR THE CHECK DIGITS
iii] INTERNATIONAL STANDARD BOOK NUMBER (ISBN-13)
CHECK DIGIT : d13
d13= 10 – [(d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 +3d8 + d9 + 3d10 + d11 + 3d12 )(mod10)]

iv] UNITED STATES POSTAL SERVICES (UPS)


CHECK DIGIT : d11
d11 = 9 – [(d1 +d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 )(mod 9)]
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
FORMULAS FOR THE CHECK DIGITS
v] CREDIT CARD
CHECK DIGIT : d16
d16 = 10 – [(2d1 +d2 +2d3 +d4 +2d5 +d6 +2d7 +d8 +2d9 +d10 +2d11 +d12 +2d13 +d14
+2d15 )(mod10)]

***NOTE : ADD ALL THE DIGITS, TREATING THE TWO-DIGIT NUMBERS AS TWO SINGLE DIGITS.
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
Determine the check digit for a new product if the first 11
digits are 8-21345-67132- .
UNIVERSAL PRODUCT CODE (UPC)
CHECK DIGIT : d12
d12= 10 – [(3d1 +d2 + 3d3 + d4 +3d5 +d6 + 3d7 + d8 + 3d9 + d10 + 3d11)(mod10)]

d12 = 10 - [(3 x 8) + 2 + (3 x 1) + 3 + (3 x 4) + 5 + (3 x 6) +7 + (3 x 1) + 3 + (3 x 2)]mod10


d12 = 10 - [ 24 +2 + 3 + 3 + 12 + 5 + 18 +7 + 3 +3 + 6 ]mod10
d12 = 10 - (86mod10)
d12 = 10 - 6
d12 = 4
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
Determine the check digit of a book with an ISBN-10 digits 0f
0-17-316444-_____.
ii] INTERNATIONAL STANDARD BOOK NUMBER (ISBN-10)
CHECK DIGIT : d10
d10 = 11- (10d1 + 9d2 + 8d3 + 7d4 + 6d5 + 5d6 + 4d7 +3d8 +2d9 )(mod 11)

d10 = 11 - [(10 x 0) + (9 x 1) + (8 x 7) + (7 x 3) + (6 x 1) + (5 x 6) + (4 x 4) + (3 x 4) + (2 x 4)]mod11


d10 = 11 - [ 0 +9 + 56 + 21 + 6 + 30 + 16 +12 + 8 ]mod11
d10 = 11 - (158mod11)
d10 = 11 - 4
d10 = 7
CODES AND CRYPTOGRAPHY
Check Codes and Check Digits
Verify if the given Credit Card identification number
4301-1234-8888-3751 is valid.
v] CREDIT CARD
CHECK DIGIT : d16
d16 = 10 – (2d1 +d2 +2d3 +d4 +2d5 +d6 +2d7 +d8 +2d9 +d10 +2d11 +d12 +2d13 +d14 +2d15 )(mod10)

d16 = 10 - [(2 x 4) + 3 + (2 x 0) + 1 + (2 x 1) + 2 + (2 x 3) +4 + (2 x 8) + 8 + (2 x 8) + 8 + (2 x 3) + 7 + (2 x 5)]mod10


d16 = 10 - [ 8 +3 + 0 +1 + 2 +2 + 6 +4 + 16 + 8 + 16 +8 +6 +7 + 10]mod10
d16 = 10 - [ 8 +3 + 0 +1 + 2 +2 + 6 +4 + 1+6 + 8 + 1+6 +8 +6 +7 + 1+0]mod10
d16 = 10 - (70mod10)
d16 = 10 - 0 Therefore, the credit card is VALID.
d16 = 1 + 0
d16 = 10 d16 = 1

You might also like