Activity: Bar Code Activity

Objective: learn about an interesting yet simple real life math application

recall the importance of order of operations

Format: Worksheet Activity

Materials: Bar Codes From Various Products

Description: Time: 60 - 90

About a week before doing this activity, I asked each student to start collecting product bar codes so that they could bring in at least 5 bar codes on the day of the project. I also collected bar codes and brought them in for the project. I made overheads with the following information (except, instead of just having the bar code numbers, I photocopied the actual bar codes onto the overheads):

Bar Codes

A full length bar code has 12 digits.

The FIRST DIGIT indicates the type of product:

A "0" shows that the product is a national brand

Example bar code number: 0 51111 40633 5

A "2" shows that the product is a meat or cheese that has been weighed and wrapped in the store

Example bar code number: 2 16401 60299 0

A "3" shows that the product is a health or beauty aid

Example bar code number: 3 81370 04666 0

A "4" means that the store has reduced the original price of the product

Example bar code number: 4 94180 17576 2

A "5" indicates a manufacturer’s cents off coupon

Example bar code number: 5 12000 14055 1

The SECOND - SIXTH DIGITS form the manufacturer’s identification number which is assigned to the company by the uniform code council in Dayton, Ohio.

Example bar code number: 0 38301 10035 8

The SEVENTH - ELEVENTH DIGITS are assigned by the company itself to distinguish the product from the others made by the company.

Example bar code numbers from the same company, but indicating different products:

0 36000 26150 9 0 36000 26410 4

The TWELFTH DIGIT is the check digit. This digit helps prevent common mistakes that are made when the UPC is keyed in by hand. A UPC is checked in the following manner:

Multiply the sum of the digits in the 1st, 3rd, 5th, 7th, 9th, and 11th positions by 3. Add to this the sum of the digits in the 2nd, 4th, 6th, 8th, 10th, and 12th positions. If the result is a multiple of 10, then the code is valid and will be accepted by the computer.

Example bar code number: 0 21130 27566 3

(Note that 3(0+1+3+2+5+6) + (2+1+0+7+6+3) = 70 = 7(10), so the above bar code number is valid.)

Example bar code number where the 12th arabic digit has been left off the product (Although the 12th arabic digit is not shown, the number is represented in the bar code so that the computer can read it.): 0 41187 01201

Sometimes the UPC is shortened to only 8 digits. In these situations, we can extend the 8 digit number to the proper 12 digit number according to the following algorithms:

If the seventh digit is a 0, insert 4 0’s after the 3rd digit.

Example 8 digit bar code number and its 12 digit extension:

0 122250 0 becomes 0 12000 02250 0

If the seventh digit is a 3, drop the three and insert 5 0’s after the 4th digit.

Example 8 digit bar code number and its 12 digit extension:

0 549253 7 becomes 0 54900 00025 7

I discussed the information on the overheads with the students as they compared what they were learning with their collected bar codes. Then the students worked together in small groups on the following worksheet:

Name

Bar Code Activity Sheet

Each UPC bar code is made up of two parts, the alternating dark-white bars given in a binary code that the computer reads and the arabic numerals printed underneath. The binary code system used in UPC bar coding is not the same as the base-two number system. The bars are set up so that the scanner can read the code no matter which way the code is passed over its window.

1. Usually twelve digits appear in the arabic numeral system. The first digit, which is sometimes written to the left of the bars instead of being aligned with the others, indicates the type of product. A 0 in this position shows that the product is a national brand. If the first digit is a 2, then the product is a meat or cheese that has been weighed and wrapped within the store. The numeral 3 identifies the product as a health or beauty aid, a 4 means that the store has reduced the original price of the product, and a 5 indicates a manufacturer’s cents-off coupon. Classify the products with the bar codes that have the associated arabic numbers A - G given bellow:

A: 2 00531 30213 4 B: 3 19810 07822 3 C: 5 44000 25740 3

D: 0 44000 04719 1 E: 2 00270 70153 6 F: 0 72250 02499

G: 0 800900 3

A. B. C.

D. E. F.

G.

2. The next five digits after the numeral showing the product type is the manufacturer’s identification number. This number is assigned to the company by the Uniform Code Council in Dayton, Ohio. Which of the products whose arabic bar code numbers are shown in question 1 are made by the same company?

The second five-digit group in the UPC is assigned by the company itself to distinguish that particular product from all others made by the same company. The twelfth digit in the code is the check digit. If the checkout person keys in a code manually and makes a common mistake, such as hitting the wrong key or transposing two digits, the computer will refuse the code. A UPC is checked by the following method:

Multiply the sum of all the digits in odd positions of the code by 3. (Count the position the first digit occupies as position 1, an odd position.) Add this product to the sum of all the digits in the even positions. (The check digit will be in the last even position.) If the final sum is a multiple of ten, the code is valid (except for compensating errors mentioned later in the extension) and will be accepted by the computer.

