chosen. 17. In how many ways can 25
identical donuts be distributed to four
police officers so that each officer gets
at least three but no more than seven
donuts? 18. Use generating functions
to find the number of ways to select 14
balls from a jar conta
the smallest Fibonacci number greater
than 1,000,000, greater than
1,000,000,000, and greater than
1,000,000,000,000. 3. Find as many
prime Fibonacci numbers as you can. It
is unknown whether there are
infinitely many of these. 4. Write out all
the moves
willing to marry exactly k of the men.
Also, suppose that a man is willing to
marry a woman if and only if she is
willing to marry him. Show that it is
possible to match the men and women
on the island so that everyone is
matched with someone that they ar
c) Explain how to count the number of
derangements of n objects.
Supplementary Exercises 1. A group of
10 people begin a chain letter, with
each person sending the letter to four
other people. Each of these people
sends the letter to four additional
peopl
with the initial condition a0 = 1. P1: 1
CH08-7T Rosen-2311T MHIA017Rosen-v5.cls May 13, 2011 16:25 8.4
Generating Functions 551 35. Use
generating functions to solve the
recurrence relation ak = 5ak1
6ak2 with initial conditions a0 = 6
and a1 = 30. 36.
money produced in the nth hour. b)
What are the initial conditions for the
recurrence relation in part (a)? c)
Solve the recurrence relation for the
amount of money produced in the nth
hour. d) Set up a recurrence relation
for the total amount of money
pr
develop a dynamic programming
algorithm for finding a longest
common subsequence of two
sequences a1, a2,.,am and b1, b2,.,bn,
an important problem in the
comparison of DNA of different
organisms. 15. Suppose that c1, c2,.,cp
is a longest common subsequen
C0 and a1 = C1, and a positive integer
k, find ak using iteration. 8. Given a
recurrence relation an = c1an1 +
c2an2 and initial conditions a0 = C0
and a1 = C1, determine the unique
solution. P1: 1 CH08-7T Rosen-2311T
MHIA017-Rosen-v5.cls May 13, 2011
16:
recurrence relation for the number of
rabbits on the island in the middle of
the nth month. 14. In this exercise we
construct a dynamic programming
algorithm for solving the problem of
finding a subset S of items chosen from
a set of n items where item i
Rosen-v5.cls May 13, 2011 16:18 668
10 / Graphs 61. If the simple graph G
has v vertices and e edges, how many
edges does G have? 62. If the degree
sequence of the simple graph G is 4, 3,
3, 2, 2, what is the degree sequence of
G? 63. If the degree sequen
+)(x2 + x4 + x6 + x8 + ) e) (1 + x +
x2)3 11. Find the coefficient of x10 in
the power series of each of these
functions. a) 1/(1 2x) b) 1/(1 + x)2 c)
1/(1 x)3 d) 1/(1 + 2x)4 e) x4/(1
3x)3 12. Find the coefficient of x12 in
the power series of each of th
disk moves are restricted, and those
where disks may have the same size.
Include what is known about the
number of moves required to solve
each variation. 4. Discuss as many
different problems as possible where
the Catalan numbers arise. 5. Discuss
some o
function at each element of the
domain. Therefore, N (Pi) = 26.
Furthermore, there are C(3, 1) terms of
this kind. Note that N (PiPj ) is the
number of functions that do not have
bi and bj in their range. Hence, there is
only one choice for the value of t
sets A1, A2, A3, and A4 each contain 25
elements, the intersection of any two of
these sets contains 5 elements, the
intersection of any three of these sets
contains 2 elements, and 1 element is
in all four of the sets. How many
elements are in the union
inclusionexclusion can also be used to
determine the number of onto
functions from a set with m elements
to a set with n elements. First consider
Example 2. EXAMPLE 2 How many onto
functions are there from a set with six
elements to a set with three eleme
where every employee gets at least one
job is the same as an P1: 1 CH08-7T
Rosen-2311T MHIA017-Rosen-v5.cls
May 13, 2011 16:25 562 8 / Advanced
Counting Techniques onto function
from the set of jobs to the set of
employees. Hence, by Theorem 1 it
follows
sequence of Catalan numbers, then
xG(x)2 G(x) + 1 = 0. Conclude (using
the initial conditions) that G(x) = (1
1 4x)/(2x). b) Use Exercise 40 to
conclude that G(x) = n = 0 1 n + 1 2n
n xn, so that Cn = 1 n + 1 2n n . c) Show
that Cn 2n1 for all positive i
used. 30. If G(x) is the generating
function for the sequence cfw_ak, what is
the generating function for each of
these sequences? a) 2a0, 2a1, 2a2,
2a3, . b) 0, a0, a1, a2, a3, . (assuming
that terms follow the pattern of all but
the first term) c) 0, 0,
x3 x4 x5 x6) is the generating
function for the number of ways that
the sum n can be obtained when a die
is rolled repeatedly and the order of
the rolls matters. b) Use part (a) to find
the number of ways to roll a total of 8
when a die is rolled repeate
divisible by 2, let P2 be the property
that an integer is divisible by 3, let P3
be the property that an integer is
divisible by 5, and let P4 be the
property that an integer is divisible by
7. Thus, the number of primes not
exceeding 100 is 4 + N (P 1P 2
form for the generating function for
the sequence cfw_an, where a) an = 1 for
all n = 0, 1, 2,. b) an = 2n for n = 1, 2, 3,
4,. and a0 = 0. c) an = n 1 for n = 0, 1,
2,. d) an = 1/(n + 1)! for n = 0, 1, 2,.
e) an = n 2 for n = 0, 1, 2,. f ) an = 10
n + 1
domain to n indistinguishable boxes so
that no box is empty, and then to
associate each of the n elements of the
codomain to a box. This means that the
number of onto functions from a set
with m elements to a set with n
elements is the number Counting ont
5, and x3 7) = 0. Inserting these
quantities into the formula for N (P 1P
2P 3) shows that the number of
solutions with x1 3, x2 4, and x3 6
equals N (P 1P 2P 3) = 78 36 28
15 + 6 + 1 + 0 0 = 6. P1: 1 CH08-7T
Rosen-2311T MHIA017-Rosen-v5.cls
May 13, 2011
position. A derangement is a
permutation of objects that leaves no
object in its original position. To solve
the problem posed in Example 4 we
will need to determine the number of
derangements of a set of n objects.
EXAMPLE 5 The permutation 21453 is
a de
with x1 2, 0 x2 3, and 2 x3 5?
b) Use your answer to part (a) to find
a6. 24. a) What is the generating
function for cfw_ak, where ak is the
number of solutions of x1 + x2 + x3 +
x4 = k when x1, x2, x3, and x4 are
integers with x1 3, 1 x2 5, 0 x3
4, and
if and only if there is an index m, 1 m
n, such that ai < ai+1 when 1 i ai+1
when m i< ai+1 where 1 i ai+1
where 1 i<m< x1 < 6, 6 < x2 < 10, and
0 < x3 < 5? 38. How many positive
integers less than 1,000,000 are a)
divisible by 2, 3, or 5? b) not divisib
there is a one-to-one correspondence
between the sets of vertices of the
graphs. Isomorphic simple graphs also
must have the same number of edges,
because the one-to-one
correspondence between vertices
establishes a one-to-one
correspondence between edges
May 13, 2011 15:29 9 CHAPTER
Relations 9.1 Relations and Their
Properties 9.2 n-ary Relations and
Their Applications 9.3 Representing
Relations 9.4 Closures of Relations 9.5
Equivalence Relations 9.6 Partial
Orderings Relationships between
elements of set
employees: Zamora, Agraharam, Smith,
Chou, and Macintyre. Each employee
will assume one of six responsiblities:
planning, publicity, sales, marketing,
development, and industry relations.
Each employee is capable of doing one
or more of these jobs: Zamora
EXAMPLE 4 Draw a graph with the
adjacency matrix 0110 1001
1001 0110 with respect to the
ordering of vertices a, b, c, d. a b d c
FIGURE 4 A Graph with the Given
Adjacency Matrix. Solution: A graph
with this adjacency matrix is shown in
Figure 4. P1: 1 CH