Question text is in black, solutions in blue.
Q1: 20 points Q2: 20 points Q3: 20 points Q4: 20 points Q5: 20 points plus 10 extra credit Total: 100 points plus 10 extra credit
Questions 1 and 2 deal with the Fibonacci sequence from Discussion #5. Recall that the function F from naturals to naturals is defined recursively, by the rules F(0) = 0, F(1) = 1, and (for n > 1) F(n) = F(n-1) + F(n-2). As we calculated in the discussion, F(2) = 1, F(3) = 2, F(4) = 3, and F(5) = 5.
Base case: n = 0, SE(n) = SE(0) = 0, F(2n+1) - 1 = F(1) - 1 = 0.
Inductive case: Assume SE(n) = F(2n+1) - 1. By the definition,
SE(n+1) = SE(n) + F(2n+2). By the IH, this is F(2n+1) - 1 + F(2n+2),
and by the Fibonacci rule, this is F(2n+3) - 1 = F(2(n+1)+1) - 1 as
desired, completing the induction.
Base case: n=0, F(6n) = F(0) = 0 and 0 is congruent to 0 mod 4.
F(6n+1) = F(1) = 1, and 1 is congruent to 1 mod 4.
Inductive case. Assume that F(6n) ≡ 0 and F(6n+1) ≡
1, both modulo 4. We can compute the value of the following
Fibonacci numbers mod 4: F(6n+2) = F(6n+1) + F(6n) ≡ 1 + 0 = 1;
F(6n+3) = F(6n+2) + F(6n+1) ≡ 1 + 1 = 2; F(6n+4) = F(6n+3) +
F(6n+2) ≡ 2 + 1 = 3; F(6n+5) = F(6n+4) + F(6n+3) ≡ 3 + 2
≡ 1; F(6n+6) = F(6n+5) + F(6n+4) ≡ 1 + 3 ≡ 0; and
F(6n+7) = F(6n+6) + F(6n+5) ≡ 0 + 1 = 1. We have proved that
F(6(n+1) is congruent to 0 and that F(6(n+1)+1) is congruent to 1,
where
again all these congruences are modulo 4.
I want 143 x to be congruent to 6, modulo 100. Since 143 is congruent to 43, I can rewrite this as 43x ≡ 6 (mod 100).
The Inverse Theorem says that if a and m are two positive naturals, a has an inverse modulo m if and only if a and m are relatively prime. An inverse of a modulo m is a natural b such that ab is congruent to 1, modulo m.
By the Euclidean Algorithm, 100 = 2(43) + 14, 43 = 3(14) + 1. Since we reached 1, we know the original numbers have a gcd of 1 and are thus by definition relatively prime.
The extended Euclidean Algorithm gives me the successive equations 100 = 1*100 + 0*43, 43 = 0*100 + 1*43, 14 = 1*100 - 2*43, and 1 = -3*100 + 7*43. So 7 is an inverse of 43, modulo 100, and -3 or 40 are inverses of 100, modulo 43.
If a is relatively prime to 100, I can make any b by the technique we used in part (d). If a and 100 have a gcd g that is greater than 1, we can make b if and only if b is a multiple of g. To prove this, note first that every linear combination of a and m must be divisible by g. We can make g cents modulo m with some number of chocolate bars because the extended Euclidean Algorithm allows us to find a linear combination of a and m to make every number that occurs in the ordinary Euclidean Algorithm, including the final such number which is g. We can then make b, if b is any multiple of g, by multiplying this linear combination by the right factor b/g.
(Note: This directed graph models the pattern of one-way streets in large parts of Manhattan Island.) It is not important to the problem how far G extends.
Here is an ASCII-art picture of part of G:
N03 <--- N13 <--- N23 <--- N33 <--- ... ^ | ^ | | | | | | v | v N02 ---> N12 ---> N22 ---> N32 ---> ... ^ | ^ | | | | | | v | v N01 <--- N11 <--- N21 <--- N31 <--- ... ^ | ^ | | | | | | v | v N00 ---> N10 ---> N20 ---> N30 ---> ...
Recall the inductive definition of paths in a directed graph:
For the base case, the length-0 path goes to N0,0 and the
length 0 is in fact greater than or equal to i+j = 0.
For the inductive case, let β be a path obtained by adding
one edge to a path α and assume that our conclusion holds for
α. If β ends at Ni,j, then α must end
at Ni-1,j, Ni+1,j, Ni,j-1, or
Ni,j+1. In all four cases, the IH tells us that the
length of α is at least i+j-1. The length of β is one
greater than the length of α, and thus is at least i+j.
If i is even, I can go east from N0,0 to Ni,0, using i steps, then go north to Ni,j in j steps because the edges with that value of i ("avenues") go north. If j is even, I can go from N0,0 north to N0,j and then go east (on an even-numbered "street") to Ni,j, using i+j edges in all. If both i and j are even, I could use either path.
For the base case, the empty path does not go to such a node, and
so we have nothing to prove. In the inductive case, let α be
a path from N0,0 to Ni,j with i and j both
odd, and let α be some path β followed by a single edge.
By the definition of the graph, β must end at either
Ni+1,j or Ni,j+1, because these are the
sources of the only edges that end at Ni,j. By the
result of part (a), the length of β is at least i+j+1. Since
α is β plus one more edge, its length is at least i+j+2.
This is sort of a strange induction, because it never uses the
inductive hypothesis. We still need to prove the result for all
paths, but the result of (a) is enough to get our conclusion -- we
don't need to talk about a path to another odd-odd node.
Last modified 2 April 2011