

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


MACM 201 Test 2 Solutions
(1) (10) Consider the following recurrence relation;
an + 6anโ 1 + 14anโ 2 + 16anโ 3 + 8anโ 4 = 0, a 0 = โ 1 , a 1 = 1, a 2 = 2, a 3 = 3
Write down the general solution and the equations that will determine the unknown coefficients, but do not solve for the coefficients.
Solution: The characteristic polynomial is
r^4 + 6r^3 + 14r^2 + 16r + 8 = (r + 2)^2 (r^2 + 2r + 2)
The roots are โ 2 , โ1 + i, โ 1 โ i. We write โ1 + i =
2(cos 34 ฯ + i sin 34 ฯ ). So the general solution is
an = A(โ2)n^ + Bn(โ2)n^ + C(
2)n^ cos
3 nฯ 4
2)n^ sin
3 nฯ 4 Using the initial conditions;
n = 0 : A + C = โ 1 n = 1 : โ 2 A โ 2 B โ C + D = 1 n = 2 : 4 A + 8B โ 2 D = 2 n = 3 : โ 8 A โ 24 B + 2C + 2D = 3
(2) (10) Consider the following recurrence relation;
an โ 2 anโ 1 โ 3 anโ 2 = 2(3n), a 0 = 2, a 1 = 3
(a) Use the recurrence relation to determine a 2 and a 3.
Solution:
a 2 = 2 a 1 + 3a 0 + 2(3^2 ) = 2(3) + 3(2) + 18 = 30 a 3 = 2 a 2 + 3a 1 + 2(3^3 ) = 2(30) + 3(3) + 54 = 123
(b) Solve the recurrence relation.
Solution: The characteristic equation for the homogeneous relation is r^2 โ 2 r โ 3 = (r โ 3)(r + 1), so
a( nh ) = A(3n) + B(โ1)n
The particular solution has the form
a( np ) = Dn(3n)
We determine D by substituting a( np )into the recurrence relation;
Dn 3 n^ โ 2 D(n โ 1)3nโ^1 โ 3 D(n โ 2)3nโ^2 = 2(3n)
โ D =
So the general solution is
an = A(3n) + B(โ1)n^ +
n(3n)
Now we determine A, B from the initial data;
a 0 = 2 = A + B a 1 = 3 = 3 A โ B +
Thus,
an =
(3n) +
(โ1)n^ +
n(3n)
(c) Calculate a 2 and a 3 using your answer from (b).
Solution:
a 2 =
a 3 =
(3) (10) For n โฅ 1 let an count the number of binary strings of length n, where there is no run of 1
โฒs of odd length. For example, when n = 6 we want to include the strings 110000 (which has a run of two 1 โฒs and a run of four 0 โฒs ) and 011110 (which has two runs of one 0 and one run of four 1 โฒs ), but we no not include either 100011 (which starts with a run of one 1) or 110111 (which ends with a run of three 1 โฒs ).
(a) Determine a 1 , a 2 , a 3 , a 4.
Solution:
a 1 = 1 { 0 } a 2 = 2 { 00 , 11 } a 3 = 3 { 000 , 011 , 110 } a 4 = 5 { 0000 , 0011 , 0110 , 1100 , 1111 }