chapters 16 & 17 sarah cameron 18 march 2010. review of modular arithmetic identification numbers...

18
The Digital Revolution Chapters 16 & 17 Sarah Cameron 18 March 2010

Upload: shawn-morgan

Post on 12-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

The Digital Revolution

The Digital RevolutionChapters 16 & 17Sarah Cameron18 March 2010OutlineReview of Modular ArithmeticIdentification NumbersZIP CodesBar CodesBinary CodesEncryption

Review of Modular Arithmetica mod n = the remainder when a is divided by nExamples:3 mod 2 = 137 mod 10 = 7Identification NumbersIdentification Numbers:Unambiguously identify the person or thing with which it is associatedShould be self-checkingThe ZIP CodeFive Digits: ABCDEA: Represents one of 10 geographic areas in the US, normally a grouping of statesBC: These two digits in combination with the first, identify a central mail-distribution point known as a sectional center.DE: The last two digits indicate the town or local post office, the order is often alphabetical for towns within a delivery areaThe ZIP + 4 code4 code: FGHJFG: Represent a delivery sector.HJ: Narrow the area further based on the needs of the delivery sector.

Bonus Trivia: Using the ZIP + 4 code makes you eligible for cheaper bulk rates. Binary CodesBinary Code: any system for representing data with only two symbolsBar Code: a series of dark and light spaces that represent characters

UPC Bar CodeHas been used since 1973.12 Digit number: KLMNOPQRSTUVK: This digit identifies the kind of product.LMNOP: These digits identify the manufacturer.QRSTU: These digits are assigned by the manufacturer to identify the product.V: The final digit is the check digit. Check DigitsCheck Digits Used for error detection and correctionCan be the last digit in an ID number or a binary code.Often for ID numbers:Sum the individuals digits and mod by the check digit

Encoding with Parity Check SumsTake binary string a1a2a3a4 and append three check digits c1c2c3 so that any single error in any of the seven positions can be correctedChoose 3 different sums:c1 : a1 + a2 + a3c2 : a1 + a3 + a4c3 : a2 + a3 + a4If the value of the check is even, the check digit should be zero.If the value of the check sum is odd, the check digit should be one.Using this method you are able to produce a list of all possible a1a2a3a4c1c2c3 combinations.Decoding Parity-Check SumsNearest-Neighbor DecodingThis method decodes a received message as the code word that agrees with the message in the most positionsDistance Between Two Strings (of equal length)The number of positions in which the strings differ.Example:Real Message: 1000110Received as: 1010110The distance between the real message and the received message is one. If there are two possible translations for an erroneous message, it is not decoded.

Accuracy Binary Linear CodeConsists of words composed of 0s and 1s obtained from all possible messages of a given length by using parity-check sums to append check digits to the messages. These words are called code words.Weight of a Binary CodeIs the minimum number of 1s that occur among all nonzero words of that code.Accuracy:If the weight of a binary code is odd, the code will correct any (t-1)/2 or fewer errors.If the weight of a binary code is even, the code will correct any (t-2)/2 or fewer errors.If you simply want to detect errors, the code will detect t-1 errorsCryptographyEncryptionThe process of disguising dataCryptologyThe study of methods to make and break secret codesData Compression The process of encoding data so that the most frequently occurring data are represented by the fewest symbols

How Often Do Different Letters Occur in the English LanguageSoundex Coding SystemDelete all occurrences of h and w.

Assign numbers to the remaining letters as follows:0: A, E, I, O, U1: B, F, P, V2: C, G, J, K, Q, S, X, Z3: D, T4: L5: M, N6: R

If two or more letters with the same numeric value are adjacent, omit all but the first.Delete the first character of the original name, if still present.

Delete all occurrences of A, E, I, O, U, and Y.

Retain only the first three digits corresponding to the remaining letters.

Append trailing 0s if fewer than three letters remain.

Precede the digits with the first letter of the name.Caesar CipherABCDEFGHIJKLMNOPQRSTUVWXYZDEFGHIJKLMNOPQRSTUVWXYZABCUsed by Julius Caesar to send messages to his troops. Decode DWWDFN DW GDZQThe encoded message: ATTACK AT DAWNVigenre CipherATTACK AT DAWN019190210019302213MATHMA TH MATH120197120197120197MTMHOK ?? ????12191271410Choose a key word, which can be anything.Add the digit position of the original letter to the digit position of the key word letter.Mod that number by 26 = digit position of the coded letter.Repeat the key word for as many characters as you need.Answer: TA PAPU;19, 0, 15, 0, 15, 20

Disscussion and HWQuestions?Applications?Homework: (7th Edition)Chapter 16: #74Chapter 17: #11