100
IDENTIFICATION NUMBERS Chapter 16 in COMAP Book Jocelyn Westray

Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Embed Size (px)

Citation preview

Page 1: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

IDENTIFICATION NUMBERS

Chapter 16 in COMAP Book

Jocelyn Westray

Page 2: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Objectives

Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method Systems multiplying by 13 Applications such as UPC, ZIP codes,

and Bar codes. Soundex Coding System Driver’s License information

Page 3: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Introduction

A code is a symbolic way to represent information

Page 4: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Introduction

A code is a symbolic way to represent information

A revolution in information management took place at a grocery store in Ohio in June, 1974, when a 10 pack of Wrigley’s Juicy Fruit gum was the first bar-coded retail product purchased.

Page 5: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Introduction A code is a symbolic way to represent

information A revolution in information management

took place at a grocery store in Ohio in June, 1974, when a 10 pack of Wrigley’s Juicy Fruit gum was the first bar-coded retail product purchased.

All kinds of things have assigned identification numbers: money orders, airline tickets, bank checks, books, and cars

Page 6: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Check Digits

A check digit is a number in an identification code used for error detection.

Page 7: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Check Digits

A check digit is a number in an identification code used for error detection.

This method is used in several different identification schemes.

Page 8: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Check Digits

A check digit is a number in an identification code used for error detection.

This method is used in several different identification schemes.

Error detecting mechanisms have to be used in identification numbers in order to ensure that the appropriate item is being identified.

Page 9: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes

Example:

Consider the U.S. Postal Service money order with the number 17620289526.

Page 10: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes

Example:

Consider the U.S. Postal Service money order with the number 17620289526.

The last digit, 6 (the 11th digit) serves as an error detecting mechanism

Page 11: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes

Example:

Consider the U.S. Postal Service money order with the number 17620289526.

The last digit, 6 (the 11th digit) serves as an error detecting mechanism

This 11th digit is the remainder obtained when the sum of the first 10 digits is divided by 9.

Page 12: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes Example:

Consider the U.S. Postal Service money order with the number 17620289526.

The last digit, 6 (the 11th digit) serves as an error detecting mechanism

This 11th digit is the remainder obtained when the sum of the first 10 digits is divided by 9.

1+7+6+2+0+2+8+9+5+2=42

Page 13: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes Example:

Consider the U.S. Postal Service money order with the number 17620289526.

The last digit, 6 (the 11th digit) serves as an error detecting mechanism

This 11th digit is the remainder obtained when the sum of the first 10 digits is divided by 9.

1+7+6+2+0+2+8+9+5+2=42 42 divided by 9 is 36, so the remainder is 6.

Page 14: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes

Suppose instead of the correct number, the number 1760289526 (an error in the 4th position—simply an incorrect number) was entered into the computer.

Page 15: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 9 Schemes

Suppose instead of the correct number, the number 1760289526 (an error in the 4th position—simply an incorrect number) was entered into the computer.

The sum would be 44, and the remainder, 8. Therefore, the error would be detected.

Page 16: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Problems with Division by 9 This method will not detect the mistake

of replacing a 0 with a 9, or vice versa.

Because the value of a sum doesn’t depend on the order in which the numbers are added, this method does not detect the transposition (switching) of digits.

Page 17: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

American Express Travelers Cheques use a similar method where the check digit is the smallest nonnegative integer such that the sum of the digits, including the check digit, is evenly divisible by 9.

Page 18: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

American Express Travelers Cheques use a similar method where the check digit is the smallest nonnegative integer such that the sum of the digits, including the check digit, is evenly divisible by 9.

The American Express Travelers Cheque with the identification number 387505055 has what check digit?

Page 19: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example American Express Travelers Cheques use a

similar method where the check digit is the smallest nonnegative integer such that the sum of the digits, including the check digit, is evenly divisible by 9.

The American Express Travelers Cheque with the identification number 387505055 has what check digit?

It has the check digit 7 because 3+8+7+5+0+5+0+5+5=38 and 38+7 is evenly divisible by 9.

Page 20: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

This is used on airline tickets and for Avis and National rental cars.

Page 21: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

This is used on airline tickets and for Avis and National rental cars.

It assigns the remainder after division by 7 of the number itself as the check digit rather than dividing the sum of the digits by 7.

Page 22: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

This is used on airline tickets and for Avis and National rental cars.

It assigns the remainder after division by 7 of the number itself as the check digit rather than dividing the sum of the digits by 7.

