Assignment 5 S
Assignment 5 S
Question A1:
Suppose that bn = n3n for every value of n.
(a) Compute a formula for bn − 3bn−1 when n ≥ 1. (Use algebra to simplify your formula.)
bn − 3bn−1 = n3n − 3(n − 1)3n−1 = n3n − (n − 1)3n = 3n
(b) Compute a formula for bn − 6bn−1 + 9bn−2 when n ≥ 2. (This should simplify a lot.)
bn − 6bn−1 + 9bn−2 = n3n − 6(n − 1)3n−1 + 9(n − 2)3n−2 = n3n − 2(n − 1)3n + (n − 2)3n
= n − 2(n − 1) + (n − 2) 3n = 0 · 3n = 0
Question A2:
Let dn = 5 · (−2)n + 2 · (3)n . Which of the following recurrences is satisfied by dn ? (See 8.2 Theorem 1)
(i) dn = 6dn−1 + 5dn−2 , (ii) dn = 4dn−1 − 6dn−2 , (iii) dn = dn−1 + 6dn−2 ,
(iv) dn = dn−1 − 5dn−2 , or (v) no correct answer is provided
We see that the right hand side of (iii) is
5 · (−2)n−1 + 2 · (3)n−1 + 6 · 5 · (−2)n−2 + 6 · 2 · (3)n−2 = − 52 + 15 n 2 4
3n ,
dn−1 + 6dn−2 = 2 (−2) + 3 + 3
5 15 n 2 4 n n n
but − 2 + 2 (−2) + 3 + 3 3 = 5 · (−2) + 2 · (3) = dn , so recurrence (iii) is satisfied.
Alternatively, instead of checking this directly, we could have used the theory of recurrence equations
from section 8.2 of the reading, and noted that dn should satisfy a recurrence with characteristic equation
(x − 3)(x + 2) = 0. Expanded this gives x2 − x − 6 = 0, or x2 = x + 6, which corresponds to the recurrence
dn = dn−1 + 6dn−2 .
Question A3:
Let an = 3n(2)n + 4(2)n . Which of the following recurrences is satisfied by an ? (See 8.2 Theorem 2)
(i)an = 4an−1 + 4an−2 , (ii) an = 4an−1 − 4an−2 , (iii) an = 2an−1 + 2an−2 ,
(iv) an = 7an−1 − 16an−2 + 12an−3 , or (v) no correct answer is provided
From the theory of linear recurrences, we see that an should be a solution to any with a characteristic
equation have (x − 2) as a root of multiplicity 2. In this case, both (ii) and (iv) fit the bill, since (ii) has
characteristic equation x2 = 4x − 4, and x2 − 4x + 4 = (x − 2)2 , while (iv) has characteristic equation
x3 = 7x2 − 16x + 12, and x3 − 7x2 + 16x − 12 = (x − 3)(x − 2)2
A direct verification is significantly more tedious in this case.
Question A4:
√
10± 100−48
√
Use the quadratic formula to find the two solutions to x2 − 10x + 12 = 0. x = 2 =5± 13
Last assignment (question B4(c)) we saw how we could use a bijection from N × N to N to build a bijection
from N × N × N to N. This idea can be used any time there is a bijection between S × S and S. This
rarely happens with finite sets, but is a property that is shared by most infinite sets (in fact we do not
have a way to describe any infinite sets for which no such bijection exists).
Question B1:
Show that if S is a finite set with |S| > 1, then there is no bijection from S × S to S.
Hint: What are the cardinalities of S and S × S?
If there is a bijection from S × S to S, then |S × S| = |S|. But if S is finite with |S| > 1, then |S| ≥ 2,
so we would have |S| = |S × S| = |S| × |S| ≥ 2|S| > |S|. Since it is not possible that |S| > |S|, no such
bijection exists.
Question B2:
Suppose that f : S × S → S is any function. Define gn : S n → S recursively so that g1 (x) = x for every x,
g2 (x1 , x2 ) = f (x1 , x2 ), and gn+1 (x1 , x2 , . . . , xn+1 ) = f gn (x1 , x2 , x3 , . . . , xn ), xn+1 .
(c) Use induction to prove that if f is a bijection, then gn is a bijection for all n ≥ 2.
Suppose f is a bijection, and let P (k) be the statement gk is a bijection.
As a base case, we see that g2 is a bijection, since g2 = f , and f is a bijection. This means that P (2)
is true.
We now show that P (k) → P (k + 1). If P (k) is true for some k ≥ 2, then gk is a bijection. Two
consequences of this are that gk is an injection, and thus gk+1 is an injection by (a), and that gk is
a surjection, and thus gk+1 is a surjection by (b). Since gk+1 is an injection and a surjection, we
conclude that it is a bijection, and thus P (k + 1) is true.
We have shown that P (2) is true and that ∀k ≥ 2(P (k) → P (k + 1)). Therefore by mathematical
induction, we conclude that P (n) is true for all n ≥ 2.
Note: This is a slightly more abstract version of B4(c) from last assignment.
ℓ(0, 2, 1, 0) = f (g4 (0, 2, 1, 0), 3) = f (f (g3 (0, 2, 1), 0), 3) = f (f (f (g2 (0, 2), 1), 0), 3) = f (f (f (f (0, 2), 1), 0), 3)
Now f (0, 2) = 20 (2 · 2 + 1) − 1 = 4, so f (f (0, 2), 1) = f (4, 1) = 24 (2 · 1 + 1) − 1 = 47. The number we
47
are looking for is thus ℓ(0, 2, 1, 0) = f (f (47, 0), 3) = f (247 − 1, 3) = 7 · 22 −1 − 1 A really big number!
1 1 5 9 13 17 21 25 29 33 37 41
2 3 11 19 27 35 43 51 59 67 75 83
More generally, you can also compute f −1 (n) directly by looking at the binary expansion of n. Split
n into a prefix, consisting of all the digits before the final 0 and a suffix consisting of all the trailing
1s, separated by the final 0. The number of trailing 1s is m, while the prefix (before the final 0) is the
binary expansion of n. For example 167 = 101001112 . This has 3 trailing 1s in binary, and 10102 is
the binary expansion of 10, so f −1 (167) = (3, 10).
We first observe that 12 = (1100)2 , and so f (0, 6) = 12. We are thus looking for a 7-tuple
(n1 , n2 , n3 , . . . , n7 ) with g7 (n1 , n2 , . . . , n7 ) = 0, but (0, 0, 0, 0, 0, 0m0) has this property. It is easy to
show by induction that gk (0, 0, 0, . . . , 0) = 0 for all k. We conclude that ℓ−1 (12) = (0, 0, 0, 0, 0, 0, 0).
To compute ℓ−1 (17), we note that 17 = (10001)2 , and so f (1, 4) = 17 (in fact this was an en-
try in our table from assignment 3). We are thus looking for a 5-tuple (n1 , n2 , n3 , n4 , n5 ) with
g5 (n1 , n2 , n3 , n4 , n5 ) = 1. Now g5 (n1 , n2 , n3 , n4 , n5 ) = f (g4 (n1 , n2 , n3 , n4 ), n5 ), so we first find (u, v)
with f (u, v) = 1. Since (u, v) = (1, 0), we conclude that n5 = 0 and g4 (n1 , n2 , n3 , n4 ) = 1. Continuing
in the same manner, since g4 (n1 , n2 , n3 , n4 ) = f (g3 (n1 , n2 , n3 ), n4 ), we once again use the fact that
f (1, 0) = 1 to conclude that n4 = 0 and g3 (n1 , n2 , n3 ) = 1. Since g3 (n1 , n2 , n3 ) = f (f (n1 , n2 ), n3 )
we see n3 = 0 and f (n1 , n2 ) = 1, from which we conclude (n1 , n2 ) = (1, 0). We conclude that
ℓ−1 (17) = (1, 0, 0, 0, 0).
Question B5:
Recall that the Fibonacci sequence, f0 , f1 , f2 , . . . , is defined by
the initial conditions f0 = 0, f1 = 1, and the recurrence relation
fn = fn−1 + fn−2 for n = 2, 3, 4, . . . .
This means, in particular that f1 = 1, f2 = 1, f3 = 2, f4 = 3, f5 = 5,
etc. It is an interesting fact that squares with these edge lengths can
be arranged to form a rectangle, as on the right.
(a) The area of the rectangle must be the sum of the areas of these squares, so since a square with side
length a has area a2 , compute (f1 )2 + (f2 )2 + (f3 )2 + (f4 )2 + (f5 )2 to find the area of the rectangle.
We check that (f1 )2 + (f2 )2 + (f3 )2 + (f4 )2 + (f5 )2 = 12 + 12 + 22 + 32 + 52 = 1 + 1 + 4 + 9 + 25 = 40
k
X
(d) Let P (k) be the statement fi2 is equal to fk fk+1 .
i=1
P
Now consider k+1 2 = k 2 + f2 2
P
f
i=1 i f
i=1 i k+1 = fk fk+1 + fk+1 = fk+1 fk+2 By (c). Since this is
collectively the statement of P (k + 1) we conclude that P (k) → P (k + 1).
Question B6:
Suppose that P (n) is a predicate with the properties:
• ∀k ≥ 30 P (k) → P (k + 1) .
(a) Use proof by contradiction (and induction) to prove that P (105) is false
Assume (for contradiction) that P (105) is true. We can conclude, by induction that ∀n ≥ 105(P (n)).
Our hypotheses don’t exactly match the setup for mathematical induction, but, as discussed in class
we could directly apply induction to Q(k) = P (k + 104). This means, by universal instantiation,
that P (208) is true. Since we know P (208) is false, this is a contradiction.
We conclude that our assumption must be false, and thus that P (105) is false.
(b) Show that it is impossible to conclude whether P (27) is true or false from the given information.
(You will need to give two examples of predicates. One example will show that it is not possible to
conclude that P (27) is true. A different example will show that it is not possible to conclude that
P (27) is false. Both examples need to satisfy the properties in the question.)
The predicates Q(x) defined by “x ≥ 300” and R(x) defined by “(x ≥ 300) ∨ (x = 27)” satisfy,
Q(208) is false, ∀k ≥ 30 Q(k) → Q(k + 1) , R(208) is false, and ∀k ≥ 30 R(k) → R(k + 1) . This
shows that the given information applies equally well if P = Q or if P = R. Since Q(27) is false, it
is not possible to conclude that P (27) is true. Since R(27) is true, it is not possible to conclude that
P (27) is false.
Therefore it is is not possible to determine whether P (27) is true or false from the given information.