numbers in our pockets gcnu 1025 numbers save the day
TRANSCRIPT
![Page 1: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/1.jpg)
Numbers in Our Pockets
GCNU 1025Numbers Save the Day
![Page 2: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/2.jpg)
Numbers in our pockets
• A fundamental use of numbers: counting
![Page 3: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/3.jpg)
Numbers in our pockets• How about banknotes?
![Page 4: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/4.jpg)
Numbers in our pockets• ID number for identifying/tracking banknotes
![Page 5: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/5.jpg)
Numbers in our pockets• ID number for identifying/tracking banknotes
![Page 6: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/6.jpg)
1. Numbers for identification
An ID (identification) number is a string of numbers that is used for identification. It enables us to recognize the object or person attach to that number.
Examples:• Postal codes• Phone numbers• Country codes• Numbers in cheques
![Page 7: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/7.jpg)
Postal Codes
• A post code (or post code, postcode, ZIP code) is a series of letters and/or numbers appended to a postal address (or a delivery route).
• Different countries with different systems.• Postal codes allow us to recognize the geographical
area to which the code refers.
![Page 8: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/8.jpg)
• ZIP code in the address of Harvard University: MA 02138• Some more specific ZIP codes have 4 extra digits (“ZIP+4”)
![Page 9: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/9.jpg)
ZIP codes of US
![Page 10: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/10.jpg)
Chinese postal codes• 6 digits (e.g. 518053)• 4 levels: 51-8-0-53– First 2 digits: province/municipality/autonomous region – 3rd digit: postal zone – 4th digit: district– Last 2 digits: local post office
![Page 11: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/11.jpg)
Phone numbers for identification
![Page 12: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/12.jpg)
Hong Kong telephone numbers
• Which are fixed land line numbers? How can you tell?
A. 2363 2767B. 3411 2801C. 5589 4120D. 6583 2042E. 7729 1502F. 8320 1529G. 9258 4981
![Page 13: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/13.jpg)
Hong Kong telephone numbers
• Number of a church: 2363 2767 • 363 xxxx: before 01/01/1995• Where is the church? Kowloon? Hong Kong
Island? New Territories? Outlying Islands? How can you tell?
![Page 14: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/14.jpg)
Hong Kong telephone numbers
• Where is the church? Kowloon? Hong Kong Island? New Territories? Outlying Islands? How can you tell?
• 363 2767: a number in Kowloon• 1970s: (3)63 2767– First “3”: area code for Kowloon– 632767 was the actual number– No need to dial the area code if you are in
Kowloon
![Page 15: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/15.jpg)
Hong Kong telephone numbers
• The leading digits of a Hong Kong telephone number are partially related to the location of the telephone line
![Page 16: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/16.jpg)
Country codes
• How can a friend of yours from the US call you? Can he/she just dial your number?
• Need to dial 852 before the number (and probably also the number provided by the service provider)
![Page 17: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/17.jpg)
Numbers for identification
• Why can’t a Hong Kong number be 99920842?
• Can the country code of China be 85?• Example: 8526543210– Interpretation #1: 852-6543210 (Hong Kong)– Interpretation #2: 85-26543210 (not Hong Kong)
• Prefix property: – No phone number (country code) can be the prefix of
another phone number (country code)
![Page 18: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/18.jpg)
Numbers in Cheques
• Cheque number, routing/transit number for issuing bank/branch, account number
![Page 19: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/19.jpg)
Numbers in Our Pockets
GCNU 1025Numbers Save the Day
![Page 20: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/20.jpg)
2. Numbers for error-checking
Some identification numbers include error-checking features to enable us to check their validity.
Examples:• HKID card numbers• Credit card numbers
Warning: designed to detect errors rather than to prevent fraud.
![Page 21: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/21.jpg)
HKID card numbers
• Some basics about HKID card numbers• Check digits of HKID card numbers
![Page 22: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/22.jpg)
Validity of Y123456(9)
• Rule: every valid HKID number has a special property• Step 1 (of checking validity):
• Step 2 (of checking validity):
• Step 3 (of checking validity): is this “check sum” 286 divisible by 11? YES! The number is valid!
![Page 23: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/23.jpg)
Classwork 1: validity of HKID number
Have a try checking your own HKID….
![Page 24: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/24.jpg)
A missing digit of a valid HKID number
Y 1 2 3 4 6 4 *x 8 7 6 5 4 3 2 1= 200 7 12 15 16 18 8 *
• If Y123464(*) is valid, what is “*”?• Step 1:
• Step 2: – Check sum = 276 + * (which is known to be divisible by 11)– What should “*” be? Can “*” be 0-9? – If Y123464(*) is valid, “*” has to be 10!– Use “A” to represent 10 (recall the base 16 arithmetic)
![Page 25: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/25.jpg)
HKID card check digit
• Weighted modulo 11 check: check digit appended to make check sum divisible by 11
• 0-9 or A (representing 10)• Using “A” for “10” is not uncommon in other
numeral systems (compare: base 16 numbers such as “B1A”)
![Page 26: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/26.jpg)
HKID card check digit - Review
• Weighted modulo 11 check: check digit appended to make check sum divisible by 11
• 0-9 or A (representing 10)• Using “A” for “10” is not uncommon in other
numeral systems (compare: base 16 numbers such as “B1A”)
![Page 27: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/27.jpg)
http://www.cp.hk/dbpub/idcheck.asp
http://www.cp.hk/articles/identity.asp Quote:
Incidentally, the last character in brackets ( ) is actually not part of the HKID. It is a check digit which depends on the characters in the HKID, resulting between 0-9 or A. It is generated by a fairly simple formula, and is used to check for errors, because if you get one character wrong in the ID, then the check digit will be wrong. You can use our new online HKID check digit generator to calculate the check digit of any HKID - try it and see! Hours of fun for all the family.
HKID card check digit - Review
![Page 28: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/28.jpg)
Place value: base 10 system
• Every digit must be from 0-9 (e.g. 1985)• For a base 10 number “1985”:
Digit Value of the position Actual value
1 1,000 (10x10x10) 1,000
9 100 (10x10) 900
8 10 (10) 80
5 1 5
![Page 29: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/29.jpg)
Place value: base 16 system
• Base 16: every digit must be from 0-15
• For a base 16 number “3A24”:
10 11 12 13 14 15
A B C D E F
Digit Value of the position Actual value
3 4096 (16x16x16) 12,288
A (10) 256 (16x16) 2,560
2 16 (16) 32
4 1 4
![Page 30: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/30.jpg)
Other numeral systemsNumeral system Digits from
Base 10 0-9
Base 16 0-15
Base 60 0-59
Base 12 0-11
Base 2 0-1
Base 8 0-7
![Page 31: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/31.jpg)
Duodecimal system
![Page 32: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/32.jpg)
Hexadecimal system
![Page 33: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/33.jpg)
Sexagesimal system
Stems-and-branches
![Page 34: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/34.jpg)
Numeral systemsNumeral system Uses
Binary (base 2) Computers
Octal (base 8) Used to be popular in Central America
Duodecimal (base 12) 1 foot = 12 inches
Hexadecimal (base 16) 1 pound = 16 ounces
Sexagesimal (base 60) 1 minute = 60 seconds
![Page 35: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/35.jpg)
Number for error-checking: remarks
• Not for fraudulence prevention– Schemes known to public– A counterfeit (i.e. a fake) could still have a valid
number– Other schemes available for such purpose
![Page 36: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/36.jpg)
Numbers in Our Pockets
GCNU 1025Numbers Save the Day
![Page 37: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/37.jpg)
Credit card check scheme
• Weighted modulo 10 check: check digit (i.e. last digit) appended to make check sum divisible by 10
• How to calculate the check sum? How are the digits weighted?
![Page 38: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/38.jpg)
Validity of 5424 7171 3312 0044
• Rule: every valid credit card number has a special property• Step 1 (of checking validity):
• Step 2 (of checking validity):
• Step 3 (of checking validity): Is this “check sum” 50 divisible by 10? YES! The number is valid!
![Page 39: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/39.jpg)
Credit card check scheme
![Page 40: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/40.jpg)
Luhn algorithmhttp://en.wikipedia.org/wiki/Luhn_algorithm
See also “bank card numbers” http://en.wikipedia.org/wiki/Bank_card_number
![Page 41: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/41.jpg)
Classwork 2: validity of credit card number
Why not try the credit cards in your own pocket?
![Page 42: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/42.jpg)
Numbers in Our Pockets
GCNU 1025Numbers Save the Day
![Page 43: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/43.jpg)
3. Barcodes
A 1D barcode is a series of dark bars and light spaces that represent characters/data. A scanning device is needed to pass over the bars and spaces to read the data.
Examples:• UPC barcodes (1D) • QR codes (2D)
Error-correcting feature of QR codes
![Page 44: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/44.jpg)
UPC (barcode) check scheme
• A (one-dimensional) barcode represents data by varying the width and the spacing of parallel lines
• Primary example: Universal Product Code (UPC)
![Page 45: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/45.jpg)
UPC (barcode): basic features
• 12-digit • 1st digit: product category
• Last digit: check digit
Prefix Category
0, 1, 6, 7 or 8 Ordinary products
2 Variable-weight products
3 Drugs
5 or 9 Coupons
![Page 46: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/46.jpg)
UPC (barcode): basic features
• Two sides separated watersheds/long guard bars • Total width of strips representing a number is 7
• Total width of black strips is odd (left side)– Example: 8 (WBBWBBB)
![Page 47: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/47.jpg)
UPC (barcode): basic features
• Bars on two sides are like inverses. Bars on the right becomes spaces on the left and vice versa.– Example: the left representation of 8 is (WBBWBBB) and
the right representation of 8 is (BWWBWWW)
Odd width for left and even for right: enables scanners to detect orientation (up-side-down?)
![Page 48: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/48.jpg)
UPC (barcode) check scheme
• Weighted modulo 10 check: check digit appended to make check sum divisible by 10
• How to calculate the check sum? How are the digits weighted?
![Page 49: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/49.jpg)
Validity of 9-87654-32109-8
• Rule: every valid UPC number has a special property• Step 1 (of checking validity):
• Step 2 (of checking validity): 27+8+21+6+15+4+9+2+3+0+27+8=130
• Step 3 (of checking validity): Is this “check sum” 130 divisible by 10? YES! The number is valid!
9 8 7 6 5 4 3 2 1 0 9 8
x 3 1 3 1 3 1 3 1 3 1 3 1
= 27 8 21 6 15 4 9 2 3 0 27 8
![Page 50: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/50.jpg)
Classwork: validity of UPC number
![Page 51: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/51.jpg)
Two-dimensional barcodes
• Limited amount of data stored in 1D barcodes such as UPC• 2D barcode: rectangles (of different sizes) instead of strips (of
different widths)• Primary example: QR (quick response) codes
![Page 52: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/52.jpg)
QR code: basic features
• Storage capacity depends on data type, dimension and error-correction level– 40 different dimensions– 4 levels of error correction power
http://en.wikipedia.org/wiki/QR_code Play it!
Error-correction level % of info that can be restored
Level L (Low) ~7%
Level M (Medium) ~15%
Level Q (Quartile) ~25%
Level H (High) ~30%
![Page 54: Numbers in Our Pockets GCNU 1025 Numbers Save the Day](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649ca35503460f94964199/html5/thumbnails/54.jpg)
Numbers in Our Pockets
-End-