Example:

Page 23: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

This is used on airline tickets and for Avis and National rental cars.

It assigns the remainder after division by 7 of the number itself as the check digit rather than dividing the sum of the digits by 7.

Example: The check digit for the number 540047

is 4 because 540047=7 x 77149 + 4.

Page 24: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes This is used on airline tickets and for Avis and

National rental cars. It assigns the remainder after division by 7 of

the number itself as the check digit rather than dividing the sum of the digits by 7.

Example: The check digit for the number 540047 is 4

because 540047=7 x 77149 + 4. This method will not detect the substitution of

0 for a 7, 1 for an 8, or 2 for a 9, or vice versa.

Page 25: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

Unlike division by 9 schemes, this will detect transpositions of adjacent digits with the exceptions of the aforementioned pairs.

Page 26: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

Unlike division by 9 schemes, this will detect transpositions of adjacent digits with the exceptions of the aforementioned pairs.

Example: If 5400474 were entered in as 4500474,

the machine would determine that the appropriate check digit should be 3.

Page 27: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes Unlike division by 9 schemes, this will

detect transpositions of adjacent digits with the exceptions of the aforementioned pairs.

Example: If 5400474 were entered in as 4500474, the

machine would determine that the appropriate check digit should be 3.

You can use Google to determine the check digits that require division by 7 or 9 by entering “540047 mod 7” (or mod 9).

Page 28: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Division by 7 Schemes

You can also use a calculator to find the remainder.

a/b=q Using the whole number portion of q:

r=a-bq Consider 123 divided by 7, we get

17.57, then 123 – 7 x 17 = 4.

Page 29: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

This is often used on grocery products. Consider the number 0 38000 00127 7

found on the bottom of a box of Kellogg’s Corn Flakes. The first digit identifies a broad category of goods, the next 5 identify the manufacturer, the next 5 identify the product, and the last is a check digit.

Page 30: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

For any UPC number a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12, the computer is programmed to carry out the following computation:

Page 31: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

For any UPC number a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12, the computer is programmed to carry out the following computation:

3a1+a2+3a3+a4+3a5+a6+a7+a8+3a9+a10+3a11+a12

Page 32: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

For any UPC number a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12, the computer is programmed to carry out the following computation:

3a1+a2+3a3+a4+3a5+a6+a7+a8+3a9+a10+3a11+a12

If the answer doesn’t end in zero, the computer knows the entered number is incorrect.

Page 33: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC) Returning to the Kellogg’s UPC, if we

entered 0 58000 00127 0 (a 5 instead of a 3), the computer would find a sum of 62, which doesn’t end in 0, so the error is detected.

This simple scheme detects all single-position errors and about 89% of all other kinds of errors.

Page 34: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

The 12 digit UPC used in the US paved the way for the 13 digit EAN used in Europe, which became the world-wide standard. The 12-digit UPCs were converted by adding a 0 to the beginning.

Page 35: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

The 12 digit UPC used in the US paved the way for the 13 digit EAN used in Europe, which became the world-wide standard. The 12-digit UPCs were converted by adding a 0 to the beginning.

The check digit for a 13-digit EAN number is selected so that a1+3a2+a3+3a4+a5+3a6+a7+3a8+a9+3a10+a11

+3a12+a13 ends with a 0. The 0 added to the beginning doesn’t affect the check digit.

Page 36: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Universal Product Code (UPC)

The 12 digit UPC used in the US paved the way for the 13 digit EAN used in Europe, which became the world-wide standard. The 12-digit UPCs were converted by adding a 0 to the beginning.

The check digit for a 13-digit EAN number is selected so that a1+3a2+a3+3a4+a5+3a6+a7+3a8+a9+3a10+a11+3a12+a13 ends with a 0. The 0 added to the beginning doesn’t affect the check digit.

The coefficient 3 for the terms with even subscripts is called a weight. Because 1ai = ai, we say that terms with odd subscripts have weight 1.

Page 37: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Check digit schemes that use weighted sums can be used to find a digit that has been corrupted in some way.

Page 38: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Check digit schemes that use weighted sums can be used to find a digit that has been corrupted in some way.

Example: If the packaging for a product with UPC 1 650002 202034 was damaged or defective in such a way that the second digit was unintelligible, how would we know that it is supposed to be 6?

Page 39: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Example continued:

Page 40: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Example continued: Lets call the missing digit X

