Chapter 1 A Survey of Divisibility 14

Similar documents
2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Chapter 2. Divisibility. 2.1 Common Divisors

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Divisibility. Def: a divides b (denoted a b) if there exists an integer x such that b = ax. If a divides b we say that a is a divisor of b.

Division Algorithm B1 Introduction to the Division Algorithm (Procedure) quotient remainder

The Fundamental Theorem of Arithmetic

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

Euclidean Domains. Kevin James

Chapter 5: The Integers

Intermediate Math Circles February 26, 2014 Diophantine Equations I

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Chapter 3 Basic Number Theory

Number Theory. Introduction

4 Powers of an Element; Cyclic Groups

1 Overview and revision

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

5: The Integers (An introduction to Number Theory)

NOTES ON INTEGERS. 1. Integers

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

MATH 215 Final. M4. For all a, b in Z, a b = b a.

Ch 4.2 Divisibility Properties

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b.

The Chinese Remainder Theorem

Contribution of Problems

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

NOTES ON SIMPLE NUMBER THEORY

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Commutative Rings and Fields

Chapter 3: The Euclidean Algorithm and Diophantine. Math 138 Burger California State University, Fresno

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

D i v i s i b i l i t y

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

a = qb + r where 0 r < b. Proof. We first prove this result under the additional assumption that b > 0 is a natural number. Let

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = ,

PRIME NUMBERS YANKI LEKILI

CHAPTER 3. Congruences. Congruence: definitions and properties

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

Cool Results on Primes

The theory of numbers

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Finding Prime Factors

Elementary Properties of the Integers

The Euclidean Algorithm and Multiplicative Inverses


Definition For a set F, a polynomial over F with variable x is of the form

2 Elementary number theory

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

Number Theory and Graph Theory

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

ACCUPLACER MATH 0310

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

CSE 215: Foundations of Computer Science Recitation Exercises Set #5 Stony Brook University. Name: ID#: Section #: Score: / 4

3 The fundamentals: Algorithms, the integers, and matrices

MATH10040 Chapter 1: Integers and divisibility

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Polynomials. In many problems, it is useful to write polynomials as products. For example, when solving equations: Example:

Introduction Integers. Discrete Mathematics Andrei Bulatov

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

1 Continued Fractions

Divisibility in Z. Definition Let a, b Z be integers. We say that b divides a, if there exists c Z such that a = b c; we write b a.

Modular Arithmetic Instructor: Marizza Bailey Name:

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

a the relation arb is defined if and only if = 2 k, k

Lecture Notes. Advanced Discrete Structures COT S

Math Circles - Lesson 2 Linear Diophantine Equations cont.

+ 1 3 x2 2x x3 + 3x 2 + 0x x x2 2x + 3 4

and LCM (a, b, c) LCM ( a, b) LCM ( b, c) LCM ( a, c)

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

4. Number Theory (Part 2)

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers

7.2 Applications of Euler s and Fermat s Theorem.

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

1. multiplication is commutative and associative;

Factoring and Algebraic Fractions

4 Number Theory and Cryptography

Chapter 5. Number Theory. 5.1 Base b representations

Example: This theorem is the easiest way to test an ideal (or an element) is prime. Z[x] (x)

8 Primes and Modular Arithmetic

An Introduction to Mathematical Thinking: Algebra and Number Systems. William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005

Part V. Chapter 19. Congruence of integers

Homework 3, solutions

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

I Foundations Of Divisibility And Congruence 1

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Signature: (In Ink) UNIVERSITY OF MANITOBA TEST 1 SOLUTIONS COURSE: MATH 2170 DATE & TIME: February 11, 2019, 16:30 17:15

Math 109 HW 9 Solutions

Writing Assignment 2 Student Sample Questions


A Readable Introduction to Real Mathematics

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

Transcription:

