Professional Documents
Culture Documents
Prob 4 Solutions
Prob 4 Solutions
Professor: Bejenaru
TA: Robert Won
Proof. By homework problem 15.5, either a2 = 4p1 or a2 = 4p1 + 1 for some p1 Z. Similarly,
b2 = 4p2 or b2 = 4p2 + 1. Then we must have that
3. Use the result of Question 2 (a2 is divisible by 5 a is divisible by 5) to prove that there
does not exist a rational number whose square is 5.
Proof. Suppose for contradiction that there existed a rational number whose square is 5. Write this
rational as p/q where p, q Z and gcd(p, q) = 1. Then p2 /q 2 = 5. Since p2 = 5q 2 , p2 is divisible
by 5, so by Question 2, we have that p is divisible by 5. Hence, p = 5r for some r Z. But then
p2 = (5r)2 = 25r 2 and so 25r 2 = 5q 2 q 2 = 5r 2 . Now by the same logic, q is divisible by 5. But
this is a contradiction, since gcd(p, q) = 1, but both are divisible by 5.
Proof. Suppose for contradiction there existed a rational number whose square is 98. Again, write
this rational as p/q where p, q Z and gcd(p, q) = 1. Since p2 /q 2 = 98, p2 = 98q 2 is even. But
we proved in Problems I.7 that if p2 is even then p is even. So p = 2r for some r Z and hence
4r 2 = 98q 2 . So 2r 2 = 49q 2 . The left-hand side is even, so the right-hand side is even, hence q 2
must be even. But since q 2 is even, q is even. This is a contradiction, since gcd(p, q) = 1 but p and
q are both even.
I will always provide full solutions to graded homework exercises. If I think I left something too unclear during
section, or if many students are having trouble with the same thing, I will post solutions to those problems as well.
1
6. Use the Euclidean algorithm to find the greatest common divisors of (i) 165 and 252, (ii)
4284 and 3480.
252 = 165 1 + 87
165 = 87 1 + 78
87 = 78 1 + 9
78 = 9 8 + 6
9=61+3
6=32+0
so gcd(165, 252) = 3.
For (ii),
7. Let un be the nth Fibonacci number. Prove that the Euclidean algorithm takes precisely n
steps to prove that gcd(un+1 , un ) = 1.
Proof. Note: This problem is not quite true, as stated. There are a few ways you can modify the
statement to make it true. We could prove that it takes n 1 steps for all n 2. Or we could
reindex the Fibonacci sequence so u0 = 1, u1 = 1, and prove the result for all n 1. Ill do the
latter.
Proceed by induction on n. For the base case, u1 = 1, u2 = 2. So the Euclidean algorithm
1 = 12+0
uk+2 = uk+1 + uk .
But now this reduces to finding gcd(uk+1 , uk ), which will take an additional k steps by the induction
hypothesis. Hence, the Eucliean algorithm will take exactly k + 1 steps to find gcd(uk+2 , uk+1 ).