Page 41: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Example continued: Lets call the missing digit X 1+3X+4+3(0)+0+3(0)+2+3(2)+0+3(2)+0

+3(3)+4= 3X+32

Page 42: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Example continued: Lets call the missing digit X 1+3X+4+3(0)+0+3(0)+2+3(2)+0+3(2)+0

+3(3)+4= 3X+32 It has to end in zero.

Page 43: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC

Example continued: Lets call the missing digit X 1+3X+4+3(0)+0+3(0)+2+3(2)+0+3(2)+0

+3(3)+4= 3X+32 It has to end in zero. 6 is the only digit that makes this true.

Page 44: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection in UPC Example continued: Lets call the missing digit X 1+3X+4+3(0)+0+3(0)+2+3(2)+0+3(2)+0+3(3

)+4= 3X+32 It has to end in zero. 6 is the only digit that makes this true. This example also shows why the weight 3

is superior to weight 2. If we used weight 2 there would have been other possibilities: 2X+32; X=4 and X=9.

Page 45: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bank Identification Numbers

The US banking system uses a variation of UPC scheme.

Page 46: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bank Identification Numbers

The US banking system uses a variation of UPC scheme.

Every bank has an 8-digit routing number, together with a 9th check digit as the last digit of the following:

Page 47: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bank Identification Numbers

The US banking system uses a variation of UPC scheme.

Every bank has an 8-digit routing number, together with a 9th check digit as the last digit of the following:

7a1+3a2+9a3+7a4+3a5+9a6+7a7+3a8+9a9

Page 48: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The First Chicago Bank has the routing number 07100001_ on the bottom of all of its checks. What is the check digit?

Page 49: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The First Chicago Bank has the routing number 07100001_ on the bottom of all of its checks. What is the check digit?

7(0)+3(7)+9(1)+7(0)+3(0)+9(0)+7(0)+3(1)=33

Page 50: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The First Chicago Bank has the routing number 07100001_ on the bottom of all of its checks. What is the check digit?

7(0)+3(7)+9(1)+7(0)+3(0)+9(0)+7(0)+3(1)=33

How can we make this end in zero?

Page 51: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The First Chicago Bank has the routing number 07100001_ on the bottom of all of its checks. What is the check digit?

7(0)+3(7)+9(1)+7(0)+3(0)+9(0)+7(0)+3(1)=33

How can we make this end in zero? 9x+33

Page 52: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The First Chicago Bank has the routing number 07100001_ on the bottom of all of its checks. What is the check digit?

7(0)+3(7)+9(1)+7(0)+3(0)+9(0)+7(0)+3(1)=33

How can we make this end in zero? 9x+33 x=3 because 9(3)=27 and 27+33=60

Page 53: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Advantages to Using 3 Weights

It detects 100% of single position errors and some transposition errors involving adjacent digits.

Page 54: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Advantages to Using 3 Weights

It detects 100% of single position errors and some transposition errors involving adjacent digits.

This scheme will also detect most transposition errors in the form of abccba, where as the UPC scheme does not.

Page 55: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Codabar

This is one of the most efficient error-detection methods, and is used by all major credit-card companies.

Page 56: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Codabar

This is one of the most efficient error-detection methods, and is used by all major credit-card companies.

For a credit card a1a2a3a4a5a6a7a8a9a10a11a12a13a14a15 let T be the number of digits in odd numbered positions that exceed 4.

Page 57: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Codabar This is one of the most efficient error-

detection methods, and is used by all major credit-card companies.

For a credit card a1a2a3a4a5a6a7a8a9a10a11a12a13a14a15 let T be the number of digits in odd numbered positions that exceed 4.

The check digit a16 is chosen so that 2a1+a2+2a3+a4+2a5+a6+2a7+a8+2a9+a10+2a11

+a12+2a13+a14+2a15+T+a16 is divisible by 10.

Page 58: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

Suppose a bank wants to issue a credit card numbered 312560019643001.

Page 59: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

Suppose a bank wants to issue a credit card numbered 312560019643001.

The sum is 66.

Page 60: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

Suppose a bank wants to issue a credit card numbered 312560019643001.

The sum is 66. We then note that among the digits in

odd-numbered positions, 2 are above 4, so we add 2 to 66, giving us 68.

Page 61: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

Suppose a bank wants to issue a credit card numbered 312560019643001.

The sum is 66. We then note that among the digits in

odd-numbered positions, 2 are above 4, so we add 2 to 66, giving us 68.