For example, test the bar code number: 0 15645 16680 6

3(0 + 5 + 4 + 1 + 6 + 0) + (1 + 6 + 5 + 6 + 8 + 6) = 3(16) + (32) = 48 + 32 = 80

Since 80 is a multiple of 10, the bar code checks.

3. Check the validity of the bar code numbers A - E from question 1.

4. Sometimes the check digit on a UPC has not been printed. The check digit on the bar code number 0 39400 01204 is missing. If it is known that the bar code is valid, the check digit can be found using the same directions given previously. If C represents the missing check digit and m represents some multiple of 10, then 3(0 + 9 + 0 + 0 + 2 + 4) + (3 + 4 + 0 + 1 + 0 + C) = m

3(15) + (8 + C) = m

45 + 8 + C = m

53 + C = m

Therefore, C must be 7 and m must be 60. Why?

5. Find the missing check digit for the product with the bar code number F from question 1.

6. Bar codes on cents-off coupons and in-store meat or cheese items often have the price encoded within the second five-digit group. The meat codes, whose first five-digit groups represent types of meat, are set up so that the last four positions of the second five-digit group are reserved for the price. If fewer than four digits are required to designate the price, zeroes are used to fill in the first, or first and second, of the four positions. Give the letter of each meat code and the price of each package of meat listed in question 1.

7. Companies sometimes use a condensed eight-digit UPC that can be expanded to the twelve-digit form. The check digits of these "shorthand" versions are not included in the missing digits. The numerals that have been omitted are from the two five-digit groups. The bar code number 0 499890 7 can be expanded into a twelve-digit code by the following method:

Insert four 0’s beginning at the third position in the first group of five digits. Copy the remaining digits in the order they appear.

Copy the full twelve-digit code.

8. Check the code number in question 7 for validity.

9. The condensed bar code number 0 549253 7 can be expanded to twelve digits by the following method:

Drop the 3 in the last position of the second five-digit group. Insert five 0’s, beginning at the fourth position of the first five-digit group. Copy the remaining digits in the order they appear.

Copy the full twelve-digit code.

10. Check the validity of the bar code number in question 9.

11. Expand the bar code number G from question 1 to twelve digits using either method described earlier. Be sure to check to see if it is a valid code.

12. Doug works at Safeway. He is having a bad day because his checkout scanner is down. That means that he has to key in all the UPC’s by hand. If he makes the following mistakes, will the computer catch them?

a) The UPC number is 0 53421 55376 1, but Doug types in 0 53412 55376 1.

b) The UPC number is 0 22020 02202 2, but Doug types in 0 22202 22022 2.

c) The UPC number is 3 10093 24785 6, but Doug types in 3 10063 24785 6.

Challenge Problem:

An ISBN number has 10 digits and is used to identify books. A ISBN numbers, like UPC numbers, have a check digit in the last position. To check if a number is a valid ISBN, do the following:

Multiply the 1st digit by 10, the 2nd digit by 9, the 3rd digit by 8, the 4th digit by 7, the 5th digit by 6, the 6th digit by 5, the 7th digit by 4, the 8th digit by 3, the 9th digit by 2, and the 10th digit by 1. Add all of these together. If the resulting number is divisible by 11, then the number is a valid ISBN. In an ISBN, an "X" stands for the number 10. For example: The ISBN for my copy of Shakespeare’s Hamlet is 0-671-72262-X. To check that this is a valid ISBN, we would do the following:

0 6 7 1 7 2 2 6 2 X = 10

x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1

0 54 56 7 42 10 8 18 4 10

Now add these all together: 0 + 54 + 56 + 7 + 42 + 10 + 8 + 18 + 4 + 10 = 209

We can divide 209 by 11 and find that 209 = 11*19. Thus this is a valid ISBN.

Check to see if the following are valid ISBN numbers:

a) 0-860-19093-6

b) 0-812-55070-6

c) 0-671-69267-4

Super Challenge Problem:

Try to figure out how the computer reads the UPC’s. In other words, see if you can figure out how to read a UPC without being given the arabic numerals. Write down any ideas or patterns that you discover while trying to answer this question.

Modifications: The worksheet can be shortened to make the activity less time consuming.

More advanced math classes may be interested in studying the binary number system in connection with this activity since it is somewhat related in how the computer reads the bar codes.

Resources: This project was largely taken from the article "Now & Then: From Cashier to Scan Coordinator," Teaching Mathematics in the Middle School, Vol. 1, N. 1, April 1994.

Your name and Fellow year: Jill Lombaer, first year gk-12 fellow

School or outreach event where activity was used: I lead this activity in a pre-algebra class of freshmen and sophomores at Corvallis High School.