1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among...

26
1 Section 2.4 The Integers and Division

Transcript of 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among...

Page 1: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

1

Section 2.4

The Integers and Division

Page 2: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

2

Number Theory

• Branch of mathematics that includes (among other things):– divisibility– greatest common divisor– modular arithmetic

Page 3: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

3

Division

• Division of one integer by another (e.g a/b) produces 2 results:– quotient: number of time b “goes into” a– remainder: what’s left over if the values don’t

divide evenly

Page 4: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

4

Division

• If a and b are integers and a 0, a divides b if there exists an integer c such that b = ac

• This also means that c divides b– a and c are factors of b– b is a multiple of both a and c

• The notation a|b means a divides, or is a factor, of b

Page 5: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

5

Division

• If n and d are integers, how many positive integers <= n are divisible by d?– All integers divisible by d are of the form dk

(where k is a positive integer)– So the positive integers divisible by d which are <=

n are is the set of all k’s such that:• 0 < dk <= n or 0 < k <= n/d

• Thus, there are n/d positive integers <= n which are divisible by d

Page 6: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

6

Theorem 1

• Let a, b & c be integers. Then:– if a|b and a|c, then a|(b+c)– if a|b then a|bc, for all integers c– if a|b and b|c, then a|c

Page 7: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

7

Proof of Theorem 1

• Part 1: if a|b and a|c, then a|(b+c)– If a|b and a|c, there must be integers s & t such

that b = as and c = at– So b+c = as+at = a(s+t)– Then by definition of divisibility, a|(b+c)

• Part 2: if a|b then a|bc for all integers c– If a|b, then b = at for some integer t– so bc = a(tc) and, by definition, a|bc

Page 8: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

8

Prime Numbers

• A positive integer that has only 2 positive integer factors (1 and itself) is a prime number

• A positive integer > 1 that is not prime is a composite

Page 9: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

9

Theorem 2: Fundamental Theorem of Arithmetic

• Every positive integer can be written as the product of primes

• Usually, the prime factors are written in increasing order, for example:

2 x 3 x 103 = 618

Page 10: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

10

Theorem 3

• If n is a composite integer, then n has a prime divisor <= n

• For example, 103 is prime because:103 = 10 and

the primes < 10 are 2, 3, 5 and 7

• Since none of these is a factor of 103, 103 must be prime

Page 11: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

11

• Divide n by successive primes, beginning with 2

• If n has a prime factor, then some prime number p <= n will be found divisible by n

• If such a value p is found, continue by factoring n/p– look for value q such that p < q <= n/p– if found, continue by factoring n/pq, etc.

Procedure for determining prime factors of and integer n

Page 12: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

12

Example

Find prime factorization of 65238:

65238 = 2 x 32619 = 2 x 3 x 10873

Testing prime numbers:

5, 7, 11, 13, 17, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79

Finally, a factor is found:65238 = 2 x 3 x 83 x 131

Since 131 < 83, no further testing required - 131 is prime

Page 13: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

13

Theorem 4: the Division Algorithm

• For any integer a and positive integer d, there exist unique integers q and r such that:

a = dq + rwith 0 <= r <= d

• In the above expression:– a is the dividend– d is the divisor– q is the quotient– r is the remainder (always positive)

Page 14: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

14

Greatest Common Divisors

• For two non-zero integers a and b, the largest integer d such that d|a and d|b is the greatest common divisor of a & b, denoted gcd (a,b)

Page 15: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

15

Finding gcd: method 1

• Find all possible divisors of both numbers, and choose the largest one they have in common

• Example: find gcd(81, 99)– factors of 81: 1, 3, 9, 27, 81– factors of 99: 1, 3, 9, 11, 33, 99– so gcd(81, 99) = 9

Page 16: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

16

Relatively prime numbers

• Two numbers are relatively prime if their gcd is 1

• Integers in a set {a1, a2, … an} are pairwise relatively prime if:gcd(ai,aj) = 1 whenever

1 <= i <= j <=n

Page 17: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

17

Relative prime examples

• (14,15,21):gcd(14,15) = 1

gcd(14, 21) = 7

gcd(15,21) = 3 so they are not relatively prime

• (7,8,9,11)gcd(7,8) = 1 gcd(8,9) = 1 gcd(9,11) = 1

gcd(7,9) = 1 gcd(8,11) = 1

gcd(7,11) = 1 so they are relatively prime

Page 18: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

18

Method 2 for finding gcd

• Use prime factorizations of integers:a = p1

a1*p2a2* … *pn

an

b = p1b1*p2

b2* … *pnbn

– each exponent is non-negative– all primes occurring in the factorizations of either

a or b are included in both factorizations, with 0 exponents where necessary

• gcd(a,b) = p1min(a1,b1)*p2

min(a2,b2)*…*pnmin(an,bn)

Page 19: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

19

Example

a = 12, b = 9

12 = 21 * 21 * 31 * 30 = 22 * 31

9 = 20 * 20 * 31 * 31 = 20 * 32

So gcd(12,9) = 2min(0,2) *3min(1,2) = 20 * 31 = 3

Page 20: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

20

Least Common Multiple

• For two positive integers a and b, the lcm(a,b) is the smallest positive integer that is divisible by both a and b

• In other words, lcm(a,b)=p1

max(a1,b1)*p2max(a2b2)*…*pn

max(an,bn)

• For example:lcm(12,9) = 2max(0,2) * 3max(1,2) = 22 * 32 = 36

Page 21: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

21

Theorem 5

• For positive integers a and b, the product of a and b is equal to gcd(a,b) * lcm(a,b)

• For example, if a=12 and b=9:12 * 9 = 108

gcd(12,9) = 3 and lcm(12,9) = 36

3 * 36 = 108

Page 22: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

22

Modular Arithmetic

• Modulus: operation that finds the remainder when one positive integer is divided by another

• a mod m = r when:a = qm + r and

0 <= r < m

Page 23: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

23

Congruence

• For two integers a and b, and positive integer m, a is congruent to b mod m if m|(a-b)This congruence is denoted: a b (mod m)

a b (mod m) if and only if a mod m = b mod m

Therefore congruence occurs between a and b (mod m) if both a and b have the same remainder when divided by m

Page 24: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

24

Congruence Examples

• Determine if 80 is congruent to 5 modulo 17– Translation: divide 80 by 17 and see if the

remainder is 5 – It isn’t: 17 goes into 80 4 times, with a

remainder of 12

• Is -29 congruent to 5(mod 17)?– 29 = 17 * (- 2) + 5 so -29 5 (mod 17)

Page 25: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

25

Theorems 6 & 7

• Theorem 6: – Let m be a positive integer:– Integers a and b are congruent modulo m if and

only if there is an integer k such that a = b + km

• Theorem 7:– Let m be a positive integer:– If a b(mod m) and c d(mod m) then– a + c b + d(mod m) and ac bd(mod m)

Page 26: 1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.

26

Section 2.4

The Integers and Division

- ends -