Finally, the check digit is whatever is needed to bring the final tally to a number that ends in 0.

Page 62: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example Suppose a bank wants to issue a credit

card numbered 312560019643001. The sum is 66. We then note that among the digits in odd-

numbered positions, 2 are above 4, so we add 2 to 66, giving us 68.

Finally, the check digit is whatever is needed to bring the final tally to a number that ends in 0.

Our check digit here is 2.

Page 63: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection

This method allows computers to detect 100% of single position errors and about 98% of all other common errors.

Page 64: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection

This method allows computers to detect 100% of single position errors and about 98% of all other common errors.

A check digit offers partial protection against fraudulent numbers. A person who wanted to create a phony card would have to know the appropriate check digit scheme to be successful.

Page 65: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection This method allows computers to detect 100% of

single position errors and about 98% of all other common errors.

A check digit offers partial protection against fraudulent numbers. A person who wanted to create a phony card would have to know the appropriate check digit scheme to be successful.

The algorithm is called the Luhn Algorithm, after IBM scientist Hans Peter Luhn, who created it in 1953. It can be applied to identification numbers of lengths other than 15, as well.

Page 66: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

A Multiplication by 13 Scheme

The third most common error is one of the form abccba. This is called a jump transposition, and most commonly occurs in dialing phone numbers.

Page 67: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

A Multiplication by 13 Scheme

The third most common error is one of the form abccba. This is called a jump transposition, and most commonly occurs in dialing phone numbers.

There is a simple way to encode ID numbers so that the three most common errors are detected 100% of the time.

Page 68: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Multiplication by 13

Example: Suppose a teacher wants to post student grades publicly without revealing any information about the students’ ID numbers.

Page 69: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Multiplication by 13

Example: Suppose a teacher wants to post student grades publicly without revealing any information about the students’ ID numbers.

Assuming the last four digits of each student ID number are different, the teacher could assign each student a six-digit number by multiplying the last four digits of their ID numbers by 13 (adding leading zeros when necessary).

Page 70: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Multiplication by 13 Example: Suppose a teacher wants to post student

grades publicly without revealing any information about the students’ ID numbers.

Assuming the last four digits of each student ID number are different, the teacher could assign each student a six-digit number by multiplying the last four digits of their ID numbers by 13 (adding leading zeros when necessary).

A student with an ID number that ends with 8912 gets 115856=8912x13. If a jump transition error occurs, it can be detected because 115658 is not divisible by 13.

Page 71: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

The ZIP Code

This system was established in 1963. The numbers begin with 0s (farthest east, Adjuntas, Puerto Rico) and work up to 9s (farthest west, Ketchikan, Alaska).

Page 72: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

The ZIP Code This system was established in 1963. The

numbers begin with 0s (farthest east, Adjuntas, Puerto Rico) and work up to 9s (farthest west, Ketchikan, Alaska).

The first digit represents one of the 10 geographic areas. The second two digits identify a central mailing distribution point known as a sectional center. The last two digits indicate the town or local post office.

Page 73: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

The ZIP Code This system was established in 1963. The

numbers begin with 0s (farthest east, Adjuntas, Puerto Rico) and work up to 9s (farthest west, Ketchikan, Alaska).

The first digit represents one of the 10 geographic areas. The second two digits identify a central mailing distribution point known as a sectional center. The last two digits indicate the town or local post office.

1983: Four more digits were added after a dash, called the ZIP + 4 code.

Page 74: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bar Codes

A bar code is a series of dark bars and light spaces that represent characters.

Page 75: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bar Codes

A bar code is a series of dark bars and light spaces that represent characters.

They are decoded by scanning with a light. The dark bars reflect very little back, and the white reflects a lot. They are converted into 0s and 1s. This is called binary coding.

Page 76: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Bar Codes A bar code is a series of dark bars and light

spaces that represent characters. They are decoded by scanning with a light. The

dark bars reflect very little back, and the white reflects a lot. They are converted into 0s and 1s. This is called binary coding.

The simplest bar code is the Postnet code, used by the USPS and are commonly found on Business Reply Cards. They use a similar check and must add up to something divisible by 10.

Page 77: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Postnet Codes

Page 78: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection

There are 5 bars per digit and there are exactly 10 arrangements composed of two long bars and three short bars.

Page 79: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Error Detection

There are 5 bars per digit and there are exactly 10 arrangements composed of two long bars and three short bars.

