Discrete Mathematics Math 6A. Homework 9 Solution. 3.4-2 f(0) = 3 f(1)=-2f(0)=-2*3=-6 f(2)=-2f(1)=-2*-6=12 f(3)=-2f(2)=-2*12=-24 f(4)=-2f(3)=-2*-24=48 f(5)=-2f(4)=-2*48=-96 b) f(1)=3f(0)+7 = 3*3 + 7 = 16 f(2)=3f(1)+7 = 3*16 + 7 = 55 f(3)=3f(2)+7 = 3*55 + 7 = 172
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Discrete MathematicsMath 6A
Homework 9 Solution
3.4-13 Prove that f1+f3+...+f2n-1 = f2n whenever n is a pos. int.
We prove this by induction. The base case is n=1, and in that case the statement to be proved in just f1=f2; this is true since both values are 1.
Next we assume that inductive hypothesis, that f1+f3+...+f2n-1 = f2n ,
and try to prove the corresponding statement for n+1, namely,
f1+f3+...+f2n-1+f2n+1 = f2n+2.
We have f1+f3+...+f2n-1+f2n+1 = f2n + f2n+1 (by the inductive hypothesis)
= f2n+2 (by the def. of the Fibonacci numbers)
3.4-22 Show that the set S defined by 1S and s+tS whenever sS and tS is the set of pos. ints.
Clearly only pos. int. can be in S, since 1 is a pos. int. and the sum of two pos ints. is again a pos. int.
To see that all pos. ints. are in S, we proceed by induction. Obviously 1S. Assuming that nS, we get that n+1 is in S by applying the recursive part of the def. w/ s=n and t=1. Thus S is precisely the set of pos. ints.
3.4-23 Give a recursive def. of the set of pos. ints. that are multiples of 5.
We can define the set S={x|x is a pos. int. and x is a multiple of 5} by the base case requirement that 5S and the recursive requirement that if nS, then n+5S.
Alternatively we can mimic Example 7, making the recursive part of the definition that x+yS whenever x and y are in S.
6.1-24 the number of bit strings of length n that contain three consecutive 0's
a) Let an be the number of bit string of length n containing a pair of consecutive 0's
In order to construct a bit string of length n containing a pair of consecutive 0's, we could start with
1 and follow with a string of length n-1 containing three consecutive 0's, or
01 and follow with a string of length n-2 containing three consecutive 0's, or
001 and follow with a string of length n-3 containing three consecutive 0's
000 and follow with any string of length n-3 containing a pair of consecutive 0's
These four cases are mutually exclusive and exhaust the possibilities for how the string might start. From this analysis we can immediately write down the recurrence relation, valid for all n3: an=an-1+ an-2 + an-3 + 2n-3.
b) There are no bit strings of 0, 1 or 2 containing three consecutive 0's, so the initial conditions are a0 = a1 = a2 = 0
c) We will compute a3 through a7 using the recurrence relation:
a3 = a2 + a1 + a0+ 2^0 = 0 + 0+ 0+ 1 = 1
a4 = a3 + a2 + a1+ 2^1 = 1 + 0+ 0+ 2 = 3
a5 = a4 + a3 + a2+ 2^2 = 3 + 1+ 0+ 4 = 8
a6 = a5 + a4 + a3+ 2^3 = 8 + 3+ 1+ 8 = 20
a7 = a6 + a5 + a4+ 2^4 = 20 + 8+ 3+ 16 = 47
Thus there are 47 bit strings of length 7 containing three consecutive 0's