9-12 Solutions PDF
9-12 Solutions PDF
9-12 Solutions PDF
Chapter 9: Probability
9.2. If P(A) and P(B) are not zero, and P(A|B) = P(B|A), then P(A) =
P(B)TRUE. The two quantities equal P(A B)/P(B) and P(A B)/P(A),
so they are equal if and only if the denominators are equal.
9.3. If P(A) and P(B) are not zero, and P(A|B) = P(B|A), then A and B
are independentFALSE. If A and B are the same event, then P(A B) =
P(A) > P(A)P(B), and they are not independent.
9.4. If P(A) > 1/2 and P(B) > 1/2, then P(A B) > 0TRUE. If P(A
B) = 0, then A and B have no common points with positive probability, and
P(A B) = P(A) + P(B) > 1, which is impossible.
9.7. An event and its complement are independent if and only if their probabilities are 1 and 0. The probability of the intersection of A and A c is 0. If
they are independent, then 0 = P(A A c ) = P(A)P(Ac ) = P(A)(1 P(A)).
This requires that P(A) or 1 P(A) is 0.
9.8. Restaurant menu items. Let S denote the event that what the man
orders is out of stock. Let A and F denote the events of ordering pasta
and fish, respectively. We are given that P(A) = P(F) = .5 and P(S|A) =
P(S|F) = .5. By direct computation, P(S) = P(S A) + P(S F) =
P(S|A)P(A) + P(S|F)P(F) = .5(.5) + .5(.5) = .5.
The answer makes sense, since the probability that the dish is out
of stock is .5 every day, no matter what he orders. Arbitrary values may
arise for the values P(A), P(F), P(S|A), and P(F|A), in which case the
conclusion is obtained by the computation above.
9.9. Conditional probability for drawing marbles. The contents of the containers are R R , B B , and R B . In choosing a random marble from a random
container, there are six equally likely outcomes, three R and three B . The
126
number of outcomes in which the selected ball and the other in its container are both black is two. The condition probability of the other ball
being black (event O ), given that the selected ball is black (event B ), is
computed as P(O|B) = P(O B)/P(B) = (1/3)/(1/2) = 2/3.
9.10. Rolling two dice, one red and one green. There are 36 equally likely
possible outcomes.
a) Given that the red die shows a six, the probability of double-sixes is
1/6. Given that the red die shows a six, the roll is double-sixes if and only
if the green die shows a six, which occurs with probability 1/6.
b) Given that at least one die shows a six, the probability of doublesixes may be 1/6 or 1/11, depending on how the information was obtained.
If we saw one die and observed that it showed a six, then the probability
that the other die also shows a six is 1/6.
If someone tells us after seeing both dice that at least one shows a six,
then we can compute the conditional probability. The event "at least one
six" ( B ) consists of 11 equally likely rolls, of which exactly one is "doublesix" ( A). The formal computation of conditional probability is P(A|B) =
P(A B)/P(B) = (1/36)/(11/36) = 1/11.
9.11. The TV game show problem. The prize must be behind the contestants door (event C ) or the other unopened door (event D ). We seek the
conditional probabilities of these two events, given what has happened so
far. Let A be the door opened by the host. For each door, the probability of
being correct in the game is 1/3. Given event C , the conditional probability
of opening A is 1/2. Given event D , the conditional probability of opening A is 1. Given that the prize is behind A, the conditional probability of
opening it is 0.
Thus the conditional probability of opening A, given the door chosen
by the contestant, is (1/3)(1/2) + (1/3)1 + (1/3)0 = 1/2. The probability
that C occurs and A is opened is (1/3)(1/2) = 1/6. The probability that
D occurs and A is opened is (1/3)(1) = 1/3. The probability that C occurs
given that A is opened is thus (1/6)/(1/2) = 1/3, and the probability that
D occurs given that A is opened is (1/3)/(1/2) = 2/3.
9.12. Bertrands Paradox. In the following probability models, let p be the
probability that
the length ofthe randomaly generated chord of the unit
circle exceeds 3. Note that 3 is the length of the sides of an equilateral
triangle inscribed in the circle.
a) If the endpoints of the chord are generated by two random spins on
the circumference of the circle, then p = 1/3. After spinning once, draw
the inscribed triangle
with a corner at the chosen point. The length of the
chord will exceed 3 if and only if the second chosen point lies between the
127
Chapter 9: Probability
other two corners of the triangle on the circle. Since probability of lying in
an arc is proportional to its length, the probability of this is 1/3.
b) If the midpoint of the chord is generated by throwing a dart at the
circle, then p = 1/4. The chord is generated from its midpoint P by drawing
the chord through P that is perpendicular to the segment
from P to the
center of the circle. The midpoint of a chord of length 3 has distance 1/2
from the center of the circle. Thus the length exceeds 3 if and only if the
generated midpoint has distance less than 1/2 from the center. Since area
is proportional to the square of the radius and probability is proportional
to area, the circle of radius 1/2 has 1/4 of the probability.
c) A model where p = 1/2. We first pick the distance of the chord
from the center; then we choose a random chord
with that distance from
the center. The length of the chord exceeds 3 if and only if its distance
from the center is less than 1/2. We pick this distance at random from the
interval [0, 1].
first vote, the probability that A never trails in the remaining portion of
the election is the solution to the Ballot Problem for an election ending at
(a 1, b). We have computed this to be (a b)/a . Since both these events
a ab
must occur, the probability that A is always ahead is a+b
= ab
.
a
a+b
9.13.
Triangles on triples among n equally spaced points on a circle. The
n
triples
are equally like. Thus we count how many yield three equal
3
lengths, two equal lengths and one different length, and three different
lengths.
When 3|n , there are n/3 triples that form equilateral triangles; otherwise there are none. To generate two equal segments, we choose their
common point in n ways and then their common length in b(n 1)/2c ways.
When 3|n , we must subtract from n b(n 1)/2c the n/3 equilateral triangles. The resulting probabilities are listed below by the congruence class
of n modulo 6.
0
equilateral
isosceles
other
2
(n1)(n2)
3n8
(n1)(n2)
n4
n1
3
n2
n5
n2
3
n1
n4
n1
2
(n1)(n2)
3n5
(n1)(n2)
n5
n2
3
n1
n4
n1
3
n2
n5
n2
9.14. In Bertrands Ballot Problem with outcome (a, b) where a > b, the
probability that A is always ahead of B is ab
, and the probability that the
a+b
2b
score is tied at some point is a+b . The two probabilities must sum to 1 when
a > b. A fails to be always ahead if and only if B has at least as much
at some point. Since A winds up ahead, B has at least as much at some
point if and only if there is a tie at some point. Thus it suffices to find the
probability that A is always ahead.
If A is always ahead of B, then A must get the first vote, and A must
get at least as many votes as B in every initial segment of the remainder.
The probability that A gets the first vote is a/(a + b). Given that A gets the
128
9.16. A conditional probability computation. We are given three independent random variables X 1 , X 2 , X 3 , each defined on [n ] and equally likely to
take on any value in [n ]. The variable X 1 + X 2 is less than 4 only for the
outcomes (1, 2), (1, 1), (2, 1), which together have probability 3/n 2 . Thus
P(X 1 + X 2 4) = 1 3/n 2 . The events X 1 + X 2 + X 3 6 and X 1 + X 2 4
both occur if and only if X 3 = 2 and (X 1 , X 2 ) {(3, 1), (2, 2), (1, 3)} or
X 3 = 1 and (X 1 , X 2 ) {(3, 1), (2, 2), (1, 3), (4, 1), (3, 2), (2, 3), (1, 4)}. Thus
the probability that both occur is 1n n32 + 1n n72 = 10
. The desired conditional
n3
probability is
10 n 2 3
/ n2
n3
10
.
n 2 3
9.17. Application of Bayes Theorem. Against her four opponents, the tennis player wins with probability .6, .5, .45, .4, respectively. These are the
conditional probabilities P(A|Bi ), where A is the event that she wins and Bi
is the event that she plays the i th opponent. We want to compute P(Bi |A)
for each i . Since she plays 30 matches against each of the first two and 20
matches against each of the last two opponents, we have P(Bi ) = .3, .3, .2,
.2, respectively. Thus we have all the data to compute The denominator,
which equals P(A), is .6 .3 + .5 .3 + .45 .2 + .4 .2 = .5. Thus the answers
are P(A|Bi )P(Bi ) 2, which equal .36, .30, .18, .16, respectively.
129
Chapter 9: Probability
9.18. If half the females and one-third of the males in a class are smokers, and two-thirds of the students are male, then of the smokers are female.
Consider choosing a random student in the class. Let A be the event of
being a smoker. Let B1 , B2 be the events of being female or male, respectively. We seek P(B1 |A). We are given P(A|B1 ) = 1/2, P(A|B2 ) = 1/3, and
P(B2 ) = 2/3. By Bayes Formula, we compute
3
ai bi
(1/2)(1/3)
P(B1 + A) =
=
= .
6a j b j
(1/2)(1/3) + (1/3)(2/3)
7
9.19. Simpsons paradox - it is possible for A to have a higher batting average than B in day games and night games but for B to have a higher
average overall. If the daytime hits/attempts are a/b and c/d , respectively,
and the nighttime hits/attempts are w/x and y/z , respectively, then inequalities characterizing the situation described are a/b > c/d , w/x > y/z ,
and (c + y)/(d + z) > (a + w)/(b + x). The situation described occurs if and
only if these three inequalities are satisfied by eight integers also satisfying
0 a b, 0 c d , 0 w x , 0 y z . Equivalently, the three inequalities can be written as ad > bc , wz > x y , and (c + y)(b + x) > (a + w)(d + z).
Note that if b = d and x = z , then the inequalities lead to a contradiction and the paradox cannot occur. This suggests that one way in which
the paradox can occur is if the poor daytime performance of B and the good
nighttime performance of A are unimportant to their season averages, as
would occur if B hardly ever plays in daylight and A hardly ever plays at
night. For example, the paradox occurs with the numbers (a, b) = (3, 10)
and (c, d) = (0, 1) for daytime and (w, x) = (1, 1) and (y, z) = (7, 10) for
nighttime. For the season, the averages are 4/11 and 7/11.
9.20. Simpsons Paradox with university faculties of equal size.
Asst. Profs.
Assoc. Profs.
Full Profs.
Total
Univ. H
Total
40
30
30
100
Univ. Y
Women
25
5
5
35
Fraction
.6
.17
.17
.35
Total
80
10
10
100
Women
40
0
0
40
Fraction
.5
0
0
.4
to
130
2(n+1k)
.
(n+1)(n+2)
(n+1)(n+2)
=
= 2(n+1)
k=0 n+2
(n+1)(n+2)
n+2
2
2n+2n
n+2
=1
9.23. Probability of first player getting first Head. The probability of heads
is p on each flip. If x is the probability that the first player wins, then x is
the sum of the probability of winning on the first flip and the probability
of winning later. Winning later requires tails from each player on the first
round, but then the rest of the game is the same as the original game.
Thus x = p + (1 p)2 x , which yields x = p/[1 (1 p)2 ] = 1/(2 p).
When the coin is fair, the first player wins with probability 2/3. (Note: the
probability
that the first player wins on the i th try is p(1 p)2 (i 1). Thus
P
also x = i=1 p(1 p)2 (i 1).
!
n1
X
1 n+1
1
2n1 + 2 + 2n +
(2k + 2k2 ) =
2
+ 2n1 + 2n2 4
n
n
k=2
131
Chapter 9: Probability
the sum of these, ( pk1 + pk )/2. The conditional probability that the other
is ak1 is pk1 /( pk1 + pk ), and the conditional probability that the other is
ak+1 is pk /( pk1 + pk ).
Thus the expected payoff for switching when he sees ak is
E(X ) =
n
X
i=1
i pi =
n X
i
X
i=1 k=1
pi =
n X
n
X
k=1 i=k
pi =
n
X
k=1
P(X k).
Essentially, we add up in two ways the probability pi for all pairs (k, i) such
that 1 k i n .
,
2n
k
k(k 1)
,
2n(2n 1)
132
Since X =
Pn
k(k1)
.
2n(2n1)
i=1
j=1
9.29. Given a set of n men and n women, the expected number of malefemale couples in a random pairing is n 2 /(2n 1). Let X be the random
variable giving the number of male-female couples. We express X as the
sum of n 2 indicator variables. Define X i, j by X i, j = 1 when the i th man
is paired with the j th woman, X i, j = 0 otherwise. By the linearity of
expectation, E(X ) = n 2 E(X i, j ).
By symmetry, an individual is equally likely to be paired with any one
of the other 2n 1. Thus E(X i, j ) = 1/(2n 1), and E(X ) = n 2 /(2n 1).
9.30. There are 34,650 arrangements of the letters in M I SS I SS I P P I .
Among the 11 letters,
there are four Is, four Ss, two Ps, and one M. Thus
11
11!
we compute 4,4,2,1
, which equals 4!4!2!1!
9.31. Solution 9.40 overestimates the probability of hitting for the cycle.
Not all the appearances of a batter count as an at-bat. Other outcomes are
possible; walks and sacrifices are not counted as at-bats.
9.32. A polynomial p such that p(n) = 3n for n = 0, 1, 2, 3, 4. The multinomial expansion of (1 + 1 + 1)n is a sum of multinomial coefficients, since
always 1ki = 1. We write the coefficients as
n
k1 , k2 , k3
n(n 1) (n k1 k2 + 1)
n!
=
k1 !k2 !(n k1 k2 )!
k 1 !k 2 !
133
Chapter 9: Probability
134
135
Given any ballot list of length 2n , we can invert the map as follows:
When we reach a 1 in position i , we leave pi unmatched. When we reach a
0 in position i , we match pi to the point corresponding to the most recent
unmatched 1, which exists since we have seen at least as many 1s as 0s.
No crossing occurs, because when the second point of the first pair in a
crossing is reached, it would have been matched instead to the first point
in the second pair, since that corresponded to a more recent unmatched 1.
in the interval [0, 1]. Hence the row player guarantees the best return by
choosing x to make these equal; this maximizes the minimum. He chooses
x = (c d)/(b d a + c); the denominator is non-zero. Using this in the
bcad
expression for the expected return in either column yields bda+c
. This is
the maximum that the row player can guarantee. Similarly, the column
player can guarantee losing no more than this.
9.41. Paying each option with equalprobability is optimal for both players
in the matrix game with payoffs ac db to the row player if and only if a = d
and b = c. If the column player (B) plays each column with probability
1/2, then the expected payoff to the row player (A) is half the row sum in
each row. Thus playing the options with equal probability can be optimal
for both players only if the rows have the same sum. By the analogous
argument, the columns must also have the same sum.
Thus d must equal both a + b c and a + c b. This yields b = c.
Similarly, c = b + a d = b + d a yields a = c. For every such matrix,
the equal strategy guarantees that A has expected payoff at least (a + b)/2
and that B has expected loss at most (a + b)/2.
9.42. The value of the game with payoff matrix ac db . If any entry e is a row
minimum and a column maximum (a saddlepoint), then the row player
will play that row, guaranteeing winning at least e, and the column player
will play that column, guaranteeing losing at most e. Since the column
player cannot guarantee losing less than the row player can guarantee
winning, these strategies are optimal, and the value of the game is e.
By playing row 1 with probability x , the row player guarantees receiving the minimum of ax + c(1 x) = c + (a c)x and bx + d(1 x) =
d + (b d)x . If the matrix has no saddlepoint, then a c and b d have
opposite signs and the graphs of the two linear functions cross at some x
136
10.1. During a major league baseball season in which there are 140,000
at-bats and 35,000 hits,
a) Some player hits exactly .250FALSE. It may happen that there
are 1000 players, each with 140 at-bats, half of them having 28 hits each
(batting .200) and the other half having 42 hits each (batting .300).
b) Some player hits at least .250TRUE. If each hitter has more than
four times as many at-bats as hits, then the total number of at-bats would
be more than four times the total number of hits, which would contradict
the given data.
c) Some player hits at most .250TRUE. If each hitter has less than
four times as many at-bats as hits, then the total number of at-bats would
be less than four times the total number of hits, which would contradict
the given data.
10.2. Distinct three-person
committees over 11 years. If a set of size n has
11 distinct triples, i.e. 3n 11, then n 6.
10.3. If S is a (2n + 1)-subset of {1, 2, . . . , 3n}, then S contains three consecutive numbers, and this is not forced for a 2n -subset. Partition [3n ] into
n classes, with the i th class consisting of the numbers {3i 2, 3i 1, 3i}.
Since S has 2n + 1 distinct numbers, by the pigeonhole principle it must
have 3 numbers from some class. These three numbers are consecutive.
On the other hand, the set that omits all the numbers divisible by three has
2n numbers but no three consecutive numbers (it has the first two numbers
from each class).
10.4. Every set of n + 1 numbers in [2n ] contains a pair of relatively prime
numbers. Any pair of consecutive numbers is relatively prime, since an
integer greater than 1 cannot divide two consecutive integers. Hence it
suffices to partition the set [2n ] into the n pairs of the form (2i 1, 2i).
Since there are only n of these pairs, the pigeonhole principle guarantees
that a set of n + 1 numbers in [2n ] must use two from some pair, and these
are relatively prime.
137
The upper bound 2/2 for the minimum distance is best possible, because the configuration with points at the four corners
and one point in the
10.5. Every set of seven distinct integers contains a pair whose sum or difference is a multiple of 10. If two numbers in our set of seven are in the
same congruence class modulo 10, then we have a pair whose difference is
a multiple of 10. If one is congruent to i and another is congruence to 10 i
mod 10, then we have a pair whose sum is a multiple of 10.
We therefore define six sets, each of which is a congruence class or a
pair of congruence classes that sum to 0. These sets are 0, 1 9, 2 8, 3
7, 4 6, 5. These sets partition the set of integers. Whenever we choose
seven integers, the pigeonhole principle guarantees that two must lie in
the same set, and then their sum or difference is a multiple of 10.
10.6. If 1 through 10 appear in some order around a circle, then some three
consecutive numbers sum to at least 17. Each number appears in three
P10
such triples, so the total of the sums of triples is 3 i=1
= 165.
i = 3 11
2
When 165 units fall into ten triples, at least one triple receives at least 17.
10.7. Numbers 1 through 12 on a clock face.
For every arrangement of the numbers 1 through 12 in a circle, there
are three consecutive numbers with sum at least 20. Given an arbitrary
arrangement, partition the 12 numbers into 4 consecutive triples. The 78
P12
units in the sum i=1
i = 13 12/2 are distributed into these four classes,
so some class receives at least the average of 78/4 = 19.5 units. Since each
class receives an integer amount, some class receives at least 20.
There are five consecutive numbers with sum at least 33. We cannot
partition 12 objects into sets of size five. Nevertheless, each number belongs to five sets of five consecutive numbers. Thus the twelve sets of
P12
five consecutive numbers have sums that total to 5 i=1
i = 390, and the
largest of these sums must be at least d390/12e = 33.
The sets of three consecutive elements cannot all have sum 19 or 20. If
there is such an arrangement, then successive triples (overlapping in two
positions) cannot have the same total, because this puts the same number
at the beginning of the first triple and the end of the second. Thus the
triples alternate between sum 19 and sum 20. We may assume that the
triples starting in odd positions have sum 19. Since x 1 + x 2 + x 3 = x 5 + x 6 +
x 7 = 19 and x 2 + x 3 + x 4 = x 4 + x 5 + x 6 = 20, we have x 1 = x 4 1 = x 7 . Thus
the diametrically opposite numbers are the same, which is forbidden.
138
10.9. Pigeonhole
generalization: If p1 , . . . , pk are natural numbers, then
P
1k +
pi is the minimum n such that every way of distributing n objects
into classes 1, . . . , k yields at least pi objects in class i for some i . If the i th
class
P has fewer than
P pi objects, then the total number of objects is at most
( pi 1P
) = k +
pi . Thus some threshold
must be met when there are
P
pi objects. A total of k +
pi does not suffice, since then we
1k+
can put pi 1 objects in class i for each i .
10.10. If ten people each mark off a 100-yard field on a 400-yard segment,
then some point lies in at least four fields. Let x 1 , . . . , x 10 be the starting
points of the ten fields, with 0 x 1 x 10 300. Consider the three
disjoint intervals [0, 100), [100, 200), and [200, 300]. With ten numbers in
these three intervals, by the pigeonhole principle at least one of the three
contains at least four of the starting points. The right endpoint of that
interval is in the four fields having those starting points.
10.11. Multiples of x near an integer. Let S = {x, 2x, . . . , (n 1)x}.
a) For n N, if two numbers in S have fractional parts differing by at
most 1/n , then some number in S differs by at most 1/n from an integer.
Let i x and j x have fractional parts differing by at most 1/n , where j > i .
That is, i x = k + y and j x = l + z , where k, l Z and |y z| 1/n . Thus
( j i)x = (l k) + z y . Since l k is an integer, we conclude that ( j i)x
is within 1/n of an integer. Also ( j i)x S , since 0 < j i < j .
b) Some number in S is within 1/n of an integer. All fractional
S parts
lie in the interval [0, 1). Let Ir = [(r 1)/n, r/n), so [0, 1) = rn=1 Ir . If
some number in S has fractional part in I1 or In , then it is within 1/n of an
integer. Otherwise, the fractional parts of the n 1 numbers in S lie in the
n 2 intervals I2 , . . . , In1 . By the pigeonhole principle, some two of them
lie in one of these intervals. Since the intervals have length 1/n , we have
two numbers in S with fractional parts that differ by at most 1/n . Part (a)
now completes the proof.
139
10.12. Every set of n integers has a nonempty subset whose sum is divisible
by n . Let S = {b1 , . . . , bn }. We prove the stronger result that
P j some consecutive set {bi+1 , . . . , b j } has sum is divisible by n . The sum k=i+1 bk is divisP
Pj
ible by n if and only if ik=1 bk and k=1 bk have the same remainder upon
Pj
division by n . This suggests introducing the partial sums a j = k=1 bk . We
have n such sums, and we place them in the remainder classes 0, . . . , n 1.
If any a j is divisible by n , we are done, and {b1 , . . . , b j } is the desired set.
Otherwise, we are placing n partial sums in the n 1 remaining classes,
and by the pigeonhole principle a pair of these must go in the same class.
As noted above, if ai and a j have the same remainder under division by n ,
then {bi+1 , . . . , b j } is the desired set.
The integers 1, . . . , 1 (or any list of n 1 integers congruent to 1 modulo
n ) are integers with no nonempty subset summing to a multiple of n .
10.14. Any six people contain three that pairwise know each other or three
that pairwise dont know each other. Consider an arbitrary person x among
the six. Among the five other people, the pigeonhole principle guarantees
that there must be at least three who know x or at least three who dont
know x . By symmetry (between acquaintance and nonacquaintance), we
may assume that x knows at least three others. If two who know x know
each other, then we have (at least) three people who all know each other.
Otherwise, we have (at least) three people (all knowing x ) none of whom
know each other.
140
141
This list has the desired property because a decreasing sublist has elements only in a single segment, but the segments have length n , and an
increasing sublist has at most one element from each segment, but there
are only m segments.
10.20. Generalization of the Chess Player Problem. The chess player plays
on d consecutive days for a total of at most b games. If k is small enough and
b 2d 1, then there must be a period of consecutive days during which
a total of exactly k games are played. The range for which the argument of
Example 10.8 works is k 2d b.
Let ai be the total number of games played on days 1 through i , and
set a0 = 0. Then a j ai is the total number of games played on days i + 1
through j . We seek i and j such that ai + k = a j . Since there is at least one
game each day, the numbers in {a j : 1 j d} are distinct, as are those
in {ai + k : 0 i d 1}. Hence a duplication among these 2d numbers
implies the desired result. Since ad b, and ad1 + k b 1 + k , the
pigeonhole principle yields the desired result whenever 2d > b + k 1.
Thus the argument works whenever k 2d b.
142
10.22. If m 2n and S is a set of m points on a circle with no two diametrically opposite, then S has at most n free points, where x S is free if fewer
than n points of S x lie in the semicircle clockwise from x . If m > 2n ,
consider a diameter of the circle not intersecting S . One of the resulting
semicircles has more than n points. The first point x in this semicircle is
not free, and any other point of S is free only if it is free in S x . Hence
S x has as many free points as S . When the remaining set has size 2n ,
partition it into pairs such that between a point and its mate there are
n 1 points in each direction on the circle. Then exactly one point in each
pair is free, and the original set S has at most n free points.
10.23. Every two-colored square grid of order at least five has a rectangle
with corner of the same color, but the grid of order four has no such rectangle, so the answer is five. Consider a subgrid of order five. Each column
143
has a majority in some color. By the pigeonhole principle, some color is the
majority in at least three of the columns. Suppose this is black. Each pair
of these three columns is black in at least one common row. If they are all
black in one common row, then they have at least 6 blacks in the other four
rows; another row receiving two blacks completes the rectangle.
If they are not black in a common row, then the three pairs of columns
have common blacks in three distinct rows. There remain at least three
blacks among these columns in the remaining two rows. Thus one of these
rows has at least two blacks, and this completes a black-cornered rectangle
with one of the three rows described initially.
+
6
4]
/
.
13
13
13
10.24. There are 310 ways to assign 10 distinct people to three distinct
rooms, of which 310 3 210 + 3 ways leave no room empty. For each person, an independent choice among three rooms must be made, so there are
310 total ways to assign them (corresponding to ternary lists of length 10).
To count assignments with no room empty, apply inclusion-exclusion
to the universe of all 310 assignments. TLet Ai be the set of assignments
in which room i is empty. Note that | iS Ai | depends only on |S|. The
inclusion-exclusion formula counts the assignments with no rooms empty
(in none of A1 , A2 , A3 ) as 310 3 210 + 3 110 010 , because the number
of assignments with a specified k rooms empty is (3 k)10 . The answer is
310 3 210 + 3.
10.25. Decimal n -tuples with at least one each of {1, 2, 3}. We must avoid
n -tuples that lack any of these digits. The number of n -tuples lacking k
specified digits is (10 k)n . The inclusion-exclusion formula for the answer
is 10n 3 9n + 3 8n 7n .
10.27. The probability that a bridge hand has no voids. Among the possible
hands, let Ai be the set of hands having a void in the i th suit. We want to
count the hands outside
all of A 1 , A2 , A3 , A4 . The total number of hands
39
.
There
are
hands
in Ai (one specified void guaranteed). There
is 52
13
13
26
are 13 hands in Ai A j (two specified voids guaranteed). There are 13
13
144
10.28. There are 16 natural numbers less than 252 that are relatively prime
to 252. Out of a universe of 252 = 22 32 7 numbers, we want to count those
that do not have 2 or 3 or 7 as a prime factor. Let A 1 , A2 , A3 be the numbers
in [252] that are divisible by 2,3,5, respectively. Since [n ] has exactly bn/kc
numbers divisible by k , the inclusion-exclusion formula allows us to count
the desired numbers by
252
252
252
252
252
252
252
252
+
+
+
= 72.
2
3
7
6
14
21
42
10.29. There are natural numbers less than 200 that have no divisor in
{6, 10, 15}. Since 10 divides 200, we can include 200 in the universe without changing the answer. Out of a universe of 200 numbers, we want to
count those that do not have 6 or 10 or 15 as a factor. Let A 1 , A2 , A3 be
the numbers in [200] that are divisible by 6,10,15, respectively. Since [n ]
has exactly bn/kc numbers divisible by k , the inclusion-exclusion formula
allows us to count the desired numbers by
200
200
200
200
200
200
200
200
+
+
+
= 140.
6
10
15
60
90
150
900
145
Qm
pS
inclusion-exclusion formula,
(m) =
SP(m)
(1)|S| Q
m
pS
=m
X
SP(m) pP(m)S
Y 1
pS
=m
Y
pP(m)
1
p
iS
k)
!.
k
146
A
|
=
,
since
we
distribute 5 to
i
j
51
51
each violated type before considering arbitrary selections with repetition
for the remainder. The
sum by the inclusion-exclusion formula is
resulting
P
N () = 5k=0 (1)k nk n5k+4
.
4
10.35. Pairings of n boys and n girls as lab partners. For each i , the i th
tallest boy must not be matched to the i th tallest girl. Let A i be the set of
pairings that violate this condition.
pairs are allowed, the number of acceptable pairings
Pa) When same-sex
(2n)!
is nk=0 (1)k nk 2(2n2k)!
nk (nk)! . The universe is the set of all 2n n! pairings of 2n
people (with the people in order, arrange labels 1, 1, 2, 2, . . . , n, n to make
pairs, and then divide by n ! becauses the pairs are not labeled). Within
this universe, we count those pairings that avoid A 1 , . . . , An . Pairings that
lie in Ai for all i S in effect exclude 2 |S| people from participation by predetermining their pairs, so the number of ways to complete the pairing is
(2n2k)!
, where k = |S|. This depends only on |S|, so the Inclusion-Exclusion
2nk (nk)!
Principle yields the formula claimed.
b) When
pairs are not allowed, the number of acceptable pairP same-sex
ings is nk=0 (1)k nk (n k)!. The universe is the set of all n ! pairings of
boys with girls. Within this universe, we count those pairings that avoid
A1 , . . . , An . The number of pairings that lie in A i for all i S is (n |S|)!.
This depends only on |S|, so the Inclusion-Exclusion Principle yields the
formula claimed.
10.36. Permutations of two copies each of n types of letters with no consecutive letters the same. Let U be the universe of permutations of these
letters. Let Ai be the set of permutations in which the two letters of the
i th type appear consecutively. We want to count the permutations in none
of these sets. The number of arrangements having k i letters of type i is
147
P
Q
( ki )!/( ki !). Hence |U | = (2n)!/2n . For permutations in Ai , the two
copies of the i th letter must be next to each other (and indistinguishable),
so we can view them as a single letter, and |A i | = (2n 1)!/2n1 . More generally, when we consider the intersection of k of these sets and force k of the
pairs to appear consecutively, the number of arrangements is (2nk)!/2 nk .
This holds for any collection S of k indices from n , and there are nk such subsets
Pof indices. Hence the answer given by the inclusion-exclusion formula
is nk=0 (1)k nk (2n k)!/2nk .
k sets does not depend on which k sets are chosen, always equaling f (k).
For k = 0, the contribution is 2n , which suggests that our universe should
correspond to all subsets of [n ].
The resulting proof is that each side of the equality counts the subsets
of [n ] that contain none of the elements. On the right, we know that there
is exactly one such subset, the empty set. On the left, we define sets A i =
{T T
[n ]: i T } within the universe of all subsets of [n ]. Then the subsets
in iS Ai consist of all subsets of [n ] that contain the elements in S . There
are exactly 2n|S| of these, so the left-side is the inclusion-exclusion sum to
count the subsets of [n ] belonging to none of the sets A i .
Pn
r 1
k n nk+r 1
= n1
. The factor (1)k nk in the summand
10.41.
k=0 (1) k
r
1
suggests an inclusion-exclusion computation. The quantity nk+r
is the
r
number of ways to choose r elements from n k types. Here r remains fixed.
The term k = 0 suggests making the universe be the set of selections of r
elements from n types, with repetition allowed. When we select r elements
from n k types, we are leaving some types unused.
The right side is the number of selections of r elements from n types
in which every type is used at least once. The left side counts the same set
using the Inclusion-Exclusion Principle.
148
149
vertices each, going thrice around the circle. When n is relatively prime to
6, there is a single cycle through all the vertices.
When n = 12, the graph consists of six disjoint edges. When n < 12,
no pairs differ by 6, and the graph consists of n isolated vertices.
11.3. Eulerian with even order and odd size. An Eulerian graph with an
even number of vertices and an odd number of edges can be formed as the
union of an even cycle and an odd cycle that share one vertex.
11.4. If G is a connected non-Eulerian graph, then the minimum number of
trails that together traverse each edge of G exactly once is half the number
of vertices having odd degree. The assumption of connectedness is necessary, because the conclusion is not true for a graph with two components
in which one component is Eulerian.
Suppose G is a connected non-Eulerian graph, so G has 2k vertices
of odd degree for some positive integer k . A trail contributes even degree
to every vertex, except odd degree to its endpoints when they are not the
same vertex. Therefore, a partition of the edges into trails must have some
trail ending at each vertex of odd degree. Since each trail has (at most) two
ends, at least k trails are required. There are several ways to prove that k
trails are always enough.
Proof 1 (using Eulerian circuits). Pair up the vertices of odd degree
in G arbitrarily and form G 0 by adding a copy of each pair as an edge.
The resulting graph G 0 is connected and has even degree at every vertex.
Therefore it has an Eulerian circuit, since the characterization of Eulerian
graphs allows multiple edges. As we traverse the circuit, we start a new
trail in G after each time we traverse an edge of G 0 E(G). This yields k
pairwise edge-disjoint trails partitioning E(G).
Proof 2 (using Eulerian circuits). Form G 0 by adding a new vertex w
and making it adjacent to all vertices of G that have odd degree. The resulting graph G 0 is connected and has even degree at every vertex. Therefore
it has an Eulerian circuit. As we traverse the circuit, we start a new trail
in G after each time we leave w and arrive at a vertex of G . Since w has
degree 2k , the circuit visits it k times, so we obtain k pairwise edge-disjoint
trails partitioning E(G).
Proof 3 (induction on k ). If k = 1, we add an edge between the two odd
vertices, obtain an Eulerian circuit, and delete the added edge to obtain a
single trail covering all edges of G . If k > 1, let P be a path between two
vertices of odd degree. The graph G 0 = G E(P) has 2k 2 vertices with
odd degree since we have changed degree parity only at the ends of P . We
apply the induction hypothesis to each component of G 0 that has vertices
with odd degree. Every component not having vertices of odd degree has
an Eulerian circuit that contains a vertex of P ; we splice it into P to avoid
150
151
the edges x 0 x 1 and y0 y1 yields a spanning cycle of Q d+1 . It traverses all the
vertices of G 0 from x 0 to y0 , then crosses to G 1 , then traverses all vertices
of G 1 ending at x 1 , then returns to x 0 to complete the cycle.
152
x0
x1
y0
y1
11.11. The d -dimensional cube has d2 2d2 4-cycles and d3 2d+1 6-cycles.
Traversing a 4-cycle must change two coordinates and then unchange them.
Thus a 4-cycle is determined by choosing two coordinates to change and
choosing a fixed value in each of the other d 2 coordinates.
Traversing a 6-cycle similarly must change and unchange exactly three
coordinates, since only 4 vertices are available if d 2 coordinates remain
fixed. For each of the d3 2d3 choices for the d 3 fixed coordinates, the
number of ways to complete a 6-cycle is the number of 6-cycles in Q 3 . For
each pair of adjacent vertices and for each pair of complementary vertices
in Q 3 , there is exactly one 6-cycle through the remaining six vertices. The
other types of nonadjacent pairs leave no 6-cycle when deleted. Thus there
are 12+4=16 6-cycles in Q 3 , which completes the computation.
11.12. Isomorphism. Using the correspondence indicated below, the first
two graphs are isomorphic; the graphs are bipartite, with u i v j if and
only if i 6= j . The third graph contains odd cycles and hence is not isomorphic to the others.
u 1
u 2
v v
1 2
v4v3
u 4
u
3
u 1
v3
u 2
v4
u 3
v1
u 4
v2
These are the 3-dimensional cube and the graph obtained by deleting
four disjoint edges from K 4,4 . The vertices of the cube are the binary 3tuples; the parity of a vertex is the number of 1s in the 3-tuple. Each
vertex of the cube is adjacent to every vertex of the opposite parite except
its complement. Since the complement of the complement of a binary list is
the original list, this describes Q 3 as formed by deleting four disjoint edges
from K 4,4 .
153
11.13. G
= H if and only if G
= H . If f is an isomorphism from G to H ,
then f is a vertex bijection preserving adjacency and nonadjacency, and
hence f preserves non-adjacency and adjacency in G and is an isomorphism from G to H . The same argument applies for the converse, since the
complement of G is G .
11.17. Isomorphisms for the Petersen graph. Isomorphism is proved by giving an adjacency-preserving bijection between the vertex sets. For pictorial
representations of graphs, this is equivalent to labeling the two graphs with
the same vertex labels so that the adjacency relation is the same in both
pictures; the labels correspond to a permutation of the rows and columns
of the adjacency matrices to make them identical. There various drawings of the Petersen graph below illustrate its symmetries; the labelings
indicate that these are all the same (unlabeled) graph. The number of
isomorphisms from one graph to another is the same as the number of
isomorphisms from the graph to itself.
154
5 10 6
2
7 1 3
7
8
7
4 5 10
9
8
8
9
6
3
10
4
8
3
9
4
10
5
7
With vertices named as above, the adjacency relation is the same in
via the correeach graph. This represents the disjointness relation on [5]
2
spondence below.
1
2
3
4
5
6
7
8
9
10
{1, 2} {3, 4} {5, 1} {2, 3} {4, 5} {3, 5} {5, 2} {2, 4} {4, 1} {2, 4}
Alternatively, one can name the vertices using four disjoint sets of labels and establish isomorphisms from each graph to the next. Transitivity
of the isomorphism relation then implies that each two graphs chosen from
this set are isomorphic.
n1
11.18. There are exactly 2( 2 ) simple graphs with vertex set v1 , . . . , vn in
which every vertex has even degree.
If we do not care about the degrees of
the vertices, then there are 2n simple graphs, since each pair of vertices
may form an edge or not. Similarly, there are 2C H (n1,2) simple graphs
with vertex set {v1 , . . . , vn1 }. We establish a bijection to that set of graphs.
Given a simple graph G with vertex set {v1 , . . . , vn1 }, we form a new graph
G 0 by adding a vertex vn and making it adjacent to each vertex that has odd
degree in G , as illustrated below. The vertices with odd degree in G have
even degree in G 0 . Also, vn itself has even degree because the number of
vertices of odd degree in G is even. Conversely, deleting the vertex v n from
a graph with vertex set {v1 , . . . , vn } having even vertex degrees produces
a graph with vertex set {v1 , . . . , vn1 }, and this is the inverse of the first
155
11.21. A graph G is connected if and only if for every partition of V (G) into
non-empty sets S, T , there is an edge x y with x S and y T . When G is
connected and S, T is a nontrivial partition, we choose u S and v T .
Since G is connected, G has a u, v -path, and this path must leave S along
some edge x y . When G is not connected, we let S be the vertex set of a
component of G and let T be the remainder of the vertex set; since S is a
component, there is no edge from S to T .
vn
G0
k)
2
.
P
P
ni
n
|X Y | = |X | + |Y | |X Y |
n+k2 n+k2
+
(n 2) = k.
2
2
156
11.22. Measuring k gallons using buckets with integer capacities l > m > n
in gallons. We create vertices for the possible states of our system. Each
vertex is a triple (a, b, c) listing the integer numbers of gallons in the three
buckets. Our initial vertex is (l, 0, 0). Since we are only allowed to pour
from one gallon into another, the sum of the three integers is always l .
The operation of pouring from one bucket into another that already
has some water is not reversible; thus we need directed edges, like those
used in functional digraphs. Directed edges would also allow us to model
the operation of spilling out a bucket, if that were allowed.
Given this directed graph as a model, the problem is to determine
whether it has a path (following directed edges in the forward direction)
from the vertex (l, 0, 0) to a vertex in which k is one of the integers.
11.23. If G is a finite simple graph with minimum degree k , and k 2,
then G contains a path of length at least k and a cycle of length at least
k + 1. Because V (G) is finite, every path in G is finite, so G has a maximal
path P . Let u be an endpoint of P . Because P cannot be extended, every
neighbor of u belongs to P . Since u has at least k neighbors, its neighbor
v that is farthest along P from u is the other end of a path P 0 of length at
least k , and uv completes a cycle of length at least k + 1 with P 0 .
11.25. The
number of edges in an n -vertex triangle-free simple
maximum
graph is n 2 /4 . Suppose G is an n -vertex triangle-free simple graph. Let
157
Proof 2 (induction on n ). A graph with 1 vertex and no edges is connected and has no cycles, so the statement holds for nP
= 1. For the induction
step, suppose n > 1. By the degree-sum formula, vV (G) d(v) = 2n 2,
which is less than 2n . Hence some vertex v has degree less than 2, by the
pigeonhole principle. If G is connected, then this vertex v has degree 1.
Deleting v and its incident edge leaves a graph G 0 with n 1 vertices and
n 2 edges. Since a vertex of degree 1 cannot be an internal vertex on a
path, all paths in G connecting vertices of G 0 remain in G 0 , and hence G 0
is also connected. By the induction hypothesis, G 0 has no cycles. Since a
vertex of degree 1 cannot belong to a cycle, G also has no cycles.
Conversely, suppose G has no cycles. Since G has fewer edges than
vertices, some component H of G has fewer edges than vertices. By the
degree-sum formula, the pigeonhole principle, and the connectedness of H ,
there is a vertex v in H that has degree 1 (in G ). Deleting v and its incident
edge leaves a graph G 0 with n 1 vertices and n 2 edges. Deleting a vertex
cannot create a cycle, so G 0 has no cycles. By the induction hypothesis, G 0
is connected. Since paths to or from the neighbor of v in G can be extended
to become paths to or from v , G is connected. Since G has n vertices and
n 1, the sum of the degrees of
bn/2c
dn/2e
158
11.28. A graph G is a tree if and only if for all x, y V (G), there is exactly
one x, y -path in G . Necessity: If G is a tree, then G is connected and has
an x, y -path. If G has two x, y -paths, let H be their union, and let e be an
edge belonging to only of the paths. By the transitivity of the connection
relation, H e is connected. By Lemma 11.36, e thus belongs to a cycle in
H , which is contained in G . This contradicts the absence of cycles in G .
Sufficiency: The existence of x, y -paths makes G connected, and the
uniqueness of paths forbids cycles, since every pair u, v in a cycle is connected by two paths along the cycle. Thus G must be a tree.
159
Proof 2 (counting two ways). Count the degree sum by edges and by
vertices. By edges, it is 2n 2. Let k be the maximum degree and l the
number of leaves. The remaining vertices must have degree at least two
each, so the degree sum when counted by vertices is at least k + 2(n l
1) + l . The inequality 2n 2 k + 2(n l 1) + 1 simplifies to l k . (Note:
The same idea is used in noting that degree 2(n 1) k remains for the
vertices other than the one of maximum degree. Since all degrees are 1 or
at least 2, there must be at least k vertices of degree 1.)
Proof 3 (induction on the number of vertices). For n 3, we inspect
the unique tree with n vertices. For n > 3, delete a leaf u . If 1(T u) =
1(T ), then by induction T u has at least k vertices, and replacing u adds
a leaf at the expense of at most one leaf from T u . Otherwise 1(T u) =
1(T ) 1, which happens only if the neighbor of u is the only vertex of
maximum degree in T . Now induction guarantees at least k 1 leaves in
T u , and adding u gives another, since the vertex of maximum degree in
T cannot be a leaf in T u (this is the reason for n = 3 in the basis).
a list of n natural numbers satisfying the condition. Since the sum is only
2n 2, the numbers cannot all be at least 2, so there is at least one 1. Also
2n 2 > n , so there must be at least one number greater than 1. Suppose
di = 1 and d j > 1. Form a new list of numbers by deleting di and reducing
d j by 1. This reduces the sum by 2 and produces a set of n 1 natural
numbers summing to 2(n 1) 2. By the induction hypothesis, there is
a tree with these degrees. Find a vertex x with degree d j 1 in such a
tree, and add a new vertex joined only to x . The resulting graph is a tree
(connected and acyclic) with degrees d1 , . . . , dn .
11.30. A connected graph with n vertices has exactly one cycle if and only
if it has exactly n edges. Let G be a connected graph with n vertices.
Necessity: If G has one cycle, then deleting an edge e of that cycle
leaves a connected graph with no cycle. By definition, G e is a tree, and
every tree with n vertices has n 1 edges. Hence G e has n 1 edges and
G has n edges.
Sufficiency: Let G have exactly n edges. If G has no cycles, then by
definition G is a tree and has n 1 edges. Therefore G has at least one cycle.
If G has more than one cycle, then we can find edges e, f such that each
belongs to a cycle that does not contain the other (otherwise, all the cycles
have the same edges). Hence G e f is connected. Continue deleting
edges from cycles until all are gone; at most n 2 edges remain. We now
have an acyclic connected graph with no cycles, since deleting edges on
cycles never disconnects a graph. Such a graph is a tree and hence has
n 1 edges, which is more edges than remain. Hence our assumption that
G has more than one cycle is impossible, and G must have exactly one cycle.
160
161
11.38. The wheel with n vertices has chromatic number 3 when n is odd, 4
when n is even. The cycle with n 1 vertices has chromatic number 2 when
n 1 is even, 3 when n 1 is odd. In every proper coloring, the coloring
used on the remaining vertex of the wheel must be different from all colors
used on the cycle, since it is adjacent to all those vertices, so one additional
color is needed.
11.37. K n,n has n ! perfect matchings and n !(n 1)!/2 cycles of length 2n .
Matchings are pairings of x 1 , . . . , x n with y1 , . . . , yn in some order; thus the
number of matchings is the number of permutations of [n ].
In K n,n , we can list the vertices in order on a cycle (alternating between
the partite sets), in 2(n !)2 ways. Each cycle arises exactly 2n times in this
way, since we obtain the same subgraph no matter where we start the cycle
and no matter which direction we follow.
162
11.39. If G does not have two disjoint odd cycles, then (G) 5. Proof 1
(direct). If G has no odd cycle, then (G) 2, so we may assume that G
has an odd cycle C . If (G V (C)) 3, we have an odd cycle disjoint from
C . Hence (G V (C)) 2, and we can combine this with a 3-coloring of C
to obtain a 5-coloring of G .
Proof 2 (contrapositive). If (G) 6, consider an optimal coloring.
The subgraph induced by vertices colored 1,2,3 coloring must have an odd
cycle, else it would be bipartite and we could replace these three colors
by two. Similarly, the subgraph induced by vertices colored 4,5,6 in the
optimal coloring has an odd cycle, and these two odd cycles are disjoint.
11.40. A graph with maximum degree k has chromatic number at most
k + 1. Such a graph can be colored with k + 1 colors using a greedy
algorithm. Place the vertices in an arbitrary order v1 , . . . , vn . Taking each
vertex in turn, assign it the least-indexed color in {1, . . . , k + 1} that has not
already been used on one of its neighbors. Since it has at most k neighbors,
there is some color left in {1, . . . , k + 1} available to use on it.
Equality holds for the complete graph with k + 1 vertices. Comment:
among connected graphs, complete graphs and odd cycles are the only
graphs where the chromatic number exceeds the maximum degree.
11.41. The segment graph of a collection of lines in the plane with no three
intersecting at a point is 3-colorable. The vertices of G are the points of
intersection of a family of lines; the edges are the segments on the lines
joining two points of intersection. By tilting the picture slightly, we can
insure that no pair of vertices has the same x -coordinate.
Of the neighbors that v has on a single line, one has larger x -coordinate
and one has smaller x -coordinate. Hence if we index V (G) in increasing
order of x -coordinates, each vertex will have at most two earlier neighbors.
Applying the greedy algorithm to this ordering produces a coloring using at
most three colors. Alternatively, if H G , the vertex of H with largest x coordinate has degree at most 2 in H , so (G) 1 + max H G (H ) 3. The
configuration below illustrates that the bound does not hold when more
than two lines are allowed to meet at a point; this configuration can arise
using six lines, and it yields a subgraph with chromatic number 4.
163
164
11.44. A plane graph that is a tree has one face. We use induction on the
number of vertices. With one vertex, every two points other than the point
for the vertex are joined by a segment, except that pairs collinear with
the vertex need a path of two segments. For a tree T with more vertices,
consider two points x, y not in the embedding of T . Deleting a leaf of T and
its incident edge produces a tree T 0 . By the induction hypothesis, there is
a polygonal x, y -path avoiding T 0 . This path also avoids T unless it crosses
the extra edge. Since the path is formed of finitely many segments, it
crosses this edge finitely often. If it crosses the edge more than once, we
can shortcut between two such crossings to reduce the number of crossings
until we have a polygonal x, y -path that crosses T once on this edge and
nowhere else. Now we can cut the path just before and after this crossing
and replace the crossing by a path around the leaf, as suggested below.
11.45. The complement of each simple planar graph with at least 11 vertices is nonplanar. A planar graph with n vertices has at most 3n 6 edges.
Hence each planar graph with 11 vertices has at most 27 edges. Since
K 11 has 55 edges, the complement of each planar subgraph has at least
28 edges and is non-planar. In fact, there is also no planar graph on 9 or
11.46. Every simple planar graph has a vertex of degree at most 5. Theorem
11.65 states that every simple planar graph G with n vertices has at most
3n 6 edges. By the degree-sum formula, the degrees of our graph G thus
sum to at most 6n 12. By the pigeonhole principle, some vertex has degree
at most the average, which equals 6 12/n . Thus some vertex has degree
at most 5.
Every planar graph has chromatic number at most 6. Since multiple
edges do not affect chromatic number, we need only consider simple planar
graphs. We use induction on the number of vertices; every graph with at
most 6 vertices has chromatic number at most 6. When n > 6, we know
that a simple planar graph G with n vertices has a vertex x of degree at
most 5. Let G 0 = G x . Since G 0 is planar, the induction hypothesis implies
that G 0 has chromatic number at most 6. Since at most five of the colors
are used on the neighbors of x , there is some color available to use on x to
extend this to a proper 6-coloring of G .
11.47. A simple n -vertex planar graph with no cycle of length less than k
has at most (n 2)k/(k 2) edges. We may assume that the graph is connected by adding edges if it is not. Thus Eulers Formula applies. Consider
any embedding of the graph in the plane. Each face has at least k edges
on its boundary, and each edge contributes twice to boundaries of faces.
Therefore, counting the appearances of edges in faces grouped according to
the e edges or according to the f faces yields 2e k f .
Since the graph is connected, we can apply Eulers formula, n e + f =
2. Substituting for f in the inequality yields 2e k(2 n + e), which
rearranges to e k(n 2)/(k 2). The formula makes sense also when
k = 2, since the availability of multiple edges means there is no limit on
the total number of edges.
The Petersen graph has 10 vertices, 15 edges, and no cycle of length
less than 5. Since 15 exceeds 5(8)/3, this inequality implies that the Petersen graph is not planar.
11.48. The maximum number of edges in a simple outerplanar graph of
order n is 2n 3. For the lower bound, we provide a construction. A simple
cycle on n vertices together with the chords from one vertex to the n 3
vertices not adjacent to it on the cycle forms an outerplanar graph with
2n 3 edges.
For the upper bound, consider an arbitrary simple outerplanar graph
G . We may assume G is connected, else we can add an edge to join two
components while still having every vertex on the unbounded face F . Now,
since every vertex appears on F , it takes at least n edges to traverse the
165
11.49. There are art galleries with n walls that require bn/3c guards. Three
vertices are used in forming each alcove in the art gallery below. No guard
at one point can see into more than one of them, so at least bn/3c guards
are needed.
166
12.7. Recurrence relations with solution formula an = n 3 . Since the solution has no nontrivial exponential part, we seek a first-order relation of the
form an = an1 + f (n). It suffices to set f (n) = n 3 (n 1)3 = 3n 2 3n + 1.
Every homogeneous constant-coefficient first-order linear recurrence
has the form an = can1 , with general solution Ac n . The constant A cannot
be chosen to make Acn be n 3 .
12.8. Recurrence relation to count the pairings of 2n people. The last person can be paired with 2n 1 others, leaving a smaller instance of the
same problem to complete the arrangement, so an = (2n 1)an1 , is the
recurrence, with a0 = 1 (or a1 = 1).
12.9. If n > 0 and no three circles meet at a point, then n pairwise intersecting circles cut the plane into n 2 n + 2 regions. Let an be the number
of regions in such a configuration with n circles. Suppose n > 1, and consider adding the n th circle to the configuration consisting of the first n 1
circles. The n th circle intersects each earlier circle exactly twice. The
2(n 1) intersection points partition the new circle into 2(n 1) arcs, each
of which cuts an old region into two new regions. Other regions remain
unchanged. Hence an = an1 + 2(n 1) for n 2. This recurrence is not
valid when n = 1; we have the initial condition a1 =P2. The solution of a
n
f (i), so we have
recurrence of the form an = an1 + f (n) is an = a1 + i=2
Pn
Pn1
2
an = 2 + i=1 2(i 1) = 2 + 2 i=0 i = n n + 2.
167
which
the Summation
Identity
can be applied. By
Pn
Pnthe SummationnIdentity,
k1
n
n
n
)
=
+
(k
1
+
.
Thus
a
=
a
+
n
0
k=1
k=1 f (n) = 1 + 2 + 4 .
3
2
4
12.11. Recurrence for savings account. To obtain the next amount, add
$100 at the start of the year and then 5 percent at the end, so an =
1.05(an1 + 100).
To solve the recurrence when a0 = 0, we rewrite it as an = 1.05an1 +
105. The form of the solution is A(1.05)n + b0 , where b0 is a constant. The
recurrence yields b0 = 1.05b0 + 105, and hence b0 = 2100. Satisfying
the initial condition a0 = 0 now requires 0 = A(1.05)0 2100, which yields
A = 2100. Thus the sequence is an = 2100(1.05)n 2100.
12.12. Mortgage: Recurrence for $50,000 mortgage with interest per year
at 5 percent of the unpaid amount, followed by payment of $5,000 to end
the year. If an is the amount outstanding at the end of the n th year, then
an = (1.05)an1 5000, with a0 = 50000 (add 5 percent to the previous
amount and then subtract 5000). Iterating this recurrence by calculator
shows that the payment is completed in the 15th year.
12.13. Bounded regions formed by chords among n points on a circle. Let
an be the number of regions.
Pn1
a) an = an1 + f (n) for n 1, where f (n) = n 1 + i=1
(i 1)(n 1 i),
with initial condition a0 = 1. With no points, there is one region. When
we add an n th point, its chords to the n 1 other points add one region for
each region they cut. As they leave the new point, each is cutting a region
(this can be done successively for the n 1 chords), which accounts for the
term n 1. The other term counts the crossings made by the chords as
they continue; after each crossing, a new region is cut. The chord to the i th
vertex separates i 1 vertices from n 1 i vertices, and thus it cuts the
(i 1)(n 1 i) old chords crossing it.
b) Solution to the recurrence. The summation in the formula for f (n)
is an instance of both Exercise 9.11 and Exercise 5.30 (where the value
of the summand should be (i 1)(n i); the value of the sum is n1
.
3
This can also be computed by rearranging (i 1)(n 1 i) into terms to
168
12.16. The number of ways to park the three types of cars in the lot of length
n satisfies an = an1 + 2an2 , with a0 = 1 and a1 = 1. The last car may be
Type 1 (length 1) or Type 2 (length 2) or Type 3 (length 2). In the first Type,
there are an1 ways to complete the list. In the other two Types, there are
an2 ways to complete the list.
12.17. Domino tilings of two-by-n checkerboard are counted by the Fibonacci numbers. When the n th column is a vertical domino, there are
an1 ways to complete the tiling. Otherwise, it must be filled by two horizontal dominos, and then there are an2 ways to complete the tiling. Thus
an = an1 + an2 . For the initial conditions, a0 = a1 = 1. Combinatorially,
every such tiling consists of units of 1 vertical tile or two horizontal tiles,
which establishes a bijection to the 1,2-lists with sum n .
12.18. Shopkeeper making change. The number of ways that the shopkeeper can make change for n cents is the number of lists of 1s, 5s, and
10s that sum to n . If n > 0, every such list has a last element. The last element can be 1, 5, or 10, and in these three cases the number of ways to
complete the rest of the list is an1 , an5 , or an10 , respectively. Hence we
obtain the recurrence an = an1 + an5 + an10 , with the initial conditions
a0 = 1 (there is one such list that sums to 0, the empty list) and an = 0 for
n < 0. Alternatively, one can compute 10 values in a row to start the list;
starting with n = 0, the values of an are 1, 1, 1, 1, 1, 2, 3, 4, 5, 6.
12.19. Identities for Fibonacci numbers. Let Fn denote the n th Fibonacci
number,
F0 = F1 = 1 and Fn = Fn1 + Fn2 for n 2.
Pwhere
n
a)P i=0
Fi2 = Fn Fn+1 for n 0. Proof by induction on n . For n = 0, we
n
have i=0
Fi2 = F02 = 1 = F0 F1 . For the inductive step, suppose the claim
is true for n , where n 0. Using the induction hypothesis after isolating
the last term of the sum, we have
169
2
Fi2 = Fn+1
+
n
X
i=0
2
Fi2 = Fn+1
+ Fn Fn+1
where the
Pn last step uses the recurrence Fn+2 = Fn+1 + Fn for n 0.
b) i=0
F2i = F2n+1 . For n = 0, both sides equal 1. For the induction
Pn1
Pn
F2i = i=0
F2i . Note that the inducstep, F2n+1 = F2n + F2n1 = F2n + i=0
tion hypothesis is used only for one preceding value.
P2n1
(1)i F2ni = F2n1 .
c) i=0
12.20. Bijection from the set of 1,2-lists that sum to n to the set of 0,1-lists
of length n 1 that have no consecutive 1s. Since the n units of the sum
become n 1 binary positions, we want each 1 or 2 in the sum to contribute
0 or 1 bits, except that one bit will be lost. Convert each 1 to a 0 and
each 2 to a 10, and drop the last bit, which is always a 0 and provides no
information. The 0 following each 1 ensures that there are no consecutive
1s, the length is as desired, and the process is reversible.
Pn
12.21. For the Fibonacci numbers, 1 + i=0
Fi = Fn+2 .
Proof
1
(induction
on
n
).
Since
F
=
1 and F2 = 2, we have 1 +
0
P0
F
=
1
+
1
=
2
=
F
,
so
the
claim
holds
for n = 0. For the induction
i
2
i=0
Pn
Pn1
Fi ) + Fn = 1 +
step, suppose n > 0. We compute 1 + i=0 Fi = 1 + ( i=0
Fn+1 + Fn = 1 + Fn+2 . In the induction step, we only use the induction
Pn1
hypothesis i=0
Fi = Fn+1 for the one most recent value of the induction
parameter. Also the Fibonacci recurrence Fn+1 + Fn is valid for all n 0.
Hence the proof of the induction step is valid for n 1, and we need only
check one value in the basis step.
Proof 2 (combinatorial argument). The right side of the identity
counts lists of 1s and 2s that sum to n + 2. One such list has no 2s;
let that be the list counted by the isolated 1 on the left side. The other lists
have at most n 1s. The number of lists having n i 1s after their last 2 is
the number of lists that sum to i in the portion before that 2, which is Fi .
Summing over all choices for i counts the lists that have a 2.
Pn ni
.
12.22. For the Fibonacci numbers, Fn = i=0
i
i
>
n
i
,
the binomial coefficient
Proof 1 (induction on n ). When
P
is 0, so we can write the sum as i0 ni
without
changing it. When
i
n is 0 or 1, the sum has one nonzero term equal to 1 and the formula
holds. For the induction step, suppose n > 1. We use the recurrence for
Fn , the induction hypothesis
giving
the formula for Fn1 and Fn2 , and the
m1
recurrence relation mk = m1
+
for the binomial coefficients. The
k
k1
resulting computation is
Fn = Fn1 + Fn2 =
170
X n 1 i
i
i0
X n 2 i
i
i0
X n 1 i
n1
n1i
=
+
+
i
i 1
0
i1
i1
X
X
ni
ni
n
+
=
=
.
0
i
i
i1
X
i0
By the induction hypothesis, both terms on the right are divisible by Fn1 ,
so Fn1 also divides their sum.
12.24. Every natural number can be written as a sum of distinct Fibonacci
numbers. Every natural number can be expressed as a sum of distinct
powers of 2. More generally, if {an } is a increasing sequence of natural
numbers such that a1 = 1 and an 2an1 for n > 1, then every natural number can be expressed as a sum of distinct terms. The Fibonacci
numbers for n 1 have this property, since Fn1 < Fn1 + Fn2 = Fn and
Fn = Fn1 + Fn2 < 2 Fn1 .
To prove the general statement, note first that an increasing sequence
of natural numbers is unbounded, since any potential bound M N is
exceeded after at most M elements of the sequence. Hence for any natural
number n there is a largest index k such that ak n . We now prove by
strong induction on n that any n N can be expressed as a sum of distinct
ai s. Since a1 = 1, the number 1 can be expressed. Now assume that n > 1
and numbers less than n can be expressed as a sum of distinct ai s. Let k be
the largest index such that ak n . Since n < ak+1 2ak , we have 2ak > n .
This means n ak < ak n . By the strong induction hypothesis, we know
that n ak can be expressed as a sum of distinct values in the sequence.
171
only one step. The pairs taking two steps are (3, 2), (5, 2), and (4, 3), with
(3, 2) (2, 1) (1, 0), (5, 2) (2, 1) (1, 0), and (4, 3) (3, 1) (1, 0).
Induction step: we prove the claim for k = n + 1, assuming that it holds
for k = n and k = n 1. If the algorithm takes n + 1 steps on the pair (a0 , a1 ),
then it takes n steps on (a1 , a2 ) and n 1 steps on (a2 , a3 ). By the induction
hypothesis, a1 + a2 Fn+2 and a2 + a3 Fn+1 . Hence (a1 + a2 ) + (a2 + a3 )
Fn+3 . It suffices to prove that a0 a1 + a2 and a1 a2 + a3 . The reason for
this is that when the Euclidean algorithm replaces (ai1 , ai ) with (ai , ai+1 ),
the numbers satisfy ai1 = kai + ai+1 , where ai+1 < ai . This requires k 1,
and hence ai1 ai + ai+1 . This completes the proof by induction.
To prove that the bound on a0 + a1 is best possible, it suffices to construct an example (a0 , a1 ) taking k steps whose sum is only Fk+2 . Let
(a0 , a1 ) = (Fk+1 , Fk ). These numbers have the desired sum. To show that
the pair takes the proper number of steps, note that (Fk+1 , Fk ) moves to
(Fk , Fk1 ) in the first step. Hence we need only verify that (F3 , F2 ) = (3, 2)
takes two steps, which we checked in the basis step.
1 1 + 5 n+1
1 1 5 n+1
Fn = (
)
(
)
2
2
5
5
b) By the generating function method. Multiplying the recurrence
by
P
x n and summing over the region of validity (n 2) yields n2 Fn x n =
P
P
P
x n2 Fn1 x n1 + x 2 n2 Fn2 x n2 . Letting F(x) = n0 Fn x n , we rewrite
the equation as F(x) 1 x = x(F(x) 1) + x 2 F(x). Solving for F(x) yields
F(x) = 1/(1 x x 2 ).
2
The
denominator 1 x x factors as (1 x)(1 x), where =
(1 + 5)/2 and = (1 5)/2. Using partial fractions, we write F(x) =
A
B
+ 1x
. Clearing fractions yields 1 = A(1 x) + B(1 x). Equating
1x
yields 1 = A + B and 0 = A B . Thus
corresponding
coefficients of x
172
173
Q
as p(x) = ri=1 (x i )di for P
distinct 1 , . . . , r , then the solution of the recurrence has the form an = ri=1 qi (n)in , where each qi is a polynomial of
degree less than di . The k coefficients of these polynomials are determined
by the initial values.
A direct proof without the generating function method uses differentiation of the characteristic polynomial (which we do not introduce until
Chapter 16) and linear independence of sequences. To avoid these, we
use the generating function method discussed in this chapter. Indeed, this
solution is sketched in ApplicationP12.37.
k
Let the recurrence be an =
that the chari=1 ci ani for n k , so
Pk
k
acteristic
polynomial is also expressed as p(x) = x i=1 ci x ki . Let
P
A(x) = n=0 ; this is the (formal power series) generating function for the
sequence hai. We show first that A(x) = r (x)/ p(x) for some polynomial r of
P
j
degree less than k . Let C i (x) = k1i
j=0 a j x for 0 i k (with C k (x) = 0).
n
When the recurrence
P is multiplied by x and summed over n k , the term
ci ani becomes ci nk ani x n . After extracting x i , the summation is the
expansion of A(x), missing the terms before x ki that form Ci (x). Thus
A(x) C 0 (x) =
k
X
i=1
ci x i [ A(x) Ci (x)].
174
(c1 + )C n1 + (c2 c1 )C n2 c2 C n3
= C n + C c1 n1 c1 n2 + c2 n2 c2 n3 = C n
12.33. Algorithm for finding the largest and smallest in a set of n numbers.
If n = 2, compare the two numbers. If n > 2, find the largest and smallest
in sets of sizes bn/2c and dn/2e (recursively), and compare the largests and
the smallests in these sets.
Letting an denote the number of comparisons made for a set of size n ,
we have an = adn/2e + abn/2c + 2 for n 4, with a1 = 0, a2 = 1, and a3 = 3.
When n = 2k , let bk = an . We obtain bk = 2bk1 + 2 for k 2, with
b1 = 1. To solve this recurrence, the particular solution C is found by C =
2C + 2, yielding C = 2, and the general solution is bk = A2k 2. Since
b1 = 1, we have bk = (3/2)2k 2. In terms of n , this yields an = (3/2)n 2.
175
12.38. A bijection from the set of parenthesizations of n + 1 distinct elements to the set of triangulations of a convex n + 2-gon, as suggested by the
figure below. Choose one edge of the (n + 2)-gon as a root, and associate
the n + 1 distinct elements with the other edges, in order. From a parenthesization, we obtain a triangulation. Write the parenthesization on the
root edge. The outermost pairing combines some parenthesization of the
first k elements with some parenthesization of the last n + 1 k , for some
k . Create a triangle using edges from the root edge to the vertex at the
end of the edge for the k th element. Write the parenthesization of the first
k elements on the chord cutting those edges off, and write the parenthesization of the last n + 1 k elements on the other chord. We now have a
(k + 1)-gon for the first group and an (n + 2 k)-gon for the second group.
Proceed recursively by the same method to produce the triangulations in
those polygons.
= n!
Pn1
k=0
(1)k
k!
+ n ! (1)
= n!
n!
Pn
k=0
(1)k
k!
176
b bc
(bc)(de)
de
a((bc)(de))
177
12.40. Catalan numbers count piles of pennies. When the base has length
n , let k be the largest initial number of pennies above which the next row
is occupied; k = 4 in the illustration. the illustration. the illustration. the
illustration. the illustration. To complete such a pile, we complete above
the inital base of length k 1 in row 2 and above the remaining base of
length
Pn k in the base row. Thus the recurrence for the number of piles is
an = nk=1 ak1 ank . There is one pile with a base of no pennies. Thus the
solution is the Catalan numbers.
Pn1
a) an = an1 + i=0
ai for n 2, where a0 = a1 = 1. Let x 1 , . . . , x n be the
vertices of the path in order, and let z be the vertex off the path. There are
an1 spanning trees not using the edge zx n ; they combine the edge x n1 x n
with a spanning tree of K 1 Pn1 . Among trees containing zx n , let i be the
highest index such that all of the path x i+1 , . . . , x n appears in the tree. For
each i , there are ai such trees, since the specified edges are combined with
a spanning tree of K 1 Pi . The term 1 corresponds to i = 0; here the entire
tree is Pn zx n . This exhausts all spanning trees.
b) an = 3an1 an2 for n 3. We dispose of the summation by subtracting one instance of the recurrence formula from the next. For n 3,
Pn2
Pn1
we subtract an1 = an2 + i=0
ai from an = an1 + i=0
ai to obtain
an an1 = an1 an2 an1 , which yields the desired recurrence.
178
12.44. For the graph G n with 2n vertices and 3n 2 edges pictured below,
the chromatic polynomial is
(G n ; k) = (k 2 3k + 3)n1 k(k 1).
Proof 1 (induction on n ). Since G 1 is a 2-vertex tree, (G 1 ; k) = k(k
1). For n > 1, let u n , vn be the two rightmost vertices of G n . The proper
colorings of G n are obtained from proper colorings of G n1 by assigning
colors also to u n and vn . Each proper coloring f of G n1 satisfies f (u n1 ) 6=
f (vn1 ). Thus each such f extends to the same number of colorings of G n .
There are (k 1)2 ways to specify f (u n ) and f (vn ) so that f (u n ) 6=
f (u n1 ) and f (vn ) 6= f (vn1 ). Of these extensions, k 2 give u n and vn the
same color, and we delete them. Since (k 1)2 (k 2) = k 2 3k + 3, the
induction hypothesis yields
(G n ; k) = (G n u n vn ; k) (G n u n vn ; k)
179
P
Letting A(x) = n0 an x n , we obtain A(x) a0 a1 x = c1 x [ A(x) a0 ] +
1 c1 a0 )x+a0
c2 x 2 A(x). Solving for A(x) yields A(x) = (a1c
2 .
1 xc2 x
n
Y
1 1/2
1
2n
n+1
n+1
(4)
Cn =
=
(2)
( i)
2 n+1
(n + 1)!
2
i=0
Qn
Qn
n
1
1
2n
2 n Y
i=1 (2i 1)
i=1 (2i)
Q
=
(2i 1) =
=
n
(n + 1)!
n+1
n!
n+1 n
i=1 i
i=0
12.48. Direct combinatorial deriviation of the Fibonacci generating function. We enumerate the 1,2-lists, with the coefficient of x n counting the
lists with sum n . At each position in the list, we can choose 1 or 2, with
the exponent recording the contribution to the sum. Hence our factor for
each position is x 1 + x 2 . When we form lists of length k , the generating
2 k
function is (x
we allow lists of all lengths, the full generating
P+ x ) . Since
function is k0 (x + x 2 )k . This is a formal geometric series, and the sum
is 1/(1 (x + x 2 )), which is 1/(1 x x 2 ).
12.49. If hai satisfies the recurrence an = c1 an1 +c2 an2 , with initial values
1 c1 a0 )x+a0
a0 , a1 , then the generating function for hai is (a1c
2 .
1 xc2 x
n
Multiplying the recurrence
by
x
and
then
summing
over
P
P
Pthe region of
validity (n 2) yields n2 an x n = c1 x n2 an1 x n1 + c2 x 2 n2 an2 x n2 .
180
12.50. Generating function for selections from five types of coins with between 2 and 6 coins of each type. For each type of coin, we make a choice,
independently. We model this choice with x 2 + x 3 + x 4 + x 5 + x 6 . The generating function for the full problem is the fifth power of this, one factor
for each type of coin. The number of such selections with n coins is the
coefficient of x n in (x 2 + x 6 )5 .
Pn
n 2
= 2n
by generating functions. Consider
12.51. Proof of
k=0
k
n
Pn
n
n
.
This
equals
the
left
side
and is the coefficient of x n in the
k=0 k nk
P
P
n k
n l
product of k0 k x and l0 l x . Thus the sum is the coefficient of x n
in (1 + x)n (1 + x)n . This coefficient is 2n
.
n
12.52. Proofs of
convolution identities using generating functions.
Pk m n
a) i=0
= m+n
. The left side is the coefficient of x k in the
i ki
k
P
P
product of the generating functions r 0 mr x r and r 0 nr x r . Since these
generating functions are (1 + x)m and (1 + x)n , the product is (1 + x)m+n .
The right side is indeed
coefficient
of x k in the product.
them+n+1
Pn
m+k nk
b) k=m r
= r +s+1 . Shifting the index of summation on the
s
Pm+n k m+nk
. This is now the coefficient of x m+n in the product
left yields k=0
r
s
P
P
of the generating functions j0 rj x j and j0 sj x j . We discard zeros and
j
j
P
P
P
j
j
j+r
j
r
x .
then shift the index to obtain
j0 r x =
jr r x = x
j0
r
r
(r +1)
as this generating function. SimTheorem
now yields x (1 x)
P 12.35
ilarly, j0 sj x j = x s (1 x)(s+1) . Hence the product is x r +s (1 x)(r +s+2) .
j+r +s12.35, the expansion of thism+ngenerating function is
P Byj+rTheorem
+s+1
x
. To obtain the coefficient of x
, we set j = m+nr s
j0
r +s+1
m+n+1
in the summand and extract the coefficient r +s+1 , as desired.
Pk m+ki1 n+i1
= m+n+k1
. We rewrite the identity as
c)
i=0
ki
i
k
Pk i+n1 ki+m1
k+m+n1
= m+n1 . The left side is the coefficient of x k in
i=0 n1
m1
r
r
P
P
x and r 0 r +n1
x .
the product of the generating functions r 0 r +m1
m1
n1
By Theorem 12.35, these generating functions are (1 x)m and (1 x)n .
The product is (1 x) (m+n) . By Theorem 12.35, the coefficient of x k in its
expansion is k+m+n1
, as desired.
m+n1
12.53.
Generating function for summingP
initial terms. The expression b n =
Pn
n
we
have
b
=
n
k=0 ak is a convolution;
k=0 ak 1. Hence the generating
P
function B(x) = n0 bn x n is the product of the generating functions A(x) =
P
P
n
1
= 1 x n . Thus B(x) = A(x)/(1 x).
n0 an x and (1 x)
181
12.54. The generating function for repeated rolls of a six-sided die by total
xx 7
outcome is 12x+x
7 . When the die is rolled r times, the generating function
P6
i r
is ( i=1 x ) . Since r may be any natural number, we sum over these possibilities. The result is a geometric series missing its initial term. This
simplifies as below:
X 1 x 6 r
x
=
1x
r 1
1
1x
1x 6
1x
1=
1x
1
1 x x(1 x 6 )
(1 x) (1 2x + x 7 )
x x7
=
1 2x + x 7
1 2x + x 7
182