cs2102: Discrete Mathematics
Class 20: Number Theory
David Evans,
Mohammad Mahmoody
University of Virginia
Slide 2
Slide 2 text
Plan + Reminders
Today: number theory
Deadline: PS8 this Friday 6:29pm.
Tuesday: Review before the exam
Next Thursday: 2nd Exam.
Slide 3
Slide 3 text
Clarification
Slide 4
Slide 4 text
Number Theory
• A study of integer numbers ℤ = … , −2, −1, 0, 1, 2, …
and their properties.
All numbers in today’s class integers unless said otherwise..
• Main operations:
1. Addition
2. Multiplication
3. Division..?..
Slide 5
Slide 5 text
Divisibility
• If there is such that
= then:
Slide 6
Slide 6 text
More Examples
• ∣ , ∣ → ?
• ∣ , ∣ →? ∣ + for all , ?
Slide 7
Slide 7 text
Primes
• > 1 is prime, if its (positive) divisors are 1,
• Other > 1 are called composite.
Slide 8
Slide 8 text
Fundamental Theorem of Arithmetic
• Every positive > 1 can be uniquely written as:
= 1
⋅ 2
⋅ …
where
1.
′ are all prime
2.
≤ +1
• or equivalently: =
1
1 ⋅
2
2 ⋅ …
where
1.
′ are all prime
2.
< +1
3.
’s are all positive integers
Slide 9
Slide 9 text
Which one of these is true?
1. Every even number > 2 is sum of + for primes , .
2. There are infinitely many primes where + 2 is also prime.
3. For > 2 there are no integers , , where + =
Slide 10
Slide 10 text
1. Every even number > 2 is sum of + for primes , .
Goldbach conjecture.
Verified up to ~1019
2. There are infinitely many primes where + 2 is also prime.
Twin primes conjecture.
Proved: infinite pairs , + 2 ,both *products* of two primes
3. For > 2 there are no integers , , where + =
Fermat’s last theorem..
Slide 11
Slide 11 text
Fermat’s last theorem
Pierre de Fermat
1607-1665
French Lawyer
(and mathematician)
Conjectured by Fermat
in 1637 in the margin
of Arithmetica where
he says the proof is too
large to fit in the margin
Slide 12
Slide 12 text
Fermat’s last theorem
Conjectured by Fermat
in 1637 in the margin
of Arithmetica where
he says the proof is too
large to fit in the margin
Proved by Andrew Wiles (then Princeton, now Oxford) in 1994
He was 41 when proved this, so could not get Fields medal for that..
Slide 13
Slide 13 text
Euclid’s algorithm
Slide 14
Slide 14 text
Greatest Common Divisor
• For , > 1, = gcd(, ) if > 1 is the greatest
common divisor ∣ , ∣
• Example: what is gcd(, ) if ∣ ?
• Example: What is gcd(, ) if = and = for
primes , ,
Slide 15
Slide 15 text
How to find gcd , in general?
Slide 16
Slide 16 text
Division Theorem
• For all , there are , where
= ⋅ + and 0 ≤ < ||
• = (, ) could be positive or negative
• = (, ) is always non-negative
• Example: