1 Cracking the Code Moshe Kam IEEE Educational Activities IEEE TISP workshop in Piura Peru Participant Guide August 2007 Version 001 30 July 2007.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

1 A B C
AP STUDY SESSION 2.
1
& dding ubtracting ractions.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Objectives: Generate and describe sequences. Vocabulary:
UNITED NATIONS Shipment Details Report – January 2006.
David Burdett May 11, 2004 Package Binding for WS CDL.
We need a common denominator to add these fractions.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt RhymesMapsMathInsects.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
PUBLIC KEY CRYPTOSYSTEMS Symmetric Cryptosystems 6/05/2014 | pag. 2.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Solve Multi-step Equations
Order of Operations Lesson
1 Combination Symbols A supplement to Greenleafs QR Text Compiled by Samuel Marateck ©2009.
Break Time Remaining 10:00.
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
MM4A6c: Apply the law of sines and the law of cosines.
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
How to convert a left linear grammar to a right linear grammar
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Subtraction: Adding UP
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Converting a Fraction to %
Exponents and Radicals
Clock will move after 1 minute
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
Completing the Square Topic
Copyright Tim Morris/St Stephen's School
How to create Magic Squares
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
1 Cracking the Code Moshe Kam, VP for Educational Activities A Presentation to IEEE TISP workshop in Piura Peru August 2007 Version July 2006.
Presentation transcript:

1 Cracking the Code Moshe Kam IEEE Educational Activities IEEE TISP workshop in Piura Peru Participant Guide August 2007 Version July 2007

2 The UPC Code

3 The UPC-A Code l UPC version A barcodes (12 digits) l UPC version E shortened version (8 digits) l ISBN-13 barcodes on books l ISSN symbols on non-U.S. periodicals l EAN-13 and EAN-8 are used outside the U.S. l JAN-13 and JAN-8 are used in Japan Vendor number (5) Product number (5) Checksum Digit (1) Prefix (1) A 1 A 2 A 3 A 4 A 5 A 6 A 7 A 8 A 9 A 10 A 11 A 12

4 Calculating the Checksum Digit

5 Checksum Digit Calculation (A 12 ) l Add the digits in the odd-numbered positions (first, third, fifth, etc.) together and multiply by three l Add the digits in the even-numbered positions (second, fourth, sixth, etc.) to the result l Calculate how much you need to add so that the number become a multiple of 10 l The answer is the checksum digit (A 12 )

6 In symbols l Calculate l 3 (A 1 + A 3 + A 5 + A 7 + A 9 + A 11 ) + A 2 + A 4 + A 6 + A 8 + A 10 = S l How much do we have to add to S to make it a multiple of 10 l If S=2 we need to add 8 to make it 10 l If S=17 we need to add 3 to make it 20 l If S=45 we need to add 5 to make it 50

8 l Add the digits in odd- numbered positions l SO = = 28 l Multiply by 3 l SO3 = 28 times 3 =84 l Add the digits in even- numbered positions (but not the 12 th ) l SE = = 18 l Add SO3 to SE l S= = 102 l How much you need to add so that S become a multiple of 10 l To get to 110 we need to add 8 l So the checksum digit is

10 l Add the digits in odd- numbered positions l SO = = 29 l Multiply by 3 l SO3 = 29 times 3 =87 l Add the digits in even- numbered positions (but not the 12 th ) l SE = = 16 l Add SO3 to SE l = 103 l How much you need to add so that S become a multiple of 10 l To get to 110 we need to add 7 l So the checksum digit is ?

11 l Add the digits in odd- numbered positions l SO = = 29 l Multiply by 3 l SO3 = 29 times 3 =87 l Add the digits in even- numbered positions (but not the 12 th ) l SE = = 16 l Add SO3 to SE l = 103 l How much you need to add so that the number become a multiple of 10 l To get to 110 we need to add 7 l So the checksum digit is

12 Activity 1 Detect the Fake Products!

13 Activity 1: detect the fake products! l You are given four products l Some of them are original l Some of them are cheap imitations l The imitators did not know about calculating the checksum digit properly l Which one of the products are original and which are fake?

14 Rolex Watch Wrangler Jeans A DVD Player A Personal Digital Assistant

15 Rolex Watch Wrangler Jeans A DVD Player A Personal Digital Assistant

