Docsity

General Solution - Discrete Mathematics - Exam Key, Exams of Discrete Mathematics

Toggle sidebar
bg1
MACM 201 Test 2 Solutions
(1) (10) Consider the following recurrence relation;
an+6anโˆ’1+14anโˆ’2+16anโˆ’3+8anโˆ’4= 0, a0=โˆ’1, a1= 1, a2= 2, a3= 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
r4+ 6r3+ 14r2+ 16r+ 8 = (r+ 2)2(r2+ 2r+ 2)
The roots are โˆ’2,โˆ’1 + i, โˆ’1โˆ’i. We write โˆ’1 + i=โˆš2(cos 3ฯ€
4+isin 3ฯ€
4). So
the general solution is
an=A(โˆ’2)n+Bn(โˆ’2)n+C(โˆš2)ncos 3nฯ€
4+D(โˆš2)nsin 3nฯ€
4
Using the initial conditions;
n= 0 : A+C=โˆ’1
n= 1 : โˆ’2Aโˆ’2Bโˆ’C+D= 1
n= 2 : 4A+ 8Bโˆ’2D= 2
n= 3 : โˆ’8Aโˆ’24B+ 2C+ 2D= 3
(2) (10) Consider the following recurrence relation;
anโˆ’2anโˆ’1โˆ’3anโˆ’2= 2(3n), a0= 2, a1= 3
(a) Use the recurrence relation to determine a2and a3.
Solution:
a2= 2a1+ 3a0+ 2(32) = 2(3) + 3(2) + 18 = 30
a3= 2a2+ 3a1+ 2(33) = 2(30) + 3(3) + 54 = 123
(b) Solve the recurrence relation.
Solution: The characteristic equation for the homogeneous relation is
r2โˆ’2rโˆ’3 = (rโˆ’3)(r+ 1), so
a(h)
n=A(3n) + B(โˆ’1)n
The particular solution has the form
a(p)
n=Dn(3n)
1
pf3

Partial preview of the text

Download General Solution - Discrete Mathematics - Exam Key and more Exams Discrete Mathematics in PDF only on Docsity!

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

+ D(

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 +

โ†’ 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 }