lecture11

# lecture11 - Number Theory and Modular Arithmetic God made...

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

1 Lecture 11 (October 4, 2011) Number Theory and Modular Arithmetic p-1 p 1 f (pq) = (p-1)(q-1) 0 1 2 3 4 5 6 7 “God made the integers; all else is the work of man.” - Leopold Kronecker, 1823-91. Divisibility: An integer a divides b (written “a|b”) if and only if there exists an integer c such that c*a = b. Primes: A natural number p ≥ 2 such that among all the numbers 1,2…p only 1 and p divide p. Prime numbers are thus “irreducible” Primes: Useful facts 1. If p is a prime and p | ab, then either p | a or p | b (or both). 2. If p ≠ q are two primes, and p | m and q | m, then pq | m. Fundamental Theorem of Arithmetic: Any integer greater than 1 can be uniquely written (up to the ordering of the factors) as a product of prime numbers. Greatest Common Divisor: GCD(x,y) = greatest k 1 s.t. k|x and k|y. Least Common Multiple: LCM(x,y) = smallest k 1 s.t. x|k and y|k.

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

View Full Document
2 You can use MAX(a,b) + MIN(a,b) = a+b applied appropriately to the factorizations of x and y to prove the above fact… Fact: GCD(x,y) × LCM(x,y) = x × y (a mod n) means the remainder when a is divided by n. a mod n = r a = dn + r for some integer d Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n | (a-b) a = q n + b for some q Written as a n b, and spoken “a and b are equivalent or congruent modulo n” 31 81 [mod 2] 31 2 81 31 80 [mod 7] 31 7 80 n is an equivalence relation In other words, it is Reflexive: a n a Symmetric: (a n b) (b n a) Transitive: (a n b and b n c) (a n c) n induces a natural partition of the integers into n “residue” classes. (“residue” = what’s left over = “remainder”) Define residue class [k] = the set of all integers that are congruent to k modulo n . Residue Classes Mod 3: [0] = { …, -6, -3, 0, 3, 6, . .} [1] = { …, -5, -2, 1, 4, 7, . .} [2] = { …, -4, -1, 2, 5, 8, . .} [- 6] = { …, -6, -3, 0, 3, 6, . .} [7] = { …, -5, -2, 1, 4, 7, . .} [- 1] = { …, -4, -1, 2, 5, 8, . .} = [0] = [1] = [2]
3 Why do we care about these residue classes? Because we can replace any member of a residue class with another member when doing addition or multiplication mod n and the answer will not change To calculate: 249 * 504 mod 251 just do -2 * 2 = -4 = 247 We also care about it because computers do arithmetic modulo n, where n is 2^32 or 2^64. Fundamental lemma of plus and times mod n : If (x n y) and (a n b). Then 1) x + a n y + b 2) x * a n y * b Proof of 2: xa = yb (mod n) (The other proof is similar…) x n y iff x = i n + y for some integer i a n b iff a = j n + b for some integer j xa = (i n + y)(j n + b) = n(ijn+ib+jy) + yb n yb Another Simple Fact: If (x n y) and (k|n), then: x k y Example: 10 6 16 10 3 16 Proof: x n y iff x = in + y for some integer i Let j=n/k, or n=jk Then we have: x = ijk + y x = (ij)k + y therefore x k y A Unique Representation System Modulo n:

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/03/2011 for the course CS 251 taught by Professor Gupta during the Spring '11 term at Carnegie Mellon.

### Page1 / 13

lecture11 - Number Theory and Modular Arithmetic God made...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online