1 / 22

CMPS 2433 – Coding Theory Chapter 3

CMPS 2433 – Coding Theory Chapter 3. Dr. Ranette Halverson Department of Computer Science Midwestern State University. SECURITY. Accuracy. Cryptography - Coding. The Code Book , Simon Singh Public-key cryptography Number theory Codes & Error-Correcting Codes. Error Checking - Accuracy.

Télécharger la présentation

CMPS 2433 – Coding Theory Chapter 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPS 2433 – Coding TheoryChapter 3 Dr. Ranette Halverson Department of Computer Science Midwestern State University

  2. SECURITY Accuracy

  3. Cryptography - Coding The Code Book, Simon Singh Public-key cryptography Number theory Codes & Error-Correcting Codes

  4. Error Checking - Accuracy • Even/Odd Parity • Each byte transmitted has one bit added so number of ones is even (or odd) • Checked upon receipt – reject if number of ones is NOT even (odd) • >99% of all transmission errors are in one bit • Example • Original: 0110 0011 Sent: 0110 0011 0 • 0111 0101  0111 0101 1

  5. Error Correcting Parity Send a set of multiple (8) bytes as a matrix. Set parity bit on rows & columns Example 1111 1111 0000 0000 0010 0010 0110 1110

  6. Error Correcting Parity Send a set of multiple (8) bytes as a matrix. Set parity bit on rows & columns Example – even parity 1111 1111 0 0000 0000 0 0010 0010 0 0110 1110 1 1011 0011

  7. Error Correcting Parity Send a set of multiple (8) bytes as a matrix. Set parity bit on rows & columns Example – even parity – one bit error 1111 1111 0 0000 0100 0* 0010 0010 0 0110 1110 11011 0011 *

  8. Division Algorithm If m & n are integers, m ≠ 0, n can be written as n = m*q + r, where 0 <= r < |m|. q & r are the quotient & remainder of n/m Examples: Divide 82 by 7 ~~ 82 = 11 * 7 + 5 Divide 26 by 7 ~~ 26 = 3 * 7 + 5 * 82 & 26 are Congruent Modulo 7 because they have the same remainder

  9. Congruence ~ is a Relation Define the congruence relation as follows: Cm = {(a,b)| a & b are integers & have the same remainder when divided by m} Example: C7 = {(82,26), (5,12), (19,5) (4,11), (2,23) (49,0)…}

  10. Properties of Congruence Reflexive? Symmetric? Transitive? Notation: 82 ≡ 26 mod 7 49 ≡ 0 mod 7 Are there equivalence classes?

  11. Equivalence Classes for Congruence Given Cm, how many equivalence classes? Example: Consider C7 [0] = { [1] = { [2] = { Any more???

  12. Equivalence Classes for Congruence Given Cm, how many equivalence classes? Example: C7 [0] = {0, 7, 14, 21,…} [4] = [1] = {1, 8, 15, 22,…} [5] = [2] = {2, 9, 16, 23,…} [6] = [3] = {3, 10, 17, 24…} [7] =

  13. Examples of Congruence • Clock Time Hours: • (mod 12) + 1 • mod 24 • Clock Time Minutes • mod 60

  14. Examples of Congruence • Calendars ~ Days of the Week • If Sunday = 0, Monday = 1, etc….. • Mod 7 will give us days of week IF used correctly

  15. Program 2 – More CalendarDue: Thursday, October 9 January 1, 2000 was a Saturday. Add a separate function to your MODIFIED Calendar program to also print the day of the week for each of the days in the original data list using the mod function. Use the number of the day you calculated, NOT the strategy shown in example 3.7 in your text book. This project MUST be done individually, not as a team. A new data file with additional dates will be posted. All 3 columns must be aligned. Dates with single digits, MUST have the zeroes added. E.G. 05-04-2001

  16. Note on Modulus on Negatives If m & n are integers, m ≠ 0, n can be written as n = m*q + r, where 0 <= r < |m|. (Note r MUST be positive) • q & r are the quotient & remainder of n/m Examples: -34/7 – Which is correct?? -34 = -4 * 7 – 6 r = -6 -34 = -5 * 7 + 1 r = 1

  17. Homework – Section 3.1 • Page 105 • Problems 1 – 16, 37, 38

  18. Euclidean Algorithm*Greatest Common Divisor (GCD) • Given 2 integers A & B, the largest integer that divides both is called the Greatest Common divisor (GCD) • Examples: • GCD (12,8) • GCD (200, 1000) • GCD (7, 122)

  19. Theorem 3.3 (p.107) Let a, b, c, & q be integers with b > 0. If a = qb + c, then gcd(a,b) = gcd(b,c) Example: find gcd(105, 231) gcd(231, 105) 231 = 2 * 105 + 21 gcd(105, 21) 105 = 5 * 21 + 0 gcd(21, 0) = 21

  20. The Euclidean Algorithm (p.108)Calculates gcd(m,n) r-1 = m, r0 = n, I = 0While rI≠0 //(division algorithm)I = I + 1 determine qI, rI for rI-2/rI-1 Print rI-1

  21. Complexity of Euclidean Algorithm Lame – 1844: no more than 5 * number of digits in smaller of 2 numbers Theorem 3.4 (p. 109)If the Euclidean Alg. is applied to m & n with m ≥ n > 0, the number of divisions needed is less than or equal to 2 log2 (n+1). Thus, O(log2 n).

  22. Homework – Section 3.2, Supplemental • Page 111-112 • Problems 1 – 12 • Page 149 • Problems 1 – 4, 15 - 18 Omitting Extended Euclidean Algorithm Sections 3.2 – 3.6

More Related