21.07.2013 Views

Math 375 Final Exam Solutions Spring 2010 Name ... - MavDISK

Math 375 Final Exam Solutions Spring 2010 Name ... - MavDISK

Math 375 Final Exam Solutions Spring 2010 Name ... - MavDISK

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Math</strong> <strong>375</strong> <strong>Final</strong> <strong>Exam</strong> <strong>Solutions</strong> <strong>Spring</strong> <strong>2010</strong> <strong>Name</strong>:<br />

Show all work<br />

1. Let an be the number of ternary strings (characters 0, 1, 2) with no<br />

repeated 0s. Find a recurrence relation for the sequence a1, a2, a3, . . . , and<br />

use it to calculate a1 through a8. There is no need to find a formula for an.<br />

<strong>Solutions</strong>: Strings of length n can begin with 0, 1, or 2. If a string begins<br />

with 0, there are two choices for the next character (1 or 2), and the remaining<br />

n−2 positions must not contain repeated 0s. There are 2an−2 of these strings.<br />

If a string begins with 1 or with 2, the remaining n − 1 positions must not<br />

contain repeated 0s. There are 2an−1 of these strings. So the recurrence<br />

relation is<br />

⎧<br />

⎪⎨ 2an−2 + 2an−1 n ≥ 3<br />

an = 3<br />

⎪⎩<br />

8<br />

n = 1<br />

n = 2.<br />

Therefore the first eight terms of the sequence are<br />

3, 8, 22, 60, 164, 448, 1224, 3344 . . .<br />

1


2. Let an be the number of binary strings with an even number of 0s and no<br />

repeated 1s. Let bn be the number of binary strings with an odd number of 0s<br />

and no repeated 1s. Find a system of recurrence relations for the sequences<br />

a1, a2, a3, . . . and b1, b2, b3, . . . and use the system to calculate a1 through a8<br />

and b1 through b8. There is no need to find a formula for an or bn.<br />

Solution: Strings of length n with an even number of 0s and no repeated<br />

1s must start with 0 or 1. If it starts with 0, it must be followed by an odd<br />

number of 0s and no repeated 1s. Contribution: bn−1. If it starts with 1, it<br />

must be followed by 0 and then an odd number of 0s and no repeated 1s.<br />

Contribution: bn−2. Strings of length n with an odd number of 0s and no<br />

repeated 1s must start with 0 or 1. If it starts with 0, it must be followed<br />

by an even number of 0s and no repeated 1s. Contribution: an−1. If it starts<br />

with 1, it must be followed by 0 and then an even number of 0s and no<br />

repeated 1s. Contribution: an−2. So the system of recurrence relations is<br />

⎧<br />

⎪⎨ bn−1 + bn−2 n ≥ 3<br />

an = 1 n = 1<br />

⎪⎩<br />

1 n = 2<br />

⎧<br />

⎪⎨ an−1 + an−2 n ≥ 3<br />

bn = 1<br />

⎪⎩<br />

2<br />

n = 1 .<br />

n = 2<br />

The first eight terms of the a sequence are<br />

1, 1, 3, 4, 6, 11, 17, 27<br />

and the first eight terms of the b sequence are<br />

1, 2, 2, 4, 7, 10, 17, 28.<br />

2


3. (a) Find a generating function for the recurrence relation an = 2an−1 +5 n ,<br />

a0 = 7.<br />

(b) Extract the coefficient of x 100 in your generating function to compute<br />

a100. Use partial fraction decomposition.<br />

Solution:<br />

g(x) =<br />

g(x) = a0 + a1x + a2x 2 + · · · =<br />

7 + (2a0 + 5)x + (2a1 + 5 2 )x 2 + · · · =<br />

7 + 2xg(x) + 5x<br />

1 − 5x =<br />

2xg(x) +<br />

7 − 30x<br />

(1 − 2x)(1 − 5x)<br />

7 − 30x<br />

1 − 5x ,<br />

= 16<br />

3<br />

1 5 1<br />

+<br />

1 − 2x 3 1 − 5x ,<br />

a100 = [x 100 ] = 16<br />

3 2100 + 5<br />

3 5100 .<br />

3


4. (a) Using the method of roots, find a formula for an given the recurrence<br />

relation an = 2an−1 + n2 n , a0 = 2.<br />

(b) Check your work by computing a1 through a3 in two ways: first using<br />

the recurrence relation, second using your formula for an.<br />

Solution: Rewriting the recurrence relation as<br />

an − 2an−1 = n2 n ,<br />

the homogeneous part contributes a root of 2 and the non-homogeneous part<br />

contributes two roots of 2. So we must have<br />

The sequence begins<br />

an = α · 2 n + β · n · 2 n + γ · n 2 · 2 n .<br />

