Prior to the lesson, collect samples of barcodes, ISBN, UPC, and sample credit cards (from mail advertisements or from local financial institutions). Not only will these examples provide students with a visual, but they can also be used as part of the lesson when verifying the accuracy of the number. Begin by providing a background for the creation of barcoding systems and how these systems are used today.
The first patent for barcodes was issued to Bernard Silver and Norman Woodland in 1952. Since then these coding systems have expanded, been modified, and applied to a variety of areas. One of the most common uses is in retail and grocery stores. Although the barcode is not the price of the item, it does allow for the item to be registered with an associated price. When the bar code is scanned, the associated price will be read by the cash register. Other uses are found in monitoring blood supplies, identification on prescription drugs, book checkout at libraries, tracking luggage, and express shipping services.
Another advantage to the barcode system is that when an additional digit is included, known as the check digit, many errors that occur during data entry can be detected. These errors occur when passing information over the phone or internet. It is quite easy for people to transpose numbers (45 when it should be 54), replace a single digit with another, omit digits, or double an incorrect digit (799 is entered as 779). Using a check digit within a check equation helps to catch these errors and verify the validity of the number. As students will see in the ISBN barcode, the number is also used for identification purposes.
Begin by taking samples of barcodes that you have collected from items that are sold in stores. This type of barcode is referred to as the Universal Product Code, or UPC. Students will be instructed as to the algorithm and then determine the validity of the number. Next, students should be challenged to determine a check digit for a barcode. The UPC system uses a mod 10 congruence. This system uses a weighting factor of 3 for the digits in the even positions. This means that even-positioned digits will be multiplied by three.
For the first example, use the given UPC symbol 7-86936-24425-0 from the movie "The Incredibles."

To verify this number, follow the steps:
- Every even-positioned digit, counting from the right to left, will be multiplied by 3. All odd-positioned digits will be multiplied by 1.
3(7) + 1(8) + 3(6) + 1(9) + 3(3) + 1(6) + 3(2) + 1(4) + 3(4) + 1(2) + 3(5) + 1(0)
- Sum the products.
0 + 15 + 2 + 12 + 4 + 6 + 6 + 9 + 9 + 18 + 8 + 21 = 110
- Determine the validity by dividing the sum by 10.
110 ÷ 10 = 11 remainder 0. Therefore 110 mod 10 = 0.
This is a valid UPC number.
Students may decide to apply the distributive property and multiply 3 by the sum of the even digits and multiply 1 by the sum of the odd digits.
Next provide students with the UPC number 7-96714-78601-y, where y is the check digit. Using the process from above, students should determine the check digit. The sum of the products is 112. The check digit must be 8, because (112+8) mod 10 = 0. On Question 1 of the Check That Digit activity sheet, students will verify the check digit for two UPC numbers.
Another barcode system is the International Standard Book Number, or ISBN. This system was developed in the late 1960’s and early 1970’s. It became apparent that there needed to be a uniform system that would identify books that were published throughout the world. Now every book could have a special identification number. The ISBN is a ten‑digit number composed of blocks of numbers that have different meaning. There are four parts to the number, which are separated by hyphens or spaces. The first part of the number identifies the language or country (referred to as the group identifier) and is at most five digits. The second part of the number identifies the publisher and may be at most seven digits. The third part of the number represents the item number or edition for that publisher. It may consist of no more than six digits. The final part is the check digit. Part of the flexibility of this system is the fact that there are many numbers available to be used. Recall that there are a maximum of 10 digits with the 10th being reserved for the check digit. Therefore, the first three parts of the number must have a combined total of nine digits. Leading zeroes are used as place fillers in the event there would not be enough digits in a particular section to ensure there are an appropriate number of digits. The diagram below shows an example of an ISBN number.
The check digit is calculated differently than that of the UPC system. Begin by multiplying the first digit by 10, the second by 9, the third by 8, and continue in this fashion until the ninth digit is multiplied by 2. Next, determine the sum of these products. This is a modulus‑11 system, which means that the sum of the products of the first nine digits plus the check digit must be a multiple of 11. One problem that arises in this process is that the check digit might need to be a 10. Because we only have digits 0‑9, an X is written in the check‑digit place. (The X is reflective of the Roman numeral for 10.) Questions 3‑6 on the Check That Digit activity sheet deal specifically with the ISBN. Note: Beginning January 1, 2007, the current ISBN system will be replaced with the ISBN-13 system (for further information, see the ISO Web Site). It is a 13-digit number beginning with 978, followed by the current nine digits of the ISBN, and it will have a new check digit. The check digit will be found using a method different from the current one. When all old ISBN’s have been used, the next series will begin with 979.
Credit cards use a system of blocked numbers similar to the ISBN. One obvious difference is that the maximum length for the number is 19 digits, although many numbers range from 13‑16 digits.

The first digit of a credit card number is the Major Industry Identifier (MII) and identifies which group issued the card, as shown below.

For instance, a number beginning with a 3 would be representative of the travel and entertainment category. The American Express card falls into this category. Cards issued by gas companies are given the beginning digit 7. The popular Visa and MasterCard fall under the banking and financial category (4, 5). The next block of numbers is the Issue Identifier. Including the MII digit, the Issue Identifier is six digits long. The account number begins with the seventh digit and ends with the next‑to‑last digit. The final digit is the check digit.
The process used to determine the check digit is the Luhn algorithm (mod 10), named after IBM scientist Hans Peter Luhn. This algorithm works as follows:
- Begin by doubling all even-positioned digits when counting from right to left. If doubling results in a two‑digit number, add the digits. For instance, if the original digit were a 6, doubling it would give 12, so use 1 + 2 = 3.
- Determine the sum of the results from Step 1 and each of the unaffected (odd‑positioned) digits in the original number.
- Verify the account number by determining if the sum from Step 2 is a multiple of 10.
Before proceeding to the questions on the activity sheet pertaining to this topic, have students become more familiar with the Luhn algorithm by determining the validity of the check digit for the following account number: 5314 7726 8593 2112. The sum produced by the algorithm is 65, found as follows:
- Double the even-positioned digits when counting from left to right (5, 1, 7, 2, 8, 9, 2, 1). This results in 10, 1, 14, 4, 16, 18, 4, 2. Three of these results are two-digit numbers; in those cases, add the digits. Then, the eight numbers to be included in the sum are 1 (= 1 + 0), 1, 5 (= 1 + 4), 4, 7 (= 1 + 6), 9 ( = 1 + 8), 4, 2.
- Add the results from Step 1 to the unaffected digits from the original number:
1 + 3 + 2 + 4 + 5 + 7 + 4 + 6 + 7 + 5 + 9 + 3 + 4 + 1 + 2 + 2 = 65
- The sum is not a multiple of 10.
To be a valid account number, this sum must be evenly divisible by 10. If the check digit were 7, the result would be congruent to 0 mod 10; but because the check digit is 2, the sum is not divisible by 10. Therefore, this account number is not valid.
The Luhn algorithm is able to detect single data entry errors and most transpositions. Students should proceed to the worksheet and determine how this happens.
Prior to beginning the lesson, you may wish to review the solutions.