The Mathematics
of Barcodes

Cracking Barcodes
The UPC a Scheme
Coding Errors
Appendices
Credits




Student CopyTeacher Copy

Activity 3: Coding Errors
(Teacher Copy)

Activity Summary

Students will

  1. use problem-solving skills to solve a problem involving with modular arithmetic (mod 10),
  2. find the probability of missing a coding error, and
  3. investigate the base-2 number system.
Use with the student copy and the reference sheet from Activity 1.


Introduction:

[Have students come up with a definition for probability.  Then refer them to the reference sheet for a definition]  What is transposition?  [Refer to definition on the reference sheet]  [Discuss how to transform numbers from base-10 to the base-2 number system.  See also the reference sheet]


Objectives

  • To investigate one of the errors that can occur in a bar code system.
  • To investigate the probability that a transposition error will not be detected.
  • To investigate the binary number system.

Answer Key

Part A

  1. Ordered pairs that go undetected are: (0,5); (1,6); (2,7);...(9,4)--a total of 10 pairs.  There are many different 2-digit numbers that the students will have to consider (10 numbers to choose from for each of the two digits, making a total of 10 x 10 or 100 permutations of numbers).  However, groups will not even have to consider the possibility of an error of transposition if the two digits are identical.  Thus, the number of possible permutations of numbers that have an opportunity to be transposed is 10 x 9 = 90.  These pairs all fit the equation |a - b| = 5

    Because of the differences in learning styles of students some groups may approach this problem in a very disorganized looking trial-and-error format, some may use an organized list or table, and some may try to use a mod 10 congruence statement to find the kinds of numbers that would give the same mod 10 value despite being transposed.

  2. There are 10 numbers to choose from for each of the two digits, making a total of 10 x 10 or 100 permutations of numbers for the two digits in question, with one exception.  There is no possibility of an error of transposition if the two digits are identical.  Thus, the number of possible permutations of numbers that have an opportunity to be transposed is 10 x 9 = 90.  For each number "a" that is chosen, a unique number "b" can be chosen that satisfies the absolute value condition.  Ordered pairs that go undetected are: (0,5); (1,6); (2,7);...(9,4)--a total of 10 pairs.  Therefore, the probability of an error of transposition in the UPC-A system is 10/90 or 1/9 or 11.1%.  The IBM system has problems only with ordered pairs (0,9) and (9,0).  Thus, the probability of an error not being detected is 2/90 or 2.2%.

Part B
 
Number value Left characters (odd parity)  Base 10  Right characters  (even parity)  Base 10 
0 0001101 13 1110010  114
0011001 25 1100110  102
0010011  19 1101100  108
0111101  61 1000010  66
0100011 35 1011100 92
0110001  49 1001110  78
0101111  47 1010000  80
0111011  59 1000100 68
8 0110111 55 1001000  72
9 0001011  11 1110100 116
GUARD BARS  101 5 101  5
CENTER                            01010 

Discussion

Have students speculate on an encoding scheme that would remedy the problem created by the undetected transposition errors.

Have students discover the complement rule of probability by asking them to find the success rate for detecting errors of transposition.  See R1, page 1.

What do you notice about the pattern of the answers to Part B?  Students might observe that the two numbers in base 10 for each encoding add to 127 (base 10).  They might notice that there are always a total of 7 "ones" and 7 "zeros" for each code.  Students might see that between the two binary numbers in the left and right parity there is always one-and-only-one "one" in each of the seven base 2 places.  Thus, the total for the two numbers in base 10 would necessarily consist of 1 sixty-four, 1 thirty-two, 1 sixteen, 1 eight, 1 four, 1 two, and 1 one.




© 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_t3.htm