Chapter 2 Division and Euclidean Algorithm Chapter 2 Division and Euclidean Algorithm SECTION A Division Algorithm By the end of this section you will be able to understand what is meant by the division algorithm apply the division algorithm A1 Introduction to Division Algorithm We all know how to divide two numbers. For example 25 divided by 4 can be written as: 6 Rem 1 4 25 24 1 We can write this as 25 6 4 1 The number 6 is called the quotient and 1 the remainder. Let us place a geometric interpretation of this example: Figure 1 Of course the above can also be written as: 25 7 4 3 25 5 4 45 25 1 4 21 There are an infinite number of ways we can write 25 as a multiple of 4 plus a remainder. This is of no use to us because we want a unique way of writing this. How can we achieve this? We place a restriction on the remainder – the remainder is greater than or equal to zero but less than 4. With this restriction we have a unique way of dividing 25 by 4 which is our first answer, 25 6 4 1 . Example 1 Express the following numbers in terms of quotient and remainder: (a) 27 by 5 (b) 365 by 7 (c) 159 by 3 Let us generalize the above results. Let a and b 0 be our given integers. Then there exists a quotient q and a remainder r such that a bq r If we restrict our reminder r such that 0 r b then our expression a bq r is unique. We can place a geometric view on this as follows: 1 Chapter 2 Division and Euclidean Algorithm 2 Figure 2 We are now in a position to write down the general Division Algorithm. Theorem (2.1). Division Algorithm. Given integers a and b 0 there exists unique integers q called the quotient and r called the remainder such that a bq r 0r b We need to prove this result. How? By showing existence of q and r and also uniqueness of these integers. Proof. Existence Let S be the set S a xb x and a xb 0 . We first show that the set S is nonempty. How? Select an integer x so that a xb 0 . Let x a then a xb a a b a 0 Because b 1 Hence the set S is non – empty. We can now apply the Well Ordering Principle: Well Ordering Principle Let S be a non-empty set of positive integers and zero. Then the set S has a least element. This means that x S , l S such that x l . There exists a least element of the set S, say r which of course is an integer. We have r S which means there exists an integer x q such that r a qb 0 We also need to show that r b . How? By contradiction. Suppose r b . Then r b 0 which means it is a member of the set S because S a xb x and a xb 0 . We are given that b 0 [positive] so r b r This is a contradiction because r is the smallest element of S. Hence r b . Uniqueness How do we prove that the integers q and r are unique? Again by contradiction. Suppose there also exists integers q ' and r ' such that a bq ' r ' 0 r'b We already have a bq r 0r b Then a bq r bq ' r ' where 0 r b and 0 r ' b . Subtracting these two integers gives 0 bq bq ' r r ' Re-arranging this gives and taking the modulus gives r r' b q q' We have the inequalities 0 r b and b r ' 0 . Hence b r r ' b or equivalently Chapter 2 Division and Euclidean Algorithm 3 r r' b However b q ' q is a multiple of b so we must have q ' q 0 q ' q . Substituting this into the above r r ' b q ' q gives r r ' 0 r r ' . Hence the integers q and r are unique. ■ Example 2 Show that a a2 2 3 is an integer for every integer a . Solution How do we prove this result? By applying the Division Algorithm with b 3 and any integer a: a 3q r 0r 3 This means the remainder r 0, 1 or 2 . We have a 3q, 3q 1 and 3q 2 Substituting each of these into the given number a a2 2 3 Substituting a 3q : 3 q 9q 2 2 3 Substituting a 3q 1 : 3q 1 3q 1 2 2 3 q 9q 2 2 3q 1 9q 2 6q 1 2 3 3q 1 9q 6q 3 2 Substituting a 3q 2 : 3q 2 3q 2 2 3 2 3 3 3q 1 3q 2 2q 1 3 3q 1 9q 2 a a 2 12q 4 2 3 3 3q 1 3q 4q 2 2 3 3q 1 3q 2 2q 1 3q 1 3q 2 4q 2 2 Hence in each case 3 is an integer. For any every integer a we have a a2 2 integer. Corollary (2.2). Given integers a and b with b 0 there exists unique integers q and r such that a bq r 0r b 3 is an Chapter 2 Division and Euclidean Algorithm 4 Proof. If b is positive then we are done because we have the result by the Division Algorithm. If b is negative, b 0 , then we consider b 0 . Applying the Division Algorithm to a and b 0 we have a b qr 0r b b if b 0 Remember b . b if b 0 In the case where b b we can write the above expression a b q r bq r bq ' r 0r b Let q ' q This completes our proof. ■ Example 3 Show that the cube of any integer is of one of the following forms: 9k , 9k 1, 9k 2 Solution How do we prove this result? By applying the Division Algorithm with b 9 : n 9q r 0r 9 Taking the cube of this gives 3 3 2 n 3 9q r 9q 3 9q 3 9 q r 3 9 k r 3 By binomial What values can r take? r 0, 1, 2, 3, r 0 , 1 , 2 , 3 , 3 9 k 3 3 3 3 , 8 3 , 8 0, 1, 8, 27 9 3 , 64 3 21 1, 125 3l 8, 3 r can only take the form 0, 1 and 8. Hence n3 9k r 3 9k , 9k 1 or 9k 8 Example 4 Show that 3a 2 1 is never a perfect square. [Hint: The square of any integer is either of the form 3k or 3k 1 .] Solution By hint every square is of the form 3k or 3k 1 . Suppose 3a 2 1 is a perfect square. Then 3a 2 1 3k 3 a2 k 1 This is impossible because 3 integer 1 . Similarly we have 3a 2 1 3k 1 3 a2 k 2 We cannot have 3 integer 2 . Hence 3a 2 1 is never a perfect square. Chapter 2 Division and Euclidean Algorithm If 5