quiz4solutions

quiz4solutions - Quiz 4 Solutions Dilip Raghavan November...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Quiz 4 Solutions Dilip Raghavan November 11, 2008 Problem 1. (a) If the first slot is not a 0, then we have 3 possibilities for the first slot and an-1 . If the first slot is 0, then we nust have an odd number of 0 in what follows. The total number of sequences of length n - 1 is 4n-1 , and of these an-1 have an even number of 0s. So there are 4n-1 - an-1 possibilities for this case. So an = 3an-1 + 4n-1 - an-1 = 2an-1 + 4n-1 . (b) The homogeneous solution is A2n . Look for a particular solution of the form p(n) = B4n . Substituting, 1 we get the equation B4n = 2B4n-1 + 4n-1 , which simplifies to 4B = 2B + 1 Hence, B = 2 . So an = A2n + 1 4n . Using the initial condition a1 = 3, we get A = 1 . 2 2 Problem 2. Let an be the number of such subsets. We find a recurrence relation for an . If a subset does not contain n, then it is subset of {1, 2, . . . , n - 1} with no consecutive integers. There are an-1 such subsets. If the subset does contain n, then it cannot contain n - 1, and the remainder of the subset must be a subset of {1, 2, . . . , n - 2} with no consecutive integers. There are an-2 such subsets. So an = an-1 + an-2 , which is the Fibonacci relation. The general solution is an = A 1+2 5 + B 1-2 different a1 = 2 and a2 = 3. Using these, we can find A and B. n n 5 . But the initial conditions are slightly 1 ...
View Full Document

This note was uploaded on 09/15/2011 for the course AMAT 344 taught by Professor Raghaven during the Spring '11 term at SUNY Albany.

Ask a homework question - tutors are online