lecture20

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

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

Lecture 20 Integers, Division, Primes and Greatest Common Divisors

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

View Full Document
Division a divides b c : b = a*c Given: a,b,c integers; a ≠ 0 Notation: a | b
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

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

View Full Document
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)
Applications of Congruences Generating pseudo-random numbers Cryptography Hash functions

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

View Full Document
PRIMES
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

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

View Full Document
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
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

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

View Full Document
Theorem If n is a composite integer, then n has a prime divisor less than or equal to sqrt{n}
Corollary To check if n is composite, you only need to search up to sqrt{n}

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

View Full Document
Prime Factorization How about an algorithm to find the prime factorization of an input integer?
Example Factor 7007 Not divisible by 2,3,5 7007/7=1001

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 10/21/2011 for the course CSCI 2011 taught by Professor Staff during the Spring '08 term at Minnesota.

### 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
Ask a homework question - tutors are online