80 likes | 105 Views
Modular Arithmetic, The Codabar System, and applications. Tom á s Cometto and Daniel Stokley Linear Systems 5/1/06. Modular Arithmetic. Mod 3. A way of expressing a set of integers as their remainder when divided by any positive integer n .
E N D
Modular Arithmetic, The Codabar System, and applications Tomás Cometto and Daniel Stokley Linear Systems 5/1/06
Modular Arithmetic Mod 3 • A way of expressing a set of integers as their remainder when divided by any positive integer n. • In other words, all numbers in mod nmust be contained in the set 0 to n – 1.
Numbers Mod 5 1+ 4 + 2 + 3 + 4 + 1 + 3 = ? 18 = ? 3 Vectors [3, 1, 2] • [4, 0, 1] = 12 + 0 + 2 = 14 = 4. More Mod Madness
Codabar System • Every Credit and Debit card is identified by a 16-digit number, but the bank only issues the first 15 numbers. The last number is calculated by this codabar system. • Approach: take the first (issued) 15 numbers of the credit card, label the last number d, and place these in the vector X of length 16.
The Codabar System uses the check vector C = {2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}, also of length 16. • Instead of simply solving for X•C = 0, we introduce h, number of digits in odd positions greater than 4 (in the original 15). • Solve C•X + h = 0, in mod(10) • Let’s see why Danny’s credit card gave him problems.
5164846218486456 • X = {5,1,6,4,8,4,6,2,1,8,4,8,6,4,5,d} • C = {2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1} • h = 6 • X•C + h = 2(5+6+8+6+1+4+6+5) + (1+4+4+2+8+8+4+d) +6 =0 • = 2(41) + 37 + d = 0 • = 2(1) + 7 + d =0 • = 9 + d = 0 • Thus, d must be 1, not 6.
UPCs originate with a company called the Uniform Code Council (UCC). A manufacturer applies to the UCC for permission to enter the UPC system. The manufacturer pays an annual fee for the privilege. • BYG Publishing's manufacturer identification number is the first six digits of the UPC number -- 639382. The next five digits -- 00039 -- are the item number.
Universal Product Code (UPC) • UPC bar codes were originally created to help grocery stores speed up the checkout process and keep better track of inventory, but the system quickly spread to all other retail products because it was so successful. • Just like the first 15 numbers on a credit card are issued by the bank, the first n -1 numbers of a bar code are issued by the manufacturer, and the nth number is a check digit. • Use check vector {3,1,3,1,3…} • Typically, for UPCs, we don’t use h. We just solve X•C = 0. • ISBN Codes for Library Items