![]() The Mathematics of Barcodes |
|
Activity 1: Cracking Barcodes
Part ASee the definition for modular arithmetic on the reference sheet. Modular arithmetic deals with numbers that are congruent based on their remainder with respect to a particular divisor. For example, 7 º 13 (mod 3) because 7 and 13 divided by 3 both have a remainder of 1.
3a1+a2+3a3+a4+3a5+a6+3a7+a8+3a9+a10+3a11+a12 º 0 (mod 10). Another way of stating the above congruence relationship is to say that 3 times the sum of the digits in the odd positions plus the sum of the digits in the even positions is congruent to 0 (mod 10). For example, to check the validity of the UPC-A number 065961100602, calculate 3(0 + 5 + 6 + 1 + 0 + 0) + (6 + 9 + 1 + 0 + 6 + 2) = 3(12) + (24) = 36 + 24 = 60 º 0 (mod 10). Therefore, it is a valid number.
Part BThe 12th number of the UPC-A system is the check number. It is the one that makes the whole 12-digit scheme fit the condition that"3 times (the sum of the digits in the odd positions) + (the sum of the digits in the even positions) º 0 (mod 10)." Look at the reference sheet, to find the definition of congruence (). All of the other digits are used to identify the manufacturer and product while the 12th digit is designed to simply "make up the difference" in mod 10. Consider the bar code number 06592143210. The equation to find the check number is: 3(0 + 5 + 2 + 4 + 2 + 0) + (6 + 9 + 1 + 3 + 1 + C) º 0 (mod 10). C represents the check number. Next, the equation is simplified:
3(13) + (20 + C) º 0 (mod 10)However, while the check digit is always bar coded in the UPC-A system, it is not always written on the product in numerical form. Use the bar codes on the reference sheet where the 12th digit is missing. Your group's task will be to find the missing check digit. Fill in the table below. First, find the 12th digit mathematically. Then, check your answer by reading the widths of the bars and spaces of the bar code and look up the number on the right hand code chart (see the reference sheet).
Part CThe IBM code is a more complicated but also more error-proof than the UPC-A system. Like the UPC-A coding scheme, it also includes a check number as its last digit and it uses mod 10 arithmetic to arrive at this number. However, instead of a simple system of multiplying all of the odd digits by three, adding them to the sum of all of the even digits, and setting that sum congruent to zero (mod 10), the IBM scheme utilizes a permutation for encoding. The congruence statement for a code with an even number of digits is(a1) + a2 + (a3) + a4 + ... + (an-1) + an º 0 (mod 10), where s maps numbers according to an encoding scheme and the alternate digits are unchanged. If the number of digits in the bar code is odd, s is applied to the even numbered positions instead of the odd positions as shown above. Find the definition of permutation on the reference sheet. For this activity, use the permutation (0)(124875)(36)(9) which means that 0 ® 0, 1 ® 2, 2 ® 4, 4 ® 8, 8 ® 7, 7 ® 5, 5 ® 1, 3 ® 6, 6 ® 3, and 9 ® 9. For example, take the IBM code number 85469. Since there are an even number of digits, s functions on the digits in the odd positions. The resulting congruence statement would be 7 (8 maps into 7) + 2 (2 in an even position remains unchanged) + 1 (5 maps into 1) + 9 + 8 + 3 + 3 + 3 + 9 + 8 º 0 (mod 10). Since the sum of the left side is 50 which is congruent to zero (mod 10), the code is a valid one in the IBM system.
Area 10 Mathematics and Technology Professional Development Center Permission is granted to duplicate these materials for classroom use.
Last updated on 1/30/1999 |