Chapter 1 A Survey of Divisibility 14 SECTION C Euclidean Algorithm By the end of this section you will be able to use properties of the greatest common divisor (gcd) obtain the gcd using the Euclidean algorithm solve linear equations C1 Properties of the Greatest Common Divisor In this section we investigate some of the properties of the gcd and we introduce the Euclidean Algorithm, which provides a way to find the gcd of two integers. We begin by looking at solution at equations of the form: ax by gcd( a,), b where a, b, x and y are integers. Example 14 In Example 8 from Section A we found and y: Solution 36x 60y 12 gcd 36, 60 12, let us solve for integers x We have a linear equation with two unknowns. How can we solve this equation? First divide through by 12 as it is a common factor, this reduces it to: Now rearrange to make y the subject:, 3x 5y 1. 1 3 x y. 5 Remember that x and y are integers (they could be negative). This means that we can choose any integer x as long as and the resulting value for y is also an integer. For example, letting x 2 then 1 3 2 y 1. 5 There are going to be many other pairs of x and y which work. We can also solve the equation using graphs because 36x 60y 12 is equivalent to 1 3x y (see Example 14), which is a straight line as shown in 3: 5

Chapter 1 A Survey of Divisibility 15 Figure 3 The graph shows two integer solutions to 36x 60y 12 As you can observe from the graph there are two integer points (pairs) which are on the line 36x 60y 12. For instance the point 2, 1 that we found in Example 14, but we could also have found the solution x 3, y 2 which is the point 3, 2. Indeed there are an infinite number of integer points on the line 36x 60y 12. This leads us to ask, can we always find integers x and y such that ax by g where g gcd a, b It turns out that indeed we can, as we now prove.? Proposition (1.9). There are integers x and y such that How do we prove this result? ax by gcd a, b g First we show ax by is a common divisor of a and b and then we prove ax by is the largest of these common divisors. Proof. Common Divisor Consider the set S given by where both integers a and b are not zero. The set S is non-empty. Why? Let the integers x S ax by : ax by 0 a and y b (we select these integers so that ax by 0 ) then ax by a b 2 2 Therefore S is non-empty so by Well Ordering Principle (WOP): 0

Chapter 1 A Survey of Divisibility 16 Let S be a non-empty set of positive integers and zero. Then the set S has a least element. Let d be the least element of the above set S. This means there are integers x and y such that ax by d. (*) To show that d is a common divisor of a and b we make use of the Division Algorithm (1.7) of the last section: Given any integers m and n with n 1 m qn r 0 r n there exist unique integers q and r such that We start by showing that d is a divisor of a by applying the Division Algorithm (1.7): a qd r 0 r d ( ) Suppose r 0, then transposing a qd r to make r the subject yields r a qd Substituting ax by d from (*) into this gives 1 r a q ax by qx a qyb a 1 qx b qy 0 Because r 0 integer integer This implies that r is in the set S because S is defined as S ax by : ax by 0 But if r is in the set then since r<d we would have a contradiction as d is the least element. Therefore, our supposition r 0 is wrong, meaning r 0, and so a qd, which implies d a. Similarly by applying the Division Algorithm to integers b and d we can show that d b. Hence d is a common divisor of a and b. Since d a and d b it follows from Proposition (1.3): d a d b then d ax by If and that d () ax by. Largest Common Divisor for any integers x and y. Next we show d to be the greatest common divisor, gcd, of a and b. Let c be another divisor of ax by d then by (1.2) part (e) (e) If a b and b 0 then a b.

Chapter 1 A Survey of Divisibility 17 It follows that as c d where d and c are both positive c d which means d must be the greatest common divisor, gcd, of integers a and b. That is, d=g. By the above proof we also have the following two propositions: Proposition (1.10). Let gcd a, b g then (i) If d a and d b then d g. (ii) The gcd a, b g is the least positive integer value of ma nb range over all the integers. where m and n Proof. See proof of the above Proposition (1.9). Proposition (1.11). Let gcd a, b g. For any positive integer m gcd, Proof. ma mb mg By applying the above Proposition (1.10) part (ii) we have ma mb least positive value of max mby gcd, m (least positive value of ax by ) mg C2 Relatively Prime We encountered the idea of two numbers being relatively prime back in Section A. The two integers 10 and 21 are relatively prime as they have no factor in common apart from 1. The formal definition is: Definition (1.12). Integers a and b not both zero are relatively prime if gcd a, b 1 Another example of relatively prime numbers is: gcd 5, 13 1 therefore 5 and 13 are relatively prime In the next example we use the fact that 5 and 13 are relatively prime.