16 Watch – authentic or not?

17 Jeans – authentic of not?

18 PDA – authentic or not?

19 DVD Player – authentic or not?

20 The UPC bar code as an Error Detecting Code

21 The UPC barcode detects single errors l If any one of the digits is corrupted, then there will be an error in the checksum digit calculation and we will know that an error has occurred

22 Activity 2 The Checksum Digit

23 Activity 2: effect of error on the checksum digit l Use code to draw the value of the checksum digit against all possible values of l A 2 (A 2 = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) l A 3 (A 3 = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

24 Value of digit A 2 Value of checksum digit

25 Value of digit A 3 Value of checksum digit

26 Activity 3 Properties of the Code

27 Activity 3: Answer a few questions… l Based on activity 2 – does it appear that if there is a single error in one of the digits, this code will detect it? l If there is a single error in one of the digits, will this code tell us which digit is wrong? l Prove your answer!

28 Activity 3 (continued) l Can this code always distinguish between a single error (an error in one and only one of the digits) and two errors (simultaneous errors in two digits)? l Prove your answer! l Is it possible that two errors will occur simultaneously and we will not be able to detect them using this code? l Prove your answer!

29 Error Correcting Code What happens if one of the digits is missing?

30 Code: l l 3( )+( )=103 l So to complete to 110 we needed 7 l Now suppose the fourth digit (4) is missing (M) l 025M

31 Code 025M l Can we find M? 3( )+(2+M+7+0+3)+7= 106+M l We know that the only number that would add to 106 to create the nearest multiple of 10 is 4 l = 110 l So if the single digit 4 was missing the code can reconstruct it

32 Second example: Code 02M l Can we find M? 3(0+M )+( )+7= 95+ 3M l This is harder… l What is the closest multiple of 10? l If it is 100 then 3M=5 l No, because M is not an integer l If it is 110 then 3M=15 and M=5 l If it is 120 then 3M=25 and M is greater than 9 and non-integer

33 Second example: Code 02M l Can we find M? 3(0+M )+( )+7= 95+ 3M l This is harder… l What is the closest multiple of 10? l If it is 100 then 3M=5 l No, because M is not an integer l If it is 110 then 3M=15 and M=5 l If it is 120 then 3M=25 and M is greater than 9 and non-integer

34 Third example: Code M06387 l Can we find M? 3(0+5+6+M+6+8)+( )+7= 98+ 3M l What is the closest multiple of 10? l If it is 100 then 3M=2 l No, because M is not an integer l If it is 110 then 3M=12 and M=4 l If it is 120 then 3M=22 and M is not an integer

35 Third example: Code M06387 l Can we find M? 3(0+5+6+M+6+8)+( )+7= 98+ 3M l What is the closest multiple of 10? l If it is 100 then 3M=2 l No, because M is not an integer l If it is 110 then 3M=12 and M=4 l If it is 120 then 3M=22 and M is not an integer

36 Activity 4 Find the Missing Digit

37 Activity 4: Find the Missing Digit 014M M

38 Transposition Errors

39 Transposition error l Transposition error occurs when two adjacent digits interchange places Example l becomes l Does the UPC barcode correct transposition errors?

40 Activity 5 Does the Code Correct Transposition Errors?

41 Activity 5: Transposition Errors Check whether the UPC barcode detect a transposition error of 4-7, 7-1 and 1-6 in the left-hand side code Check whether the UPC barcode detect a transposition error of 2-7, 7-1, and 1-6 in the right-hand side code WHAT ARE YOUR CONCLUSIONS?

42 Summary

43 Summary – what have we learnt today? l The history of bar codes l How barcodes are designed and used l Some properties of UPC bar codes l New terms: l Error Detecting Code l Error Correcting Code

44 References (1) l Bar Code History Page ml ml l Bar Codes _code.htm _code.htm l UPC Bar Code FAQs FAQ/ FAQ/

45 References (2) l Free Barcode Image Generator l Joseph Woodland l Bar Code Symbologies l es.aspx es.aspx l Error Detection Schemes l math.cudenver.edu/~wcherowi/courses/m6409/errschemes. pdf math.cudenver.edu/~wcherowi/courses/m6409/errschemes. pdf

46 References: Wikipedia l _Product_Code _Product_Code l l Joseph_Woodland Joseph_Woodland