The Mathematics
of Barcodes

Cracking Barcodes
The UPC a Scheme
Coding Errors
Appendices
Credits




Student CopyTeacher CopyReference Copy

Activity 1: Cracking Barcodes
(Teacher Copy)

Activity Summary

Students are made aware of the UPC-A and IBM bar coding systems, and use modular arithmetic to understand the meaning of the code numbers.

Introduction:

You may have noticed that many things you buy come with a bar code.  These activities will help you decipher such codes.  What is clock or modular arithmetic?  Look at the student copy for a definition.  Put this definition in your own words.  What does congruent mean? Again, look at the student copy and put the definition in your own words.  [Go over the reference sheet with students.]

Objectives

  • To determine the validity of bar code numbers.
  • To calculate the 12th digit (check number) for the UPC-A numbering system which is left off of many products. 
  • To discover the mathematics involved in the IBM bar coding system.
Answer Key

Part A

  1. 18 divided by 5 has remainder 3.  18 is congruent (mod 5) to 8, 13, 23 and many others.
  2. 26 divided by 11 has remainder 4.  26 is congruent (mod 11) to 15, 37, 48, and many others.
  3. 057627529316 is not a valid number.  3(0 + 7 + 2 + 5 + 9 + 1) + (5 + 6 + 7 + 2 + 3 + 6) = 3(24) + (29) = 72 + 29 = 101 º 1 (mod 10).
  4. All three 12 digit codes on the reference sheet are valid.
  5. Answers will vary.

Part B

11-Digit Number Calculated
Check number
Check Number
from Table
01258760032 0 0
41606135119 5 5
02429115081 7 7

Part C

  1. Answers will vary.

  2. Not a valid IBM code number.  For 345678921, which has an odd number of digits, the congruence statement is

    3 + 8 + 5 + 3 + 7 + 7 + 9 + 4 + 1 º 0 (mod 10). 

    Since the sum of the left-hand side, 47, is not congruent to 0, the number 345678921 is not a valid IBM code number

  3. C = 6.  For 9776827468C, which has an odd number of digits, the congruence statement is

    9 + 5 + 7 + 3 + 8 + 4 + 7 + 8 + 6 + 7 + C º 0 (mod 10). 

    This simplifies to 64 + C º 0.

  4. C = 2.  For 320053461C, which has an even number of digits, the congruence statement would be

    6 + 2 + 0 + 0 + 1 + 3 + 8 + 6 + 2 + C º 0 (mod 10). 

    This simplifies to 28 + C º 0 (mod 10).

  5. Answers will vary.

Discussion

After Part C, #5 is completed, compile results from the entire class to find the percentage of valid UPC-A numbers chosen by randomly selecting 12 digits numbers.


© Copyright
Area 10 Mathematics and Technology Professional Development Center
Permission is granted to duplicate these materials for classroom use.

Last updated on 1/30/1999
Comments: egalindo@indiana.edu
http://www.indiana.edu/~atmat/units/barcodes/bar_t1.htm