Chapter 1 A Survey of Divisibility 18 An important result concerning relatively prime numbers is Euclid s Lemma. It is worth learning this result as it is used throughout number theory. (Usually lemma means an intermediate result or a result used to deduce an important theorem or proposition but in this case Euclid s Lemma is a critical result in its own right.) Euclid s Lemma (1.13). If a b c gcd a, b 1 then a c. with Before we prove this let us see it in action. Example 15 Given 13 5117 show that 13 117. Solution gcd 13, 5 1 and so by Euclid s Lemma (1.13) we have 13 117. Let us now prove the Lemma. Proof. By Proposition (1.5) of the last section: Proposition (1.5). If gcd a, b g There are integers m and n such that then there are integers m and n such that ma nb g ma nb 1. [Because we are given gcd a, b g 1 ] Multiplying both sides by an integer c gives cma cnb m ac n bc c. (*) Now, we are given that a b c therefore there is an integer k such that Substituting this into (*) gives The result a mc nk c This completes our proof. ak bc. () m ac n bc m ac n ak a mc nk c means that a integer Factorizing By (*) c so we have a c

Chapter 1 A Survey of Divisibility 19 Figure 4 Euclid is famously known for his work The Elements which is also called Euclid s Elements. This work has been used in mathematics teaching for over two thousand years and was first published as a book in 1482. Only the bible has been printed more times than Euclid s Elements. Up until the 1970 s school mathematics in Britain consisted of learning various parts of Euclid s Elements. The concept of mathematical proof and logical reasoning is what made this work survive for so long. C3 Euclidean Algorithm The Euclidean algorithm is used to find the gcd of any two positive integers. Say we are asked to determine the gcd5291, 3108. How are we going to find the greatest common divisor of these numbers? Listing the divisors of each and looking for divisors which are common to both numbers will take considerable time. We need a simpler approach the Euclidean algorithm. The Euclidean algorithm is the most efficient way of finding the gcd of any two integers as it removes the need to find all the factors of the two given integers. This is quicker and less tedious than finding all the factors, especially if the integers are large. Next we describe the Euclidean algorithm which is based on the repeated application of the Division Algorithm (1.7) of the last section: Division Algorithm (1.7) Given any integers a and b with b 1 integers q and r such that a bq r 0 r b there exist unique We repeated apply the Division Algorithm to the two given integers a and b, the gcd of these given integers a and b turns out to be the last non-zero remainder as the next example demonstrates: Example 16 Determine gcd666, 31. Solution We underline the remainder at each step for clarity. Applying the division algorithm to 666 and 31 gives 666 21 31 15

Chapter 1 A Survey of Divisibility 20 The remainder is 15 which is non-zero so we apply the division algorithm to 31 and 15: 31 2 15 1 Again the remainder 1 is non-zero so we continue to apply the division algorithm to 15 and 1: 15 15 1 0 Now we have a remainder of zero which means we stop the process. What is gcd 666, 31 equal to? It is the last non-zero remainder which is 1. Hence gcd666, 31 1 relatively prime. that is they are The general Euclidean algorithm procedure for a b 1 is given by: 1. Dividing a and b and applying the division algorithm gives 2. If the remainder r 1 0 then a bq1 a bq r 0 r b 1 1 1 and gcd, gcd, means we are done because we have found gcd a, b b. a b bq b b. This 3. If r1 0 then a bq1 r1 and we divide b by r 1. Writing this in terms of quotient q2 and remainder r 2 gives 4. If the remainder r2 0 b r q r 0 r r 1 2 2 2 1 then we are done. Otherwise we repeat the above process of applying the division algorithm to r 1 and r 2. We continue in this manner until we get a remainder of zero. 5. The last non-zero remainder is the gcd of the given integers a and b. We will prove step 2 below. However prior to the proof of this we will demonstrate the Euclidean algorithm with an example. Example 17 By applying the Euclidean algorithm find gcd 5291, 3108 and simplify 5291 3108. Solution Dividing 5291 by 3108 gives 5291 1 3108 2183 Since we do not have a zero remainder we continue to apply the division algorithm until we get a zero remainder: 1

