lecture20 - Lecture 20 Integers, Division, Primes and...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 20 Integers, Division, Primes and Greatest Common Divisors
Background image of page 1

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

View Full DocumentRight Arrow Icon
Division a divides b c : b = a*c Given: a,b,c integers; a ≠ 0 Notation: a | b
Background image of page 2
Division Algorithm Theorem: Let a be an integer, and d be a positive integer. Then there exist unique q and r, with 0 r<d , such that a = dq + r . Note: this is not an algorithm! 101 = 7 14 + 3 -11 = 7 (-2) + 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Modular Aritmetic “a is congruent to b modulo m” a b (mod m) a b (mod m) means that a mod m = b mod m m divides (a-b)
Background image of page 4
Applications of Congruences Generating pseudo-random numbers Cryptography Hash functions
Background image of page 5

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

View Full DocumentRight Arrow Icon
PRIMES
Background image of page 6
Primes A positive integer p is prime if the only positive factors of p are p and 1 Not prime composite 13 is prime, 15 is composite Primes are building blocks of integers
Background image of page 7

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

View Full DocumentRight Arrow Icon
The fundamental theorem of arithmetic Every positive integer can be written uniquely as a prime, or the product of two or more primes. Prime factors are usually written in the order of non-decreasing size. 13 = 13 25 = 5*5 100 = 2*2*5*5
Background image of page 8
Exercise Design an algorithm to check if an integer is composite. What is the running time of your algorithm? Let’s improve this algorithm using our discrete math skills
Background image of page 9

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

View Full DocumentRight Arrow Icon
Theorem If n is a composite integer, then n has a prime divisor less than or equal to sqrt{n}
Background image of page 10
Corollary To check if n is composite, you only need to search up to sqrt{n}
Background image of page 11

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

View Full DocumentRight Arrow Icon
Prime Factorization How about an algorithm to find the prime factorization of an input integer?
Background image of page 12
Example Factor 7007 Not divisible by 2,3,5 7007/7=1001
Background image of page 13

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

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 35

lecture20 - Lecture 20 Integers, Division, Primes and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online