Check Digits Tanli Su
Introduction -identification numbers are used to easily identify people, products, books, accounts, credit cards, driver's licenses, and more -millions of times a day, these numbers are transmitted by humans and computers in various ways, making errors likely to occur -to ensure that an identification number has been transmitted correctly, a check digit is calculated and assigned as the last digit of the identification number -if the check digit does not match what it is expected to be, then a transmission error must have occurred and can be manually corrected -check digit schemes: methods to calculate check digits using modular arithmetic
Transmission Errors Error TypeDescriptionFormFrequency single digitone digit changesa → b79.1% adjacent transposition two different consecutive digits switch places ab → ba10.2% omitting or adding a digit a digit is omitted or an extra digit is added ab → a or a → ab 10% jump transposition two different digits separated by a third digit between them switch places acb → bca0.8%
Transmission Errors Error TypeDescriptionFormFrequency twin two identical consecutive digits change to a different pair of identical digits aa → bb0.5% phonetic two digits in a number are presented orally and incorrectly a0 → 1a or 1a → a0 (ex. 50 → 15) 0.5% jump twin two identical digits, separated by a third digit between them, change to a different pair of identical digits aca → bcb0.3% — J. Kirtland, Identification Numbers and Check Digit Schemes
US Postal Money Order -identification number for a US postal money order is 11 digits long -uses a mod 9 check digit scheme -check digit = remainder when the sum of the other 10 digits is divided by 9 -calculation for the check digit of x: ( ) (mod 9) ≡ 40 (mod 9) ≡ 4 So the complete US postal money order number is since this check digit scheme uses mod 9, it catches all single digit errors except when a 9 is changed to a 0, or vice versa
UPC (Universal Product Code) -UPC numbers appear on almost every single retail product in the U.S. -calculation for the check digit of UPC x: 1.Sum the digits in the odd-numbered positions = 23 ← sum 1 1.Multiply sum 1 by 3 and add it to the sum of the digits in the even-numbered positions to get a weighted sum. 3 ・ (sum 1) + ( ) = = 79 ← weighted sum 1.Find the remainder when the weighted sum is divided by 10. Subtract the remainder from 10, and the resulting number is the check digit. 79 (mod 10) ≡ = 1 So the complete UPC number is the UPC scheme catches all single digit errors and adjacent transposition errors except when ab is changed to ba when | a-b | = 5.
Luhn Algorithm -more advanced check digit scheme designed by IBM computer scientist Hans Peter Luhn in 1954 to accurately verify identification numbers -used by most credit card companies -detects all single digit errors and adjacent transposition errors except when 09 is changed to 90, or vice versa -can also catch most twin errors
Luhn Algorithm Example: validation of the identification number Starting with the last digit, which is the check digit, sum up every other digit = 42 ← sum 1 1.Starting with the second to last digit, double every other digit. If a number is greater than 9 after it is doubled, add up its two digits to create a new single digit. Add all the doubled digits/new single digits to make a second sum. 2 ・ 9 = 18 → = 9 2 ・ 2 = 4 2 ・ 3 = 6 2 ・ 8 = 16 → = 7 2 ・ 1 = = 28 ← sum 2 1.Add the two sums from steps 1 and 2 to make a weighted sum = 70 ← weighted sum If the weighted sum is divisible by 10, then it is a valid identification number according to the Luhn algorithm. In this case, 70 is divisible by 10, so the number is valid.
Concluding Remarks -other more complex check digit algorithms: the Verhoeff algorithm and the Damm algorithm -can detect most of the transmission errors mentioned in the table -while they can detect many transmission errors, they are still unable to identify more complex errors -to do this, necessary to either use both letters and numbers for the check digit or to use multiple check digits -check digits are only intended to catch accidental transmission errors and are not actually meant to help prevent forgeries
Works Cited Bartlett, Sandra L. "Credit Card Validation - Check Digits." Credit Card Check Digit Validation. University of Michigan, 5 Sept Web. 27 July Gallian, Joseph A. Contemporary Abstract Algebra. 6th ed. Boston, MA: Houghton Mifflin, Print. Kirtland, Joseph. Identification Numbers and Check Digit Schemes. Washington, DC: Mathematical Association of America, Print. Mohr, Jonathan. "Check Digits." Check Digits. University of Alberta, Web. 23 July Salomon, David. Coding for Data and Computer Communications. New York, NY: Springer, Print.
Thank you for listening!