a0 = 2, a1 = 2a0+1·2 1 = 6, a2 = 2a1+2·2 2 = 20, a3 = 2a2+3·2 3 = 64, · · · .<br />

This yields the system of equations<br />

hence<br />

2 = α, 6 = 2α + 2β + 2γ, 20 = 4α + 8β + 16γ<br />

α = 2, β = 1 1<br />

, γ =<br />

2 2 ,<br />

an = (2 + 1 1<br />

n +<br />

2 2 n2 )2 n .<br />

Check: using n = 3, (2 + 3 9 + 2 2 )23 = 64. <br />

4


5. Using the Principle of Inclusion-Exclusion, find the number of permutations<br />

of the numbers 1 through 9 in which 2 cannot immediately follow<br />

1, 3 cannot immediately follow 2, and 4 cannot immediately follow 3. For<br />

example, 129876543 is bad, 129876534 is bad, and 987123456 is bad, but<br />

987654321 is good.<br />

Solution: There are 3 simultaneous conditions here: no 12 and no 23 and no<br />

34. There are 9! permutations in all. The bad ones are in A1 ∪A2 ∪A3, where<br />

A1 contains permutations with 12, A2 contains permutations with 23, and<br />

A3 contains permutations with 34. The total number of bad permutations is<br />

n1 − n2 + n3. We have<br />

n1 = |A1| + |A2| + |A3| = 8! + 8! + 8!<br />

n2 = |A1 ∩ A2| + |A1 ∩ A3| + |A2 ∩ A3| = 7! + 7! + 7!<br />

n3 = |A1 ∩ A2 ∩ A3| = 6!<br />

Hence the number of good permutations is<br />

9! − 3 · 8! + 3 · 7! − 6! = 256320.<br />

5


Extra Credit Problem 6: Simplify 100<br />

k=0<br />

Solution:<br />

100 k 100−k k3 7 .<br />

k<br />

(x + y) 100 100<br />

<br />

100<br />

= x<br />

k<br />

k y 100−k<br />

k=0<br />

(x + 7) 100 100<br />

<br />

100<br />

= x<br />

k<br />

k 7 100−k<br />

k=0<br />

100(x + 7) 99 100<br />

<br />

100<br />

= kx<br />

k<br />

k−1 7 100−k<br />

k=0<br />

100x(x + 7) 99 100<br />

<br />

100<br />

= kx<br />

k<br />

k 7 100−k<br />

k=0<br />

300 · 10 99 100<br />

<br />

100<br />

= k3<br />

k<br />

k 7 100−k .<br />

k=0<br />

6


Extra Credit Problem 7: Using a generating function, find the number of<br />

solutions to e1 + e2 + e3 + e4 + e5 = 100, 1 ≤ ei ≤ 25.<br />

Solution: The answer is the coefficient of x 100 in<br />

(x + x 2 + · · · + x 25 ) 5 = x 5 (1 + x + · · · + x 24 ) 5 = x 5 (1 − x 25 ) 5 1<br />

=<br />

(1 − x) 5<br />

x 5 (1 − 5x 25 + 10x 50 − 10x 75 + 5x 100 − x 125 )<br />

∞<br />

<br />

n + 4<br />

x<br />

4<br />

n .<br />

The contributions to x100 come from n = 95, 70, 45, 20. Hence the number of<br />

solutions is <br />

99 74 49 24<br />

− 5 + 10 − 10 .<br />

4 4 4 4<br />

7<br />

n=0


Extra Credit Problem 8: Using a generating function, find the number of<br />

ways to place 50 people into 5 distinct buses in such a way that there are an<br />

even number of people in the first, third, and fifth buses.<br />

Solution: The number of ways to place ei people in bus i, 1 ≤ i ≤ 5, is equal<br />

to the number of rearrangements e1 1s, e2 2s, e3 3s, e4 4s, and e5 5s, namely<br />

50! . Therefore the total number of ways to load the bus, summing<br />

e1!e2!e3!e4!e5!<br />

over all the cases, is<br />

<br />

50!<br />

e1!e2!e3!e4!e5!<br />

e1, e3, e5 ∈ {0, 2, 4 . . . }<br />

e2, e4 ∈ {0, 1, 2, . . . }<br />

e1 + e2 + e3 + e4 + e5 = 50<br />

.<br />

This equal to the coefficient of x 50 in<br />

x −x e + e<br />

50!<br />

2<br />

which is equal to<br />

3<br />

(e x ) 2 = 50!<br />

8 (e3x − 3e x + 3e −x − e −3x )e 2x =<br />

50!<br />

8 (e5x − 3e 3x + 3e x − e −x ),<br />

550 − 3 · 350 + 2<br />

.<br />

8<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!