Chapter 07
Chapter 07
In the questions below, describe each sequence recursively. Include initial conditions and
assume that the sequences begin with a1.
1. an 5n.
Ans: an 5an 1a1 5.
3. 010101….
Ans: an an 2, a1 0, a2 1.
4. an 1 2 3 n.
Ans: an an 1 n, a1 1.
5. 321012….
Ans: an an 1 1, a1 3.
6. an n.
Ans: an nan 1, a1 1.
7. 12131415….
Ans: , a1 12.
9. 12223342….
Ans: an an 1 2n 1, a1 1.
10. 1111111111111111….
Ans: an 100an 1 11.
12. 1101101011010101….
Ans: an 100an 1 1, a1 1.
Page 88
13. an the number of bit strings of length n with an even number of 0s.
Ans: an an 1 2n 2, a1 1.
15. an the number of bit strings of length n that contain a pair of consecutive 0s.
Ans: an an 1 an 2 2n 2, a1 0, a2 1.
16. an the number of ways to go down an n-step staircase if you go down 1, 2, or 3 steps at
a time.
Ans: an an 1 an 2 an 3, a1 0, a2 1, a3 1.
In the questions below find a recurrence relation with initial condition(s) satisfied by the
sequence. Assume a0 is the first term of the sequence.
22. an 2n.
Ans: an 2an 1, a0 1.
23. an 2n 1.
Ans: an 2an 1 1, a0 2.
24. an (1)n.
Ans: an an 1, a0 1.
25. an 3n 1.
Ans: an an 1 3, a0 1.
Page 89
26. .
Ans: an an 1, .
28. Suppose inflation continues at three percent annually. (That is, an item that costs $1.00
now will cost $1.03 next year.) Let an the value (that is, the purchasing power) of one
dollar after n years.
(a) Find a recurrence relation for an.
(b) What is the value of $1.00 after 20 years?
(c) What is the value of $1.00 after 80 years?
(d) If inflation were to continue at ten percent annually, find the value of $1.00 after 20
years.
(e) If inflation were to continue at ten percent annually, find the value of $1.00 after 80
years.
Ans: (a) an an 1103. (b) a20 110320 055. (c) a80 110380 009. (d) 11120
015. (e) 11180 000.
In the questions below determine whether the recurrence relation is a linear homogeneous
recurrence relation with constant coefficients.
30. an nan 1.
Ans: No.
31. .
Ans: No.
32. an an 3.
Ans: Yes.
Page 90
33. an 7an 2 an 5 0.
Ans: Yes.
34. an an 1 1.
Ans: No.
35. A vending machine dispensing books of stamps accepts only $1 coins, $1 bills, and $2
bills. Let an denote the number of ways of depositing n dollars in the vending machine,
where the order in which the coins and bills are deposited matters.
(a) Find a recurrence relation for an and give the necessary initial condition(s).
(b) Find an explicit formula for an by solving the recurrence relation in part (a).
Ans: (a) an 2an 1 an 2, a0 1, a1 2. (b) where
and .
In the questions below solve the recurrence relation either by using the characteristic equation
or by discovering a pattern formed by the terms.
40. an an 2, a0 2, a1 1.
Ans: an (12) 1n (32) (1)n.
42. an 3nan 1, a0 2.
Ans: an 2 3n n.
Page 91
43. an an 1 3n, a0 5.
Ans: .
44. an 2an 1 5, a0 3.
Ans: an 3 2n 5(2n 1) 2n 3 5.
45. an an 1 2n 1, a0 5.
Ans: an 5 n(n 1) n n2 2n 5.
46. The solutions to an 3an 1 18an 2 have the form an c 3n d (6)n. Which of the
following are solutions to the given recurrence relation?
(a) an 3n 1 (6)n.
(b) an 5(6)n.
(c) an 3c 6d.
(d) an 3n 2.
(e) an (3n (6)n).
(f) an 3n.
(g) an 3n(1 (2)n).
(h) an 3n 6n.
Ans: (a) Yes. (b) Yes. (c) No. (d) Yes. (e) Yes. (f) Yes. (g) Yes. (h) No.
47. Assume that the characteristic equation for a homogeneous linear recurrence relation with
constant coefficients is (r 5)3 0. Describe the form for the general solution to the
recurrence relation.
Ans: an c5n dn5n en25n.
48. Assume that the characteristic equation for a homogeneous linear recurrence relation with
constant coefficients is (r 2)(r 4)2 0. Describe the form for the general solution to
the recurrence relation.
Ans: an c(2)n d(4)n en(4)n.
49. Assume that the characteristic equation for a homogeneous linear recurrence relation with
constant coefficients is (r 1)4(r 1)4 0. Describe the form for the general solution to
the recurrence relation.
Ans: an c(1)n dn(1)n en2(1)n fn3(1)n g hn in2 jn3.
50. Assume that the characteristic equation for a homogeneous linear recurrence relation with
constant coefficients is (r 3)2(r 4)3(r 7)2 0. Describe the form for the general
solution to the recurrence relation.
Ans: an c3n dn3n en23n f4n gn4n hn24n i(7)n jn(7)n.
Page 92
51. The Catalan numbers Cn also count the number of strings of n 's and n 's with the
following property: as each string is read from left to right, the number of 's encountered
is always at least as large as the number of 's.
(a) Verify this by listing these strings of lengths 2, 4, and 6 and showing that there are
C1, C2, and C3 of these, respectively.
(b) Explain how counting these strings is the same as counting the number of ways to
correctly parenthesize strings of variables.
Ans: (a) C1: , C2: , C3: , , ,
, . (b) Treat each as a left parenthesis and each as a right
parenthesis.
52. What form does a particular solution of the linear nonhomogeneous recurrence relation an
4an 1 4an 2 F(n) have when F(n) 2n?
Ans: p0n22n.
53. What form does a particular solution of the linear nonhomogeneous recurrence relation an
4an 1 4an 2 F(n) have when F(n) n2n?
Ans: n2(p1n p0)2n.
54. What form does a particular solution of the linear nonhomogeneous recurrence relation an
4an 1 4an 2 F(n) have when F(n) n2 4n?
Ans: (p2n2 p1n p0)4n.
55. What form does a particular solution of the linear nonhomogeneous recurrence relation an
4an 1 4an 2 F(n) have when F(n) (n2 1)2n?
Ans: .
Page 93
57. Consider the recurrence relation an an 1 n.
(a) Write the associated homogeneous recurrence relation.
(b) Find the general solution to the associated homogeneous recurrence relation.
(c) Find a particular solution to the given recurrence relation.
(d) Write the general solution to the given recurrence relation.
(e) Find the particular solution to the given recurrence relation when a0 1.
Ans: (a) an an 1. (b) an c(1)n. (c) . (d) . (e)
.
Page 94
66. Use generating functions to solve an 5an 1 1, a0 1.
Ans: .
In the questions below write the first seven terms of the sequence determined by the generating
function.
67. (x 3)2.
Ans: (a) 9610000.
68. (1 x)5.
Ans: 151010510.
69. (1 x)9.
Ans: 19368412612684.
70. .
Ans: 1392781243729.
71. .
Ans: 0011111.
72. .
Ans: 1222222.
73. 5.
Ans: 5000000.
74. ex ex.
Ans: .
75. cosx.
Ans: .
76. .
Ans: 1100111.
Page 95
Use the following to answer questions 77-87:
In the questions below find the coefficient of x8 in the power series of each of the function.
77. .
Ans: 6.
78. .
Ans: 12.
79. .
Ans: 15.
80. .
Ans: 15.
81. (1 x3)12.
Ans: 0.
82. .
Ans: 3.
83. .
Ans: 28.
84. .
Ans: 35.
85. .
Ans: 9.
86. .
Ans: 7 26.
87. .
Ans: 34.
Page 96
Use the following to answer questions 88-100:
In the questions below find a closed form for the generating function for the sequence.
88. 48163264….
Ans: .
89. 10101010….
Ans: .
90. 2002002002….
Ans: .
91. 24681012….
Ans: .
92. 0001111000000000….
Ans: .
93. 234567….
Ans: .
94. 01101101101101….
Ans: .
95. .
x
Ans: e .
96. .
Ans: .
97. 11111111….
Ans: .
Page 97
98. 10101010101….
Ans: .
99. .
Ans: .
100. .
Ans: 50(1 x)49.
101. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes if each envelope has at least two
coins in it.
Ans: (x2 x3 x4 )3, 21.
102. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes if each envelope has most six coins
in it.
Ans: (1 x x2 x6)3, 33.
103. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes if no envelope is empty.
Ans: (x x2 x3 )3, 45.
104. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes if each envelope has an even number
of coins in it.
Ans: (1 x2 x4 x6 )3, 0.
105. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes if each envelope has at least two but
no more than five coins in it.
Ans: (x2 x3 x4 x5)3, 12.
106. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes (labeled A, B, C) if envelope A has
at least three coins in it.
Ans: (x3 x4 x5 x6 )(1 x x2 x3 )2, 45.
Page 98
107. Set up a generating function and use it to find the number of ways in which eleven
identical coins can be put in three distinct envelopes (labeled A, B, C) envelopes A and B
have the same number of coins in them.
Ans: (1 x2 x4 x6 x8 x10)(1 x x2 x3 ), 6.
108. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children if each child gets at least one block.
Ans: (x x2 x3 )4, 56.
109. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children, if each child gets at least two blocks.
Ans: (x2 x3 x4 )4, 4.
110. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children, if each child gets at most five blocks.
Ans: (1 x x2 x3 x4 x5)4, 140.
111. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children, if the oldest child gets three blocks.
Ans: x3(1 x x2 x3 )3, 28.
112. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children, if the oldest child gets at most three blocks.
Ans: (1 x x2 x3)(1 x x2 x3 )3, 164.
113. Set up a generating function and use it to find the number of ways in which nine identical
blocks can be given to four children, if the oldest child gets either 2 or 3 blocks.
Ans: (x2 x3)(1 x x2 x3 )3, 64.
114. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for 000a0a1a2….
Ans: x3G(x).
115. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for 000a3a4a5….
Ans: G(x) a0 a1x a2x2.
116. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for a3a4a5a6….
Ans: .
Page 99
117. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for a00a10a20a30a4….
Ans: G(x2).
118. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for a03a19a227a381a4….
Ans: G(3x).
119. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for a000a100a200a3….
Ans: G(x3).
120. If G(x) is the generating function for a0a1a2a3…, describe in terms of G(x) the
generating function for 5a10a3a4a5….
Ans: G(x) a0 a2x2 5.
124. Find A1 A2 A3 A4 if each set Ai has 100 elements, each intersection of two sets
has 60 elements, each intersection of three sets has 20 elements, and there are 10
elements in all four sets.
Ans: 110.
125. Find A1 A2 A3 A4 if each set Ai has 150 elements, each intersection of two sets
has 80 elements, each intersection of three sets has 20 elements, and there are no
elements in all four sets.
Ans: 200.
126. Find the number of terms in the formula for the number of elements in the union of four
sets given by the principle of inclusion-exclusion.
Ans: 15.
127. Find the number of positive integers 1000 that are multiples of at least one of 3511.
Ans: 515.
Page 100
128. Find the number of positive integers 1000 that are multiples of at least one of 2612.
Ans: 500.
129. Find the number of positive integers 1000 that are multiples of at least one of 3412.
Ans: 542.
131. How many positive integers not exceeding 1000 are not divisible by either 4 or 6?
Ans: 667.
132. A doughnut shop sells 20 kinds of doughnuts. You want to buy 30 doughnuts. How many
possibilities are there if you want at most six of any one kind?
Ans: .
133. A doughnut shop sells 20 kinds of doughnuts. You want to buy 30 doughnuts. How many
possibilities are there if you want at most 12 of any one kind?
Ans: .
134. A market sells ten kinds of soda. You want to buy 12 bottles. How many possibilities are
there? if you want
(a) at least one of each kind
(b) at most seven bottles of any kind?
Ans: (a) (b) .
135. A market sells ten kinds of soda. You want to buy 12 bottles. How many possibilities are
there? if you want at most three bottles of any kind?
Ans: .
136. Suppose you have 100 identical marbles and five jars (labeled A, B, C, D, E). In how
many ways can you put the marbles in the jars if:
(a) each jar has at least six marbles in it?
(b) each jar has at most forty marbles in it?
Ans: (a) . (b) .
Page 101
137. How many ways are there to choose five donuts if there are eight varieties and only the
type of each donut matters?
Ans: .
138. A market sells 40 kinds of candy bars. You want to buy 15 candy bars.
(a) How many possibilities are there?
(b) How many possibilities are there if you want at least three peanut butter bars and at
least five almond bars?
(c) How many possibilities are there if you want exactly three peanut butter bars and
exactly five almond bars?
(d) How many possibilities are there if you want at most four toffee bars and at most six
mint bars?
Ans: (a) . (b) . (c) . (d) .
139. How many permutations of all 26 letters of the alphabet are there that contain at least one
of the words DOG, BIG, OIL?
Ans: 24 3.
140. How many permutations of all 26 letters of the alphabet are there that contain at least one
of the words CART, SHOW, LIKE?
Ans: 3 23 3 20 17.
141. How many permutations of all 26 letters of the alphabet are there that contain at least one
of the words SWORD, PLANT, CARTS?
Ans: 3 22 18.
142. How many permutations of all 26 letters of the alphabet are there that contain none of the
words: SAVE, PLAY, SNOW?
Ans: 26 3 23 20.
143. How many permutations of all 26 letters of the alphabet are there that contain at least one
of the words: CAR, CARE, SCAR, SCARE?
Ans: 24.
144. How many permutations of the 26 letters of the alphabet are there that do not contain any
of the following strings: LOP, SLOP, SLOPE, LOPE.
Ans: 26 24.
145. You have ten cards, numbered 1 through 10. In how many ways can you put the ten cards
in a row so that card i is not in spot i, for i 12…10?
Ans: .
Page 102
146. Suppose A 8 and B 4. Find the number of functions f A B that are onto B.
Ans: .
147. An office manager has four employees and nine reports to be done. In how many ways
can the reports be assigned to the employees so that each employee has at least one report
to do.
Ans: .
148. An office manager has five employees and 12 projects to be completed. In how many
ways can the projects be assigned to the employees so that each employee works on at
least one project.
Ans: .
149. Find the number of ways to put eight different books in five boxes, if no box is allowed
to be empty.
Ans: .
150. Find the number of bit strings of length eight that contain a pair of consecutive 0s.
Ans: an an 1 an 2 2n 2, a1 0, a2 1. Hence a8 201.
151. Find the number of ways to climb a 12-step staircase, if you go up either one or three
steps at a time.
Ans: an an 1 an 3, a1 a2 1, a3 2. Hence a12 60.
152. Find the number of strings of 0s, 1s, and 2s of length six that have no consecutive 0s.
Ans: Hence, .
Page 103