Check Digit Schemes Jerzy Wojdyło Southeast Missouri State University May 13, 2002
Common Error Patterns Type of ErrorFormFrequency Single Error a b 60 – 90 % Omitting/Adding a Digit …xa …x 10 – 20 % Adjacent Transposition ab ba 10 – 20 % Twin Errors aa bb 0.5 – 1.5 % Jump Transposition acb bca 0.5 – 1.5 % Jump Twin Errors aca bcb < 1 % Phonetic Errors 1a a01a a0 0.5 – 1.5 % J. Verhoeff, “Error Detecting Decimal Codes”, Mathematical Centre Tract 29, The Mathematical Centre, Amsterdam, 1969.
POSTNET Bar coded digits, 3 short, 2 long, weights Check equation (for n = 5, 9, 11) * d 1 + d 2 + d 3 + d 4 +… + d n + d n+1 ≡ 0 (mod 10)
POSTNET
POSTNET ?
POSTNET Advantages Detects all single errors, Corrects single error (if corrupted digit is known) Works for arbitrary length Disadvantages Transposition errors are undetected
UPC Bars and 12 digits UPC = [d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 d 9 d 10 d 11 d 12 ] w = [ ] Check equation UPC · w ≡ 0 (mod 10)
UPC
UPC Advantages Detects all single errors Corrects single error (if corrupted digit is known) Works for arbitrary length Disadvantages (does not detect) Jump transpositions Adjacent transpositions ab ba if |a - b| = 5
EAN Bars and 13 digits EAN=[d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 d 9 d 10 d 11 d 12 d 13 ] w =[ ] Check equation Advantages/disadvantages same as UPC EAN · w ≡ 0 (mod 10)
EAN
Credit Cards Card TypePrefixLength AMEX VISA 4 13, 16 MASTER CARD DICOVER Diners Club/ Carte Blanche 300 – JCB
Credit Cards Check digit algorithm(s) MOD 10 Luhn Formula IBM Check Permutation Check All do the same Hans Peter Luhn ( ) Worked for IBM since 1941 Example (Excel)
Credit Cards Position Sum Digit Weight Product Sum of Digits Invalid number, sum not divisible by 10.Sum mod 108
Credit Cards Position Sum Digit Weight σi(d)σi(d) Invalid number, sum not divisible by 10.Sum mod 106 id, i = 1 σ i (d) = (0)(124875)(36)(9), i = 2
Credit Cards Advantages Detects all single errors Corrects single error (if corrupted digit is known) Works for arbitrary length Disadvantages (does not detect) Jump transpositions Adjacent transpositions 09 90 and 90 09
Credit Cards Position Sum Digit Weight σi(d)σi(d) Valid number Sum mod 100 Position Sum Digit Weight σi(d)σi(d) Valid number Sum mod 100
ISBN Ten “digits” and three dashes (-) d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 d 9 d 10 d 1,…, d 9 = {0, 1, …, 9}; d 10 ={0, …, 9, X=10} Check equation 10 ∑ i∙d i 0 (mod 11) i = 1
ISBN X =11·37
ISBN Advantages Detects all single errors Corrects single error (if corrupted digit is known) Detects all transposition errors (!!) Disadvantages Works for bounded length (≤ 10) Additional symbol X
Other US Postal Money Orders MOD 9 arithmetic Airline Tickets MOD 7 arithmetic Electronic Funds Transfer MOD 10, weights [ ] Verhoeff’s Check Digit Scheme German DM Dihedral Group D 5 multiplication
The End If you blinked and missed it, go to www2.semo.edu/jwojdylo/research.htm