210 likes | 927 Views
From the last lecture:. Definition. Let a , b Z. A positive integer d is called a common divisor of a and b if d | a and d | b . For any two integers a and b the greatest common divisor is always defined (except the case a = b =0) and is denoted
E N D
From the last lecture: Definition. Let a, b Z. A positive integer d is called a common divisor of a and b if d | a and d | b . For any two integers a and b the greatest common divisor is always defined (except the case a = b =0) and is denoted by gcd (a, b). Note, that gcd (a, b) 1. • if gcd (a, b) =1, integers a and b are called relatively prime. • gcd (a, b) = gcd (b, a) = gcd (a, b) = gcd (a, b) = gcd (a, b) Theorem 1. The gcd(a, b) is the least positive value of ax+by, where x and y range over all integers.
Some consequences of the Theorem 1: • If an integer c is expressiblein the form c =ax+by , it is not • necessary that c is the gcd(a, b). But it does follow from such • an equation that gcd(a, b) is a divisor of c. Why? • From the fact that ax+by=1 for some integers x and y • we can implythat a and b are relatively prime. Why? Because ax+by=1 is divisible by gcd(a, b), that means that gcd(a, b)=1. • If d is any common divisor of two integers, i. e. d | a and d | b , • then d | gcd(a, b). Why? • gcd(na, nb)=n gcd(a, b) for any integers a, b, n .
gcd(10, 24)=2 How to find gcd of two integers? a =10, divisors: 1, 2, 5, 10 b =24, divisors: 1, 2, 3, 4, 6, 8, 12, 24 By the last Theorem 1, there are some integers x and y , such that 10x +24y =2. 10 5+24 (2) = 2 (found by inspection). So, we found an integer solution of equation 10x +24y =2. Is it unique? 10(5+12k)+24(2+5k) = 2 What if we consider equation 10x +24y =4? 5x +12y =1? 10x +24y =1?
x y Theorem 2. An integer solution (x , y) of equation ax + by =c exists if and only if c is divisible by gcd(a, b). Proof. Let d = gcd(a, b). We need to prove: 1). d | c x, y Z such that ax + by =c 2) x, y Z such that ax + by =c d | c c = nd, n Z 1) Assume d | c c = n(ax0+by0 ) = a (nx0)+b (ny0) 2) Assume ax + by =c d | a and d | b d | ax + by d | c
Given two integers a and b how can we find gcd (a, b)? Euclidian Algorithm. Consider an example:a=963, b = 637. We have 963 = 1657+306 657 = 2306+45 306 = 645+36 45 = 36+9 36 = 49 a=b q1+r1 b=r1q2+r2 r1=r2q3+r3 r2=r3q4+r4 r3=r4q5 0< r1<b 0< r2< r1 0< r3 < r2 0< r4 < r3 We are going to show that the last nonzero remainder (r4=9) is the gcd(963, 657). Let d is any common divisor of a and b: d |963 and d | 657 d | 306 d |657 and d | 306 d | 45 d |306 and d | 45 d | 36 d |45 and d | 36 d | 9 gcd(963, 657) | 9 What can be implied from here?
On the other hand 9 is a divisor of both 963 and 657. Let’s go backward: 9|306 and 9|45 9|657 963 = 1657+306 657 = 2306+45 306 = 645+36 45 = 36+9 36 = 49 9|306 and 9|45 9|657 9|45 and 9|36 9|306 9|36 and 9|9 9| 45 By the Theorem 1: gcd (963, 657) = 963 x0 +657y0 , so 9| 657 and 9| 963 9| gcd (963, 657) gcd(963, 657) | 9 and 9| gcd(963, 657) 9 = gcd(963, 657) by the property a|b and b|a (a, b>0) a=b
Euclidian Algorithms can be used to find the integers x0and y0 that give gcd (a, b)=ax0+by0. 9 = 45 36 = 45 (306 645) = 306 + 745 = 306 + 7(657 2306) = 7657 15306 = 7657 15(963 657) = 22657 15963 963 = 1657+306 657 = 2306+45 306 = 645+36 45 = 36+9 36 = 49 So we can express the last nonzero remainder 9 as the linear combination of 657 and 963: 9 = gcd (657, 963) = 657 x0+963 y0 x0=22, y0 = 15
Theorem (Euclidian Algorithm). Given integers a and b>0, we make a repeated application of the division algorithm to obtain a series of equations: a=b q1+r1 b=r1q2+r2 r1=r2q3+r3 … rj2= rj1qj+rj rj1= rjqj+1 0< r1<b 0< r2< r1 0< r3 < r2 … 0< rj<rj1 Proof. First show d =gcd(a, b)is a divisor of rj. d | a and d | b imply d | r1 because r1=a b q1.. At the next step d | b and d | r1 imply d | r2, and so on. Finally, d |rj . From the other hand rj | a and rj | b imply gcd(a, b) = ax0+by0 is divisible by rj , i. e. rj | d . d | rj and rj | d imply rj. =d = gcd(a, b).
To find integer solution of an equation ax+by=c, • we need to check first, that gcd(a, b) divides c. For example, to find integer solution for 85x +34y = 51, find the gcd(85, 34) using Euclid Algorithm: 85=342+17; 34= 172 So, gcd(85, 34)=17. Since 17|51 a solution exists. • Find the integers u, v in gcd(a, b)=au+bv. • 17 = 85 342, u = 1, v = 2. • By multiplying by 3 we find: • 51=853+34 (6), i. e. x =3, y = 6 is a solution.
1=5(u2k) +2(v+5k) where k is any integer. • Other integer solutions 51= 85x+34y 51 = 85(x 6k) +34(y+15k) 17= 85(u2k)+34(v+5k) 17 = 85u +34v 1= 5u +2v
Consider now positive integers Z+ = {1, 2, 3, …}. • Any positive integer n >1 has at least two dividers, 1 and n . • An integer p >1, that does not have any other dividers except • 1 and itself, is called a prime. • An integers n >1, that is not a prime, is composite. • Any composite integer n Z+ has a prime factor. Proof by contradiction. Assume there exists some positive integer, that has no prime factors. Then the set of such integers S and we can find the smallest element n S Z+. Since n is composite, n = k m, with 1< k, m < n, so k, m S , so they are eitherprimes or have prime factors. In either case n has a prime factor.
The first primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, … • Does this sequence has an end? This question is not as trivial as it seems! • (Euclid) There are infinitely many primes. Proof. Suppose there were only a finite number of primes p1, p2, …pk. Then form a number n = p1p2 … pk +1=2357… pk +1. n is not divisible by 2, for then both n and 2357… pk would be divisible by 2, and therefore their difference would be divisible by 2. This difference is 1, and is not divisible by 2. In the same way, n is not divisible by 3 or by 5 or … or pk. But n is either a prime or has a prime factor. In any case it is divisible by some prime p that is not among the list 2, 3, 5,…pk. It implies that there is a prime distinct from 2, 3, 5…pk, and so greater then pk. Consequently, the list of primes can never end.
Fundamental Theorem of Arithmetic. Any integern > 1 can be written as a product of prime numbers. Further, this product is unique except for rearrangement of factors. For example, take number 666. It is not a prime, because it has a factor 2, so we get 666=2333. Now 333 has an obvious factor 3, so 333=2111. Again 111 has a factor 3, and 111=337, hence: 666=23337 is a representation of the composite number 666 as a product of primes. Other examples: 12=223=223; 120 = 22235=23 3 5; But is there any another representation of 666 as a product of primes (we don’t distinguish different orders of factors)?
Proof that a prime factorization exists for any integer n >1. Prove by strong induction on n >1. Basis.n =2 is prime itself, so the proposition is true. Inductive Hypothesis. Assume that for some k >1 there exists prime factorization for all integers 1<nk. Inductive Step Consider n=k+1. We can have two cases: either n is a prime, or n is composite. In the first case we have nothing to prove. In the second case n = m1 m2 and 1< m1, m2 <n. By IH both m1, m2 have prime factorization, so n has a prime factorization as well.
If p | a we are done, so consider the case p | a / Lemma 1. If a prime p divides the product of two numbers, p | ab, it must divide at least one of them. Proof. Assume p | ab to prove that p | a or p | b. What can be implied about gcd(p, a)? Then the only common factor of p and a is 1. It implies that there exist integers x0and y0 such that p x0+ay0=1 Then b =b(p x0+ay0) = p (b x0)+(ba) y0 is divisible by p because bothp(b x0) and (ba) y0 are divisible by p. Suppose now that some number c divides the product ab, c | ab . Can we imply that c divides either a or b ?
Proof of the uniqueness of the prime factorization Prove it by contradiction. For this assume that there exist some integer that has non-unique prime factorization. By Well-Ordering Principle we can find the smallest such integer, let it be n. So we have n =p1 p2…pk = q1 q2… qs , where all pi, qj are primes. Note that p1 divides q1(q2… qs), so it either divides q1 or (q2… qs). If p1| q1 then p1= q1 , both are primes. If p1| (q2… qs), we repeat the Argument, and ultimately reach the conclusion, that p1 equals one of the primes q1,q2,… qs . Then we can cancel the common prime from the two representations and find another integer n/p1 <n that has non-unique prime factorization in contradiction with assumption, that n is the smallest one.
Suppose that the prime factorizations of the integers a and b are: (ai, bi 0 ) where all primes occurring in either factorization are included in both factorizations with zero exponent if necessary. Then The least common multiple of two integers: Now we can find another form for gcd(a, b). • This integer does divide both a and b. • No larger integer can divide both a and b.
The same value can be found from Euclid Algorithm as follows: 500 = 1204 + 20 120 =206 So, the last nonzero remainder is 20. Example. Find gcd(120, 500) using prime factorization. We have 120=23 3 5 and 500=22 53 , then gcd(120, 500)= 2min(3, 2) 3min(1, 0) 5min(1, 3) =22 30 51=20.
Theorem. If n is a composite integer, it has a prime factor less than or equal to Proof.If n is composite, it has a factor a with 0<a<n. Hence, n = ab, where both a and b are positive integers greater then 1. So, either a or b , since otherwise ab > Hence, n has a divisor less or equal . It may be either prime or composite, but in any case n has a prime factor less or equal . The contrapositive of this theorem: If an integer n does not have a prime factor less or equal to , then n is prime. Given an integer n how can we decide is it a prime or not? How many factors we need to check? Obviously we don’t need to check factors above n. But there exists better restriction.
The only primes not exceeding are : 2, 3, 5, 7. So we check that 101 is not divisible by 2, not divisible by 3, by 5 and by 7. So, 101 is prime. Example. Show that 101 is a prime.