Upload
others
View
38
Download
2
Embed Size (px)
Citation preview
Introduction to Number Theory
•Number theory is about integers and their properties.
•We will start with the basic principles of
2 2
•We will start with the basic principles of
• divisibility,
• greatest common divisors,
• least common multiples, and
• modular arithmetic
Division
•If a and b are integers with a ≠ 0, we say that
a divides b if there is an integer c so that b = ac.
•When a divides b we say that a is a factor of b and that b
3 3
•When a divides b we say that a is a factor of b and that b
is a multiple of a.
•The notation a | b means that a divides b.
•We write a X b when a does not divide b.
Divisors.
ExamplesQ: Which of the following is true?
1. 77 | 7
2. 7 | 77
3. 24 | 24
4L9 4
3. 24 | 24
4. 0 | 24
5. 24 | 0
Divisors.
ExamplesA:
1. 77 | 7: false bigger number can’t divide smaller positive number
2. 7 | 77: true because 77 = 7 · 11
5L9 5
2. 7 | 77: true because 77 = 7 · 11
3. 24 | 24: true because 24 = 24 · 1
4. 0 | 24: false, only 0 is divisible by 0
5. 24 | 0: true, 0 is divisible by every number (0 = 24 · 0)
Divisibility Theorems
•For integers a, b, and c it is true that
• if a | b and a | c, then a | (b + c)• Example: 3 | 6 and 3 | 9, so 3 | 15.
6 6
• Example: 3 | 6 and 3 | 9, so 3 | 15.
• if a | b, then a | bc for all integers c• Example: 5 | 10, so 5 | 20, 5 | 30, 5 | 40, …
• if a | b and b | c, then a | c• Example: 4 | 8 and 8 | 24, so 4 | 24.
Divisor TheoremTHM: Let a, b, and c be integers. Then:
1. a|b ∧ a|c � a|(b + c )
2. a|b � a|bc
3. a|b ∧ b|c � a|c
7L9 7
3. a|b ∧ b|c � a|c
EG:
1. 17|34 ∧ 17|170 � 17|204
2. 17|34 � 17|340
3. 6|12 ∧ 12|144 � 6 | 144
Primes
•A positive integer p greater than 1 is called prime if the
only positive factors of p are 1 and p.
•A positive integer that is greater than 1 and is not prime
8 8
•A positive integer that is greater than 1 and is not prime
is called composite.
•The fundamental theorem of arithmetic:
Every positive integer can be written uniquely as the
product of primes, where the prime factors are written in
order of increasing size.
Primes•Examples:
33··55
48 48 ==
17 17 ==
15 15 ==
22··22··22··22··3 3 = = 2244··33
1717
9 9
100 100 ==
512 512 ==
515 515 ==
28 28 ==
22··22··55··5 5 = = 2222··5522
22··22··22··22··22··22··22··22··2 2 = = 2299
55··103103
22··22··7 7 = = 2222··77
Primes
•If n is a composite integer, then n has a prime divisor less than or equal
•This is easy to see: if n is a composite integer, it must have two divisors p1 and p2 such that p1⋅p2 = n and p1 ≥ 2 and p2 ≥ 2.
n
1010
•p1 and p2 cannot both be greater than , because then p1⋅p2 would be greater than n.
•If the smaller number of p1 and p2 is not a prime itself, then it can be broken up into prime factors that are smaller than itself but ≥ 2.
n
Division
Remember long division?
3
11731
q the quotient
d the divisor
11L9 11
117 = 31·3 + 24
a = dq + r
11731
24
93r the
remainder
a the dividend
Division
THM: Let a be an integer, and d be a positive integer.
There are unique integers q, r with r ∈ {0,1,2,…,d-1}
satisfying
a = dq + r
12L9 12
a = dq + r
The proof is a simple application of long-division. The
theorem is called the division algorithm though
really, it’s long division that’s the algorithm, not the
theorem.
The Division Algorithm
•Let a be an integer and d a positive integer.
•Then there are unique integers q and r, with
0 ≤≤≤≤ r < d, such that a = dq + r.
•In the above equation,
• d is called the divisor,
13 13
• d is called the divisor,
• a is called the dividend,
• q is called the quotient, and
• r is called the remainder.
The Division Algorithm
•Example:
•When we divide 17 by 5, we have
14
•17 = 5⋅3 + 2.
• 17 is the dividend,
• 5 is the divisor,
• 3 is called the quotient, and
• 2 is called the remainder.
The Division AlgorithmExample:
•What happens when we divide -11 by 3 ?
•Note that the remainder cannot be negative.
15
•Note that the remainder cannot be negative.
•-11 = 3⋅(-4) + 1.
• -11 is the dividend,• 3 is the divisor,• -4 is called the quotient, and• 1 is called the remainder.
Greatest Common Divisors•Let a and b be integers, not both zero.•The largest integer d such that d | a and d | b is called the greatest common divisor of a and b.
•The greatest common divisor of a and b is denoted by gcd(a, b).
16
gcd(a, b).
•Example 1: What is gcd(48, 72) ?
•The positive common divisors of 48 and 72 are 1, 2, 3, 4, 6, 8, 12, 16, and 24, so gcd(48, 72) = 24.
•Example 2: What is gcd(19, 72) ?
•The only positive common divisor of 19 and 72 is1, so gcd(19, 72) = 1.
Greatest Common Divisors
•Using prime factorizations:
•a = p1a
1 p2a
2 … pna
n , b = p1b
1 p2b
2 … pnb
n ,
•where p1 < p2 < … < pn and ai, bi ∈ N for 1 ≤ i ≤ n
•gcd(a, b) = p1min(a
1, b
1) p2
min(a2, b
2) … pn
min(an, b
n)
17 17
•Example:
a = a = 60 60 = = 2222 3311 5511
b = b = 54 54 = = 2211 3333 5500
gcd(a, b) = gcd(a, b) = 2211 3311 550 0 = = 66
Relatively Prime Integers•Definition:
•Two integers a and b are relatively prime if
gcd(a, b) = 1.
•Examples:
•Are 15 and 28 relatively prime?
18 18
•Are 15 and 28 relatively prime?
•Yes, gcd(15, 28) = 1.
•Are 55 and 28 relatively prime?
•Yes, gcd(55, 28) = 1.
•Are 35 and 28 relatively prime?
•No, gcd(35, 28) = 7.
Relatively Prime Integers
•Definition:
•The integers a1, a2, …, an are pairwise relatively prime if
gcd(ai, aj) = 1 whenever 1 ≤ i < j ≤ n.
•Examples:
19 19
•Are 15, 17, and 27 pairwise relatively prime?
•No, because gcd(15, 27) = 3.
•Are 15, 17, and 28 pairwise relatively prime?
•Yes, because gcd(15, 17) = 1, gcd(15, 28) = 1 and gcd(17,
28) = 1.
Least Common Multiples•Definition:
•The least common multiple of the positive integers a and
b is the smallest positive integer that is divisible by both a
and b.
•We denote the least common multiple of a and b by
lcm(a, b).
20February 9, 2012Applied Discrete Mathematics
Week 3: Algorithms 20
lcm(a, b).
•Examples:
lcm(lcm(33, , 77) =) = 2121
lcm(lcm(44, , 66) =) = 1212
lcm(lcm(55, , 1010) =) = 1010
Least Common Multiples
•Using prime factorizations:
•a = p1a
1 p2a
2 … pna
n , b = p1b
1 p2b
2 … pnb
n ,
•where p1 < p2 < … < pn and ai, bi ∈ N for 1 ≤ i ≤ n
•lcm(a, b) = p1max(a
1, b
1) p2
max(a2, b
2) … pn
max(an, b
n)
21February 9, 2012 21
•Example:
a = a = 60 60 = = 2222 3311 5511
b = b = 54 54 = = 2211 3333 5500
lcm(a, b) = lcm(a, b) = 2222 3333 551 1 = = 44**2727**5 5 = = 540540
GCD and LCM
a = a = 60 60 = = 222 2 3311 5511
b = b = 54 54 = = 2211 333 3 5500
gcd(a, b) = gcd(a, b) = 2211 3311 550 0 = = 66
22February 9, 2012Applied Discrete Mathematics
Week 3: Algorithms 22
lcm(a, b) = lcm(a, b) = 2222 3333 551 1 = = 540540
gcd(a, b) = gcd(a, b) = 22 33 55 = = 66
Theorem: Theorem: a*b a*b == gcdgcd((a,ba,b)* lcm()* lcm(a,ba,b))
Greatest Common Divisor
Relatively Prime
• Let a,b be integers, not both zero. The
greatest common divisor of a and b (or
gcd(a,b) ) is the biggest number d which divides
23L9 23
gcd(a,b) ) is the biggest number d which divides
both a and b.
• Equivalently: gcd(a,b) is smallest number which
divisibly by any x dividing both a and b.
• a and b are said to be relatively prime if
gcd(a,b) = 1, so no prime common divisors.
Greatest Common Divisor
Relatively Prime
Q: Find the following gcd’s:
1. gcd(11,77)
24L9 24
1. gcd(11,77)
2. gcd(33,77)
3. gcd(24,36)
4. gcd(24,25)
Greatest Common Divisor
Relatively PrimeA:
1. gcd(11,77) = 11
2. gcd(33,77) = 11
25L9 25
3. gcd(24,36) = 12
4. gcd(24,25) = 1. Therefore 24 and 25 are relatively
prime.
NOTE: A prime number are relatively prime to all other
numbers which it doesn’t divide.
Greatest Common Divisor
Relatively Prime
Find gcd(98,420).
Find prime decomposition of each number and find all
the common factors:
26L9 26
the common factors:
98 = 2·49 = 2·7·7
420 = 2·210 = 2·2·105 = 2·2·3·35
= 2·2·3·5·7
Underline common factors: 2·7·7, 2·2·3·5·7
Therefore, gcd(98,420) = 14
Greatest Common Divisor
Relatively Prime
Pairwise relatively prime: the numbers a, b, c, d, … are said to be pairwise relatively prime if
27L9 27
d, … are said to be pairwise relatively prime if any two distinct numbers in the list are relatively prime.
Q: Find a maximal pairwise relatively prime subset of
{ 44, 28, 21, 15, 169, 17 }
Greatest Common Divisor
Relatively Prime
A: A maximal pairwise relatively prime subset of
28L9 28
A: A maximal pairwise relatively prime subset of
{44, 28, 21, 15, 169, 17} :
{17, 169, 28, 15} is one answer.
{17, 169, 44, 15} is another answer.
Least Common Multiple
� The least common multiple of a, and b (lcm(a,b) )
is the smallest number m which is divisible by both
a and b.
� Equivalently: lcm(a,b) is biggest number which
29L9 29
Equivalently: lcm(a,b) is biggest number which
divides any x divisible by both a and b
Q: Find the lcm’s:
1. lcm(10,100)
2. lcm(7,5)
3. lcm(9,21)
Least Common Multiple
A:
1. lcm(10,100) = 100
2. lcm(7,5) = 35
3. lcm(9,21) = 63
30L9 30
3. lcm(9,21) = 63
THM: lcm(a,b) = ab / gcd(a,b)