C Roettger, Spring 2013 Math 350 – Exam 1B – Solutions Problem 1 Convert 10110012 to base 10 and BEAD to binary. = 26 + 2 4 + 2 3 + 2 0 = 64 + 16 + 8 + 1 = 89 = 1011, 1110, 1010, 11012 10110012 BEAD16 Convert from base 16 to base 2 by expressing each hexadecimal digit as a fourdigit number in base 2 - pad the front with 0s if necessary. Think about why this works! The commas are only for indicating these four-digit numbers in base 2. Problem 2 a) Find integers s, t such that 100s + 27t = 1 b) Find the inverse of 27 modulo 100. a) The extended Euclidean algorithm gives s t 100s + 27t 1 0 100 0 1 27 1 −3 19 −1 4 8 3 −11 3 −7 26 2 10 −37 1 (the next remainder is zero, so the gcd(100, 27) = 1 and 10 · 100 − 37 · 23 = 1. b) By part a), the inverse of 23 modulo 100 is 100 − 37 = 63 (no marks taken off if you used −37 itself, but the standardized system of representatives for congruence classes modulo 100 is of course 0, . . . , 99). Problem 3 Five Chinese pirates wanted to divide their loot of gold ducats equally amongst themselves. Four ducats remained, and in the ensuing argument one pirate was killed. The remaining four pirates tried to divide the loot equally, and two ducats remained. One was killed, and the last three pirates could divide the loot equally amongst themselves. What is the smallest possible number of ducats so this could happen (the pirates did not make mistakes in arithmetic)? The number x that we are looking for satisfies x ≡ 4 (mod 5) x ≡ 2 (mod 4) x ≡ 0 (mod 3) The Chinese Remainder Theorem (proof of it, rather) says compute M1 = 4·3 = 12, M2 = 5 · 3 = 15, and M3 = 5 · 4 = 20. Then 12 · 3 ≡ 1 (mod 5), 15 · 3 ≡ 1 (mod 4) and 20 · 2 ∼ = 1 (mod 3). We follow the book and put x ≡ 4 · 12 · 3 + 2 · 15 · 3 + 0 = 234 (mod 60). We can change this modulo 60 and still keep all the congruences above valid. But modulo 60, there is only this solution! So the answer is x = 234 mod 60 = 54. Problem 4 How many solutions does the congruence 9x ≡ 6 (mod 12) have (incongruent modulo 12)? List all solutions. Either you remember that we had a theorem giving the number of solutions as gcd(12, 9) = 3. Or you play it safe, reproduce a bit of the proof of that theorem: First, divide by the gcd(12, 9) = 3 to get the equivalent congruence 3x ≡ 2 (mod 4). This has exactly one solution modulo 4 because gcd(3, 4) = 1 (it is x ≡ 2 (mod 4)). There are 3 values of x modulo 12 that match this condition, x = 6, 8, 10. Problem 5 If x is any positive integer, what are the possible last digits of the base 16-representation of x4 ? Do not just list them, show your reasoning using congruences. If x is even, x = 2k, then 16 divides x4 = 16k 4 . So in this case, the last digit of x in base 16 is 0. If x is odd, x = 2k + 1, then we can either write x4 ≡ (2k)4 + 4(2k)3 + 6(2k)2 + 4(2k) + 1 ≡ 8(3k 2 + k) + 1 and this is congruent to 1 modulo 16, because 3k 2 + k is always even. Therefore the last digit of x4 is 1 in this case. Alternatively, you could just observe that the last digit of any number equals the remainder of that number modulo 16, and the last digit of x4 equals that of d4 if x ≡ d (mod 16). So it is enough to check the numbers x = 0, . . . 15 (cut down on the computations by observing that (16 − d)4 and d4 have the same last digit). Problem 6 Let fn be the n-th Fibonacci number (so f0 = f1 = 1, fn+2 = fn+1 + fn ). Prove that for all n, fn+3 = 2fn+1 + fn . Base step – n = 0: the claim is obviously true. Induction step – assume the claim is true for one value of n (the induction hypothesis). We substitute n + 1 for n, so the statement to prove is fn+4 = 2fn+2 + fn+1 . First, using the definition of Fibonacci numbers, fn+4 = fn+3 + fn+2 . 2 Then we can use the induction hypothesis, replacing fn+3 by 2fn+1 + fn . So fn+4 = 2fn+1 + fn + fn+2 = fn+1 + fn+2 + fn+2 = 2fn+2 + fn+1 which is what we had to prove. In the last step, we have used the definition of Fibonacci numbers again, backwards. Nice alternative solution, only using the recursive definition of Fibonacci numbers, no induction (well, one could argue that the recursive definition hides an induction in that it claims to define fn for all n). fn+3 = fn+2 + fn+1 = fn+1 + fn + fn+1 = 2fn+1 + fn 3