Chapter 1 A Survey of Divisibility 21 The last non-zero remainder is 37 so 5291 1 3108 2183 3108 1 2183 925 2183 2 925 333 925 2 333 259 333 1 259 74 259 3 74 37 74 2 37 0 gcd 5291, 3108 37 How can we simplify the given fraction 5291 3108? By Proposition (1.5) of Section A: Last non-zero remainder. If gcd a, b g a b then gcd, 1. g g This means that dividing the numerator 5291 and denominator 3108 by 37 which is the gcd gives no factors in common after division. Therefore 5291 14337 143 3108 8437 84 Cancelling 37's This 143/84 is the simplest fraction of 5291/3108 because by (1.5) we have gcd 143, 84 1 So these numbers (143 and 84) are relatively prime. We need to prove that the gcd of given integers a and b is equal to the gcd of b and r where r is the remainder when we divide a and b. [This was step 2 of the Euclidean algorithm.] Proposition (1.14). If a bq r 0 r b Then g gcd a, b gcd b, r Proof... Required to prove that g g. 1 2 Let g gcd a, b 1 and g gcd 2 b, r From g gcd 1 a, b we have g, g 1 1 a b and we are given a bq r so g 1 r. Since g b and g 1 1 r so g 1 is a common divisor of b and r so by the definition (1.4): (ii) if for any c we have c x and c y then c g where g gcd x, y.

Chapter 1 A Survey of Divisibility 22 We have g g because g 1 2 2 gcd b, r Similarly by considering g2 gcd b, r Hence g g. 1 2. we can deduce that g g. 2 1 C4 Solving Linear Equations We can use the Euclidean algorithm in reverse order to solve linear Diophantine equations like 666 x 31 y gcd 666, 31 In Example 16 we found gcd 666, 31 1. Thus this linear equation is 666x 31y 1 It is going to have an infinite number of solutions. Why? Drawing the graph of this straight line 666x 31y 1 : Figure 5 Showing an integer solution of the line 666x 31y 1. Any point on this straight line is a solution to 666x 31y 1. However we are only interested in integer solutions to this equation. How can we find integer solutions? We can use Example 16 because we had: From (**) we have 666 21 31 15(*) 31 2 15 1 ** 1 31 2 15 31 2 666 21 31 By (*) 31 2 666 42 31 Expanding the brackets 43 31 2 666 Collecting like terms

Chapter 1 A Survey of Divisibility 23 We have 3143 666 2 1 of x and y?. We wanted to solve 666x 31y 1. What are the values Clearly x 2 and y 43. This is the point shown on the above graph in Fig. 5. Example 18 Solve 5291x 3108y gcd 5291, 3108 Solution for integer solutions. What are we trying to find? The integer values of x and y which satisfy the given equation. We have already found the gcd of 5291 and 3108 in Example 17. We had the following (step numbers have been added): 5291 13108 2183 1 3108 12183 925 2 2183 2925 333 3 925 2333 259 4 333 1259 74 5 259 374 37 6 37 was the last non-zero remainder so gcd 5291, 3108 37 reverse order to obtain integer values of x and y such that From step (6) we can write 37 as 5291x 3108y 37 37 259 374 259 3333 259 Using step (5) 4259 3333 Collecting like terms 4925 2333 3333 Using step (4) 4925 11333 Collecting like terms 4925 112183 2925 Using step (3) 26925 112183 Collecting like terms 263108 2183 112183 Using step (2) 263108 372183 Collecting like terms 263108 375291 3108 Using step (1) 633108 375291 Collecting like terms We have 633108 375291 =37. What are the values of x and y in Re-writing this 633108 375291 =37 5291x 3108y 37? as. We use these 6 steps in

Chapter 1 A Survey of Divisibility 24 310863 529137 =37 yields x 37 and y 63 The value 37 is the smallest positive integer of 5291x 3108y. How do we know this? Because of Proposition (1.10) part (ii): (ii) The gcd a, b g is the least positive integer value of ma nb range over all the integers. What can you say about the linear equation 5291x 3108y 36? It has no integer solutions because the least value of this linear combination 5291x 3108y is 37. where m and n Note that by applying the Euclidean algorithm we can find the gcd of any two positive integers a and b plus solve the linear equation for integer solutions. SUMMARY ax by gcd a, b We use the Euclidean algorithm to find the gcd of two numbers a and b. By reversing the steps of the Euclidean algorithm we can solve the linear equation ax by gcd a, b