10.07.2015 Views

The Euclidean Algorithm : Problems with Solutions - The University ...

The Euclidean Algorithm : Problems with Solutions - The University ...

The Euclidean Algorithm : Problems with Solutions - The University ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ThusSo, by the theorem we have1 = 7 − 2 · 3= 7 − 2 · (10 − 1 · 7)= 3 · 7 − 2 · 10= 3 · (27 − 2 · 10) − 2 · 10= 3 · 27 − 8 · 10= 3 · 27 − 8 · (37 − 1 · 27)= 11 · 27 − 8 · 37= 11 · (101 − 2 · 37) − 8 · 37= 11 · 101 − 30 · 37x = 11 · 3819 + 37ty = −30 · 3819 − 101tas the general solution.(Alternatively) We could instead make the following observations:3700 = 100 · 37101 = 1 · 101giving the following general solution18 = (18 · 11) · 101 + (18 · −30) · 37∴ 3819 = 199 · 101 + −440 · 37x = 199 + 37sy = −440 − 101swhere s ∈ Z. <strong>The</strong> advantage of the second approach is that it yields a much smallerstarter solution, making it that much easier to determine whether x, y can both bepositive. We see that for y to be positive s ≤ −5, and for x to be positive s ≥ −5.Thus, if s = −5, both x and y are positive, and the solution in this case is:x = 14 and y = 65,and this is the unique solution <strong>with</strong> this property.7. A grocer orders apples and oranges at a total cost of $8.39. If apples cost 25c each andoranges cost 18c each, how many of each type of fruit did the grocer order?Solution.Let x be the number of apples and y be the number of oranges. <strong>The</strong>n25x + 18y = 839.Applying a slight modification of the <strong>Euclidean</strong> <strong>Algorithm</strong> to 25 and 18 we have25 181 18 14 27 42 8−13


Since k 7k and k ks, but 2̸ k we must have k s. Write s = kt. <strong>The</strong>n2t + 7 = ktand we have that t 7 (i.e. t ∈ {±1, ±7}) and k = 2 + 7/t, giving:x = 7(2 + 7/t)y = 2(2 + 7/t)t.Like the previous case, since x, y are non-zero, t ≠ −7. Enumerating the possibilitiesfor the pairs (x, y) we get(63, 18), (−35, 10), (21, 42).We found the pair (21, 42) (in the reverse order) in Case 1.Thus the complete list of pairs for (x, y) is(210, 15), (−182, 13), (112, 16), (−84, 12), (42, 21), (−14, 7), (28, 28), (63, 18), (−35, 10),or of course the same pairs in reverse order.(Alternatively) We start by multiplying through by 14xy; then rearrange and factorise:14x + 14y = xyxy − 14x − 14y = 0(x − 14)(y − 14) = 14 2 = 2 2 · 7 2= ±1 · ±196= ±2 · ±98= ±4 · ±49= ±7 · ±28= ±14 · ±14where signs align. We observe that the given equation is symmetric in x, y, so that if (x, y)is a solution then so is (y, x). So, we need only consider one ordering of the factors tohalve our initial search. Thus, <strong>with</strong> |x − 14| ≤ |y − 14|, the possible ordered pairs(x − 14, y − 14) ∈ {(1, 196), (2, 98), (4, 49), (7, 28), (14, 14),(−1, −196), (−2, −98), (−4, −49), (−7, −28), (−14, −14)}∴ (x, y) ∈ {(15, 210), (16, 112), (18, 63), (21, 42), (28, 28),(13, −182), (12, −84), (10, −35), (7, −14), (0, 0)}1Checking, e.g.14, we find all the above pairs work, except (0, 0). So,taking account of symmetry, the list of all solutions (x, y) is15 + 1210 = 210+1415·210 = 1(15, 210), (16, 112), (18, 63), (21, 42), (28, 28),(13, −182), (12, −84), (10, −35), (7, −14),(210, 15), (112, 16), (63, 18), (42, 21), (−182, 13), (−84, 12), (−35, 10), (−14, 7)(17 solutions in all). You should find this solution agrees <strong>with</strong> above.6


∗10. When Jane is one year younger than Betty will be when Jane is half as old as Betty willbe when Jane is twice as old as Betty is now, Betty will be three times as old as Janewas when Betty was as old as Jane is now.One is in her teens and ages are in completed years. How old are they?Solution. Let Jane’s age now be x and Betty’s age now be y. Also, we will representthe ages of Jane and Betty at time i by x i and y i respectively. Let’s rewrite the giveninformation, including these choices of variables.When Jane [is x 1 , she] is one year younger than Betty will be [when she is y 2and] when Jane [is x 2 and she] is half as old as Betty will be [when she is y 3and] when Jane [is x 3 and she] is twice as old as Betty is now [when she isy], Betty will be [y 1 and she will be] three times as old as Jane was when [shewas x 4 and when] Betty was [y 4 and she was] as old as Jane is now [when she is x].So we get the following equations:x 1 = y 2 − 1x 2 = 1 2 y 3x 3 = 2yy 1 = 3x 4y 4 = x.Now define a, b, c, d such that x 1 = x + a, x 2 = x + b, x 3 = x + c, x 4 = x + d; so thaty 1 = y + a, y 2 = y + b, y 3 = y + c, y 4 = y + d. Hence the above equations become:x + a = y + b − 1x + b = 1 2(y + c)x + c = 2yy + a = 3(x + d)y + d = x.Now rearrange these equations (and multiply by a factor where appropriate):x + a − b = y − 1x + b − 1 2 c = 1 2 y12 x + 1 2 c = y3x − a + 3d = y3x − 3d = 3y.Adding these equations we find that a, b, c, d cancel and we get:8 1 2 x = 6 1 2 y − 1i.e.13y − 17x = 2. (1)Since x, y are only allowed to be integers, this equation is an example of a linear DiophantineEquation. A method for solving such an equation is to first apply the <strong>Euclidean</strong>7


<strong>Algorithm</strong> to find the gcd d of 13 and 17 (which is clearly 1). Tracing the algorithm backwardsone can express d in terms of 13 and 17. Applying the <strong>Euclidean</strong> <strong>Algorithm</strong> then(see Notes) we get:13 173 12 13 11 4ThusSo1 = 13 − 12= 13 − 3 · 42 = 8 · 13 − 6 · 17= 13 − 3 · (17 − 13)= 4 · 13 − 3 · 17.= 8 · 13 + 13 · 17t − 13 · 17t − 6 · 17= 13(8 + 17t) − 17(6 + 13t).Comparing the above <strong>with</strong> (1) we see that we have a solution for (1) ifx = 6 + 13ty = 8 + 17tfor some integer t, which by the theorem in the notes is the general solution. We were alsogiven that one girl was in her teens, so that t must be 1 andHence Jane is 19 and Betty is 25.x = 19, y = 25.8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!