The numbers are separated into blocks for ease of understanding.

Page 80: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

Page 81: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The sixth block is an incorrect one because it has only one long bar. To correct the error, the computer linked with the bar-code scanner sums the remaining 9 digits to obtain 31.

Page 82: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Example

The sixth block is an incorrect one because it has only one long bar. To correct the error, the computer linked with the bar-code scanner sums the remaining 9 digits to obtain 31.

Because the sum of all 10 digits ends in 0, the value must be 9.

Page 83: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Encoding Personal Data

The social security number has no personal data encoded in the number. It is entirely determined by the place and time that it is issued.

Page 84: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Encoding Personal Data

The social security number has no personal data encoded in the number. It is entirely determined by the place and time that it is issued.

In contrast, some states driver’s license numbers are determined entirely by personal information about the holders.

Page 85: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Encoding Personal Data The social security number has no personal data

encoded in the number. It is entirely determined by the place and time that it is issued.

In contrast, some states driver’s license numbers are determined entirely by personal information about the holders.

Coding license numbers solely from personal data enables automobile insurers, government entities, and law enforcement agencies to determine the number from the personal data.

Page 86: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

This is used to encode a surname.

Page 87: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

This is used to encode a surname. 1. delete all occurrences of h and w.

(Schworer becomes Scorer and Hughgill becomes uggill.)

Page 88: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

This is used to encode a surname. 1. delete all occurrences of h and w.

(Schworer becomes Scorer and Hughgill becomes uggill.)

2. Assign number to the remaining letters as follows: a,e,i,o,u,y0 b,f,p,v1 c,g,j,k,q,s,x,z2 d,t3 l4 m,n4 r6

Page 89: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System This is used to encode a surname. 1. delete all occurrences of h and w.

(Schworer becomes Scorer and Hughgill becomes uggill.)

2. Assign number to the remaining letters as follows: a,e,i,o,u,y0 b,f,p,v1 c,g,j,k,q,s,x,z2 d,t3 l4 m,n4 r6

3. If two or more letters with the same numeric value are adjacent, omit all by the first. (Scorer becomes Sorer and uggill become ugil)

Page 90: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

4. Delete the first character of the original name if still present (Sorer becomes orer)

Page 91: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

4. Delete the first character of the original name if still present (Sorer becomes orer)

5. Delete all occurrences of a, e, i, o, u, and y.

Page 92: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System 4. Delete the first character of the original

name if still present (Sorer becomes orer) 5. Delete all occurrences of a, e, i, o, u, and

y. 6. Retain only the first three digits

corresponding to the remaining letters; append trailing 0s if fewer than 3 letters remain; precede the three digits obtained in this step with the first letter of the surname.

Page 93: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

This is an error-correcting scheme. It is designed so that likely misspellings of a name result in the correct coding of the name. For example, Erickson, Eriksen, Ericson, and Ericsen all yield the same coding as Erickson.

Page 94: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Soundex Coding System

This is an error-correcting scheme. It is designed so that likely misspellings of a name result in the correct coding of the name. For example, Erickson, Eriksen, Ericson, and Ericsen all yield the same coding as Erickson.

It was originally designed for the U.S. Census Bureau when much census information was obtained orally.

Page 95: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Personal Information in Driver’s License Numbers

The last five digits of Illinois and Florida driver’s license numbers capture the year and date of birth as well as the sex.

Page 96: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Personal Information in Driver’s License Numbers

The last five digits of Illinois and Florida driver’s license numbers capture the year and date of birth as well as the sex.

Illinois: each day of the year is assigned a three digit number in sequence beginning with 001 for January 1. All months are assumed to have 31 days, so March 1 is 063. For females the scheme is identical but 600 is added to the number.

Page 97: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Personal Information in Driver’s License Numbers

The last two digits of the birth year, separated by a dash are listed in the fifth and fourth positions from the end of the driver’s license number. Thus, a male born October 13, 1940 would have the last five digits 4-0292, whereas a female would have 4-0892.

Page 98: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Homework

Determine the check digit for a money order with identification number 3953981640.

Page 99: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

Homework

Determine your surname code using the Soundex Coding System. Also change your birthday and gender to the code used on an Illinois driver’s license.

Page 100: Chapter 16 in COMAP Book Jocelyn Westray. Objectives Understand what a check digit is. Systems dividing by 7 and 9. Systems with weights. Codabar method

THE ENDThank you for your attention