Lecture Wee 3

Discrete Mathematics and Its Applications with MathZone

This preview shows pages 1–7. Sign up to view the full content.

UCI ICS/Math 6D 3-Integers-1 Integers Number Theory = Properties of Integers (For this part, assume all values are integers .) “a|b” = “a divides b ” = 5 n Z (b=na) “b is a multiple of a.” “a is a factor of b.” “Multiple” always means “integer multiple” Thrm: If a|b and a|c, then a|(b+c). Thrm: If a|b, then 2200 m a|mb. Thrm: If a|b and b|c, then a|c.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
UCI ICS/Math 6D 3-Integers-2 Division Algorithm Thrm: Thrm: If a,d If a,d Z Z d>0, then d>0, then 5 ! q,r Z Z (0≤r<d a=qd+r) d is the “divisor ( a is the “dividend ) q is the “quotient ,” q = a div d (quotient = # of multiples of d which fit into a, if a≥0) r is the “remainder ,” r = a mod d (“a modulo d”) a d q = a div d r = a mod d 17 5 3 2 5 17 0 5 51 17 3 0 0 17 0 0 -17 5 -4 3 There is a unique. There is one and only one. Functions on pairs (a,d)
UCI ICS/Math 6D 3-Integers-3 Congruent ... Modulo For a, b, m integers with m>0, we say “a is congruent to b modulo m,” written a b (mod m) b (mod m) , iff m | (a-b) Thrm: For a, b, m integers with m>0, a b (mod m) b (mod m) iff 5 k Z a=b+km Z a=b+km Thrm: For a, b, m integers with m>0, a b (mod m) b (mod m) iff (a mod m) = (b mod m) Thrm: For a, b, c, d, m integers with m>0, if a b (mod m) b (mod m) and c d (mod m), then d (mod m), then a+c b+d (mod m) b+d (mod m) and ac bd (mod m). bd (mod m).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
UCI ICS/Math 6D 3-Integers-4 Applications of Congruences Hashing Functions: h m (n) = (n mod m) Range(h m ) = {n | 0≤n<m} Not injective (not one-to-one) Collisions {0,1,2,3,...,m-1} = “Z m Pseudorandom Number Generator: n k+1 =(an k +c) mod m Example: (a,c,m)=(3,4,7), i.e. n k+1 =(3n k +4) mod 7 n 1 =0 ; n 2 =4 ; n 3 =2 ; n 4 =3 ; n 5 =6 ; n 6 =1 ; n 7 =0 ; …
UCI ICS/Math 6D 3-Integers-5 Applications of Congruences (cont) Example: (a,c,m)=(3,4,7), i.e. n k+1 =(3n k +4) mod 7 n 1 =0 ; n 2 =4 ; n 3 =2 ; n 4 =3 ; n 5 =6 ; n 6 =1 ; n 7 =0 ; … Ceasar’s Cipher (“Shift Cipher”): p = plaintext, encoded as integer in Z 26 c = ciphertext, encoded as integer in Z 26 Encrypt each letter using a fixed offset k from the alphabet’s start, e.g.: c = E k (p) = (p+k) mod 26 Actually, any bijection, f:Z 26 Z 26 , provides an encryption algorithm: Examples: E(p) = (3n+13) mod 26 E(p) = (15n+7) mod 26

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
UCI ICS/Math 6D 3-Integers-6 Primes n>1 is “prime” iff the only positive divisors of n are 1 and n itself.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern