Top Banner
01/29/13 Number Theory: Factors and Primes Discrete Structures (CS 173) Derek Hoiem, University of Illinois http://www.brooksdesign- ps.net/Reginald_Brooks/ Code/Html/pin2.htm 1
17

Number Theory: Factors and Primes

Feb 24, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Number Theory: Factors and Primes

01/29/13

Number Theory: Factors and Primes

Discrete Structures (CS 173)

Derek Hoiem, University of Illinois

http://www.brooksdesign-

ps.net/Reginald_Brooks/

Code/Html/pin2.htm

1

Page 2: Number Theory: Factors and Primes

Goals of this lecture

โ€ข Understand basic concepts of number theory including divisibility, primes, and factors

โ€ข Be able to compute greatest common divisors and least common multiples

2

Page 3: Number Theory: Factors and Primes

Number theory: the study of integers (primes, divisibility, factors, congruence, etc.)

3

Leonard Dickson

(1874-1954)

Thank God that number theory is unsullied by any

application

Virtually every theorem in elementary number theory arises in a natural, motivated way in connection with the problem of making computers do high-speed numerical calculations

Donald Knuth

(quote from 1974)

Other applications include cryptography (e.g., RSA encryption)

http://en.wikipedia.org/wiki/RSA_(algorithm)

Page 4: Number Theory: Factors and Primes

Divisibility

4

Suppose ๐‘Ž and ๐‘ are integers.

Then ๐‘Ž divides ๐‘ iff ๐‘ = ๐‘Ž๐‘› for some integer ๐‘›.

โ€œ๐‘Ž divides ๐‘โ€ โ‰ก โ€œ๐‘Ž | ๐‘โ€

๐‘Ž is a factor or

divisor of ๐‘

๐‘ is a multiple of a

Tip: think โ€œa divides into bโ€

Example: 5 | 55 because 55 = 5 โˆ— 11

Page 5: Number Theory: Factors and Primes

Examples of divisibility

โ€ข Which of these holds?

4 | 12 11 | -11

4 | 4 -22 | 11

4 | 6 7 | -15

12 | 4 4 | -16

6 | 0

0 | 6 5

(๐‘Ž | ๐‘) โ†” (๐‘ = ๐‘Ž๐‘›), where ๐‘› is some integer

Page 6: Number Theory: Factors and Primes

Proof with divisibility

Claim: For any integers ๐‘Ž, ๐‘, ๐‘, if ๐‘Ž|๐‘ and b|๐‘, then ๐‘Ž|๐‘.

Definition: integer ๐‘Ž divides integer ๐‘ iff ๐‘ = ๐‘Ž๐‘› for some integer ๐‘›

overhead 6

Page 7: Number Theory: Factors and Primes

Proof with divisibility

Claim: For any integers ๐‘Ž, ๐‘ฅ, ๐‘ฆ, ๐‘, ๐‘, if ๐‘Ž|๐‘ฅ and ๐‘Ž|๐‘ฆ, then ๐‘Ž|๐‘๐‘ฅ + ๐‘๐‘ฆ.

Definition: integer ๐‘Ž divides integer ๐‘ iff ๐‘ = ๐‘Ž๐‘› for some integer ๐‘›

overhead 7

Page 8: Number Theory: Factors and Primes

Prime numbers

โ€ข Definition: an integer ๐‘ž โ‰ฅ 2 is prime if the only positive factors of ๐‘ž are 1 and ๐‘ž.

โ€ข Definition: an integer ๐‘ž โ‰ฅ 2 is composite if it is not prime.

โ€ข Fundamental Theorem of Arithmetic: Every integer โ‰ฅ 2 can be written as the product of one or more prime factors. Except for the order in which you write the factors, this prime factorization is unique.

8

600=2*3*4*5*5

Page 9: Number Theory: Factors and Primes

More factor definitions

โ€ข Greatest common divisor (GCD): gcd (๐‘Ž, ๐‘) is the largest number that divides both ๐‘Ž and ๐‘ โ€“ Product of shared factors of ๐‘Ž and ๐‘

โ€ข Least common multiplier (LCM): lcm ๐‘Ž, ๐‘ is the smallest number that both ๐‘Ž and ๐‘ divide

โ€ข Relatively prime: ๐‘Ž and ๐‘ are relatively prime if they share no common factors, so that gcd ๐‘Ž, ๐‘ = 1

9

Page 10: Number Theory: Factors and Primes

Factor examples

gcd(5, 15) =

gcd(0, k) =

gcd(8, 12) =

gcd(8*m, 12*m) =

gcd(k^3, m*k^2) =

10

lcm(120, 15) =

lcm (6, 8) =

lcm(0, k) =

Which of these are relatively prime?

6 and 8?

5 and 21?

6 and 33?

3 and 33?

Any two prime numbers?

Page 11: Number Theory: Factors and Primes

11

E.g., if ๐‘Ž = 31 and ๐‘ = 5, ๐‘ž = 6 and ๐‘Ÿ = 1

Page 12: Number Theory: Factors and Primes

Euclidean algorithm for computing gcd

12

x y ๐‘Ÿ=remainder ๐‘ฅ, ๐‘ฆ

remainder ๐‘Ž, ๐‘ is the remainder when ๐‘Ž is divided by ๐‘

gcd (969,102)

Page 13: Number Theory: Factors and Primes

Euclidean algorithm for computing gcd

13

x y ๐‘Ÿ=remainder ๐‘ฅ, ๐‘ฆ

remainder ๐‘Ž, ๐‘ is the remainder when ๐‘Ž is divided by ๐‘

gcd (3289,1111)

Page 14: Number Theory: Factors and Primes

Recursive Euclidean Algorithm

14

Page 15: Number Theory: Factors and Primes

But why does Euclidean algorithm work?

15

Euclidean algorithm works iff gcd ๐‘Ž, ๐‘ = gcd ๐‘, ๐‘Ÿ ,

where ๐‘Ÿ = remainder(๐‘Ž, ๐‘)

Page 16: Number Theory: Factors and Primes

Proof of Euclidean algorithm

16

Claim: For any integers ๐‘Ž, ๐‘, ๐‘ž, ๐‘Ÿ, with ๐‘ > 0, if ๐‘Ž = ๐‘๐‘ž + ๐‘Ÿ then gcd ๐‘Ž, ๐‘ =gcd (๐‘, ๐‘Ÿ).

overhead

Page 17: Number Theory: Factors and Primes

Next class

โ€ข More number theory: congruence and sets

17