Documente Academic
Documente Profesional
Documente Cultură
Assignment 4
Due January 8, 2003
Late penalty: 5% for each school day.
1. §4.6 #10. A croissant shop has plain croissants, cherry croissants, chocolate croissants, almond crois-
sants, apple croissants and broccoli croissants. How many ways are there to choose
2. §4.6 #12. (3 points) How many different combinations of pennies, nickels, dimes, quarters, and half
dollars can a piggy ban contain if it has 20 coins in it?
Solution: The number of ways to select 20 coins from five kinds is C(20+5−1, 20) = C(24, 20) = 10 626.
¤
x1 + x2 + x3 + x4 + x5 + x6 = 29
Solution:
1
(a) Since xi ≥ 2, we let yi = xi − 2, yi ≥ 0.
x1 + x2 + x3 + x4 + x5 + x6 = 29
(y1 + 2) + (y2 + 2) + (y3 + 2) + (y4 + 2) + (y5 + 2) + (y6 + 2) = 29
y1 + y2 + y3 + y4 + y5 + y6 = 17
x1 + x2 + x3 + x4 + x5 + x6 = 29
(y1 + 1) + (y2 + 2) + (y3 + 3) + (y4 + 4) + (y5 + 5) + (y6 + 6) = 29
y1 + y2 + y3 + y4 + y5 + y6 = 8
4. §4.6 #22. (4 points) How many positive integers less than 1,000,000 have exactly one digit equal to 9
and have a sum of digits equal to 13?
Solution: Let the digits be x1 x2 x3 x4 x5 x6 . Suppose that x1 = 9, then x2 + x3 + x4 + x5 + x6 = 4. There
are C (4 + 5 − 1, 4) = C (8, 4) = 70 solutions to that equation. So there are 70 such numbers with the
first digit being 9. It is the same for the other digits. Therefore the answer is 6 × 70 = 420. ¤
5. §4.6 #28. (3 points) How many different strings can be made from the letters in AARDV ARK, using
all the letters, if all three As must be consecutive?
Solution: Since there are two Rs, one D, one V , one K and three As in one block (therefore the As
will be counted as one object), there are
6!
= 360
2!1!1!1!1!
such strings. ¤
6. §4.6 #38. (3 points) In bridge, the 52 cards of a standard deck are dealt to four players. How many
different ways are there to deal bridge hands to four players.
Solution: Notice that the players are distinct. (In bridge, they are called East, South, West and North.)
There are C (52, 13) ways to choose a hand for East, then C (39, 13) ways to choose a hand for South,
C (26, 13) ways to choose a hand for West and C (13, 13) ways to choose a hand for North. The number
of ways to deal the four hands is
52! 39! 26! 13! 52!
· · · = = 53 644 737 765 488 792 839 237 440 000
13!39! 13!26! 13!13! 13!0! 13! · 13! · 13! · 13!
7. §4.6 #40. In how many ways can a dozen books be placed on four distinguishable shelves
(a) (2 points) if the books are indistinguishable copies of the same title?
Solution: We can use 12 dots to represent the books and 3 bars to separate them into four groups
(to be placed on the four shelves). There are C (12 + 3, 3) = C (15, 3) = 455 such arrangements.
2
(b) (4 points) if no two books are the same, and the positions of the books on the shelves matter?
(Hint: Break this into 12 tasks, placing each book separately. Start with the sequence 1,2,3,4 to
represent the shelves. Represent the books by bi , i = 1, 2, ..., 12. Place b1 to the right of one of
the terms in 1, 2, 3, 4. Then successively place b2 , b3 , ..., and b12 .)
Solution: There are 4 ways to place b1 , 5 ways to place b2 , ..., 15 ways to place b12 . The answer is
8. §5.1 #10. An employee joined a company in 1987 with a starting salary of $50,000. Every year this
employee receives a raise of $1000 plus 5% of the salary of the previous year.
(a) (2 points) Set up a recurrence relation for the salary of this employee n years after 1987.
(b) (2 points) What is the salary of this employee in 1995?
(c) (4 points) Find an explicit formula for the salary of this employee n years after 1987.
Solution:
(a) an = an−1 + 0.05an−1 + 1000 = 1.05an−1 + 1000 for all n ≥ 1 and a0 = 50, 000
(b) The salary of this employee in 1995 is
a8 = 1.05a7 + 1000
= 1.05 (1.05a6 + 1000) + 1000 = 1. 102 5a6 + 2050
= 1. 102 5 (1.05a5 + 1000) + 2050 = 1. 157 6a5 + 3152. 5
= 1. 157 6 (1.05a4 + 1000) + 3152. 5 = 1. 215 5a4 + 4310. 1
= 1. 215 5 (1.05a3 + 1000) + 4310. 1 = 1. 276 3a3 + 5525. 6
= 1. 276 3 (1.05a2 + 1000) + 5525. 6 = 1. 340 1a2 + 6801. 9
= 1. 340 1 (1.05a1 + 1000) + 6801. 9 = 1. 407 1a1 + 8142.0
= 1. 407 1 (1.05a0 + 1000) + 8142.0 = 1. 407 1 (1.05 × 50000 + 1000) + 8142.0
= 83422.
(c) This is a nonhomogeneous recurrence relation. For the homogeneous recurrence relation
an = 1.05an−1
(h) (p)
the general solution is an = k1 (1.05)n . Since F (n) = 1000, we guess an = q0 . We have
q0 = 1.05q0 + 1000.
Therefore q0 = −20000. The general solution for the nonhomogeneous recurrence relation is
n
an = a(h) (p)
n + an = k1 (1.05) − 20000.
When n = 0, this is
a0 = k1 − 20000 = 50000.
So k1 = 70000. The formula is
n
an = 70000 (1.05) − 20000.
9. §5.1 #22.
3
(a) (3 points) Find a recurrence relation for the number of ways to climb n stairs if the person climbing
the stairs can take one, two, or three stairs at a time.
Solution: Since the last step one can take one, two or three stairs, an = an−1 + an−2 + an−3 .
(b) (1 point) What are the initial conditions?
Solution: a0 = a1 = 1, a2 = 2. Or, a1 = 1, a2 = 2 and a3 = 4.
(c) (1 point) How many ways can this person climb a flight of eight stairs?
Solution:
a3 = a0 + a1 + a2 =1+1+2=4
a4 = a1 + a2 + a3 =1+2+4=7
a5 = a2 + a3 + a4 = 2 + 4 + 7 = 13
a6 = a3 + a4 + a5 = 4 + 7 + 13 = 24
a7 = a4 + a5 + a6 = 7 + 13 + 24 = 44
a8 = a5 + a6 + a4 = 13 + 24 + 44 = 81
10. §5.1 #38. (6 points) Show that the Fibonacci numbers satisfy the recurrence relation fn = 5fn−4 +
3fn−5 for n = 5, 6, 7, ..., together with the initial conditions f0 = 0, f1 = 1, f2 = 1, f3 = 2, and f4 = 3.
Use this recurrence relation to show that f5n is divisible by 5, for n = 1, 2, 3, ...
Solution: The original definition of the Fibonacci numbers gives fn = fn−1 + fn−2 for all n ≥ 2 and
f0 = 0, f1 = 1. It is straightforward to verify that f2 = 1, f3 = 2, and f4 = 3. Since fn−3 = fn−4 +fn−5 ,
fn−2 = fn−3 + fn−4 , fn−1 = fn−2 + fn−3 , we have
11. §5.2 #4 (3 points each part) Solve the following recurrence relations toghether with the initial conditions
given.
(a) an = an−1 + 6an−2 for n ≥ 2, a0 = 3, a1 = 6.
x2 − x − 6 = 0
(x + 2) (x − 3) = 0
k1 + k2 = 3, −2k1 + 3k2 = 6
¤
3 12 3 n 12 n
we have k1 = 5 and k2 = 5 . So an = 5 (−2) + 5 3 .
x2 − 6x + 8 = 0
(x − 2) (x − 4) = 0
4
The general solution is an = k1 2n + k2 4n . Solving
k1 + k2 = 4, 2k1 + 4k2 = 10
we have k1 = 3 and k2 = 1. So an = 3 · 2n + 4n . ¤
r2 + 6r + 9 = (r + 3)2 .
The root is r = −3 with multiplicity two. The general solution is
n
an = (k1 + k2 n) · (−3)
With the initial conditions, we have
k1 = 3
(k1 + k2 ) (−3) = −3.
n
Solving this system of equations, we have k1 = 3 and k2 = −2. Therefore, an = (3 − 2n) (−3) .¤
12. §5.2 #8. A model for the number of lobsters caught per year is based on the assumption that the
number of lobsters caught in a year is the average of the number caught in the two previous years.
(a) (2 points) Find a recurrence relation for {Ln } , where Ln is the number of lobsters caught in year
n, under the assumption for this model.
Solution:
1 1
Ln = Ln−1 + Ln−2 .
2 2
(b) (3 points) Find Ln if 100, 000 lobsters were caught in year 1 and 300, 000 were caught in year 2.
Solution: The characteristic equation is
1 1
r2 − r − = 0
2 2
1
(2r + 1) (r − 1) = 0
2
¡ ¢n
The roots are r = − 12 , and r = 1. The general solution is an = k1 − 12 + k2 . Considering the
initial conditions, we have
µ ¶
1
− k1 + k2 = 100000
2
1
k1 + k2 = 300000.
4
¡ 1 ¢n 700000
Solving this system of equations, we have k1 = 800000
3 , k2 = 700000
3 and an = 800000
3 −2 + 3 .
¤
5
13. §5.2 #12. (4 points) Find the solution to an = 2an−1 + an−2 − 2an−3 for n = 3, 4, 5, ..., with a0 = 3,
a1 = 6 and a2 = 0.
Solution: The characteristic equation is
r3 − 2r2 − r + 2 = 0
(r − 1) (r − 2) (r + 1) = 0
an = k1 + k2 2n + k3 (−1)n .
k1 + k2 + k3 = 3
k1 + 2k2 − k3 = 6
k1 + 4k2 + k3 = 0
r3 − 6r2 + 12r − 8 = 0
3
(r − 2) = 0
¡ ¢
The root is r = 2 with multiplicity 3. an = k1 + k2 n + k3 n2 2n . Substitute in the initial conditions,
we have
k1 = −5
2k1 + 2k2 + 2k3 = 4
4k1 + 8k2 + 16k3 = 88
© ª ¡ ¢
The solution is: k1 = −5, k2 = 12 , k3 = 13
2 . Therefore an = −5 + 12 n + 13 2
2 n 2n . ¤
15. §5.2 #26. What is the general form of the particular solution of the linear nonhomogeneous recurrence
relation an = 6an−1 − 12an−2 + 8an−3 + F (n) if
r3 − 6r2 + 12r − 8 = 0
(r − 2)3 = 0
The only root is r = 2 with multiplicity three. Since 1 is not a root, the particular solution has
the form
a(p) 2
n = p2 n + p1 n + p0
6
(d) (1 point) F (n) = (−2)n ?
Solution:
n
a(p)
n = p0 (−2) .
Solution:
r2 + 5r + 6 = 0
(r + 3) (r + 2) = 0
q0 · 4n = −5 · q0 · 4n−1 − 6 · q0 · 4n−2 + 42 · 4n
16 · q0 = −5 · q0 · 4 − 6 · q0 + 42 · 16
42 · q0 = 42 · 16
q0 = 16
a(p)
n = 16 · 4n
an = k1 · (−2)n + k2 · (−3)n + 16 · 4n .
−2 · k1 − 3 · k2 + 64 = 56
4 · k1 + 9 · k2 + 256 = 278
an = (−2)n + 2 · (−3)n + 16 · 4n .
7
17. §5.2 #34. (6 points) Find all solutions of the recurrence relation an = 7an−1 − 16an−2 + 12an−3 + n4n
with a0 = −2, a1 = 0, and a2 = 5.
Solution: The characteristic equation for the homogeneous recurrence relation is
r3 − 7r2 + 16r − 12 = 0
2
(r − 3) (r − 2) = 0
a(h) n
n = k1 3 + (k2 + k3 n) 2
n
a(p)
n = (p1 n + p0 ) 4
n
Comparing the coefficients of n and the constant terms of both sides, we have
64p1 = 60p1 + 64
64p0 = 60p0 − 20p1 .
a(p)
n = (16n − 80) 4n
an = k1 3n + (k2 + k3 n) 2n + (16n − 80) 4n
By letting n = 0, 1, 2, we have
k1 + k2 − 80 = −2
3k1 + 2k2 + 2k3 − 256 = 0
9k1 + 4k2 + 8k3 − 768 = 5
39
and k1 = 61, k2 = 17, k3 = 2 . Therefore
µ ¶
39
an = 61 · 3n + 17 + n 2n + (16n − 80) 4n
2