SlideShare a Scribd company logo
| Chapter 1: Combinatorial Arguments
1. COMBINATORIAL
ARGUMENTS
©Douglas B. West
1.1. CLASSICAL MODELS
1.1.1. When rolling n dice, the probability that the sum is even is 1/2. No
matter what is rolled on thefirst n — 1 dice, the last die has three even
values and three odd values, so in each case the probability of ending with
an even total is 1/2.
1.1.2. There are (’})(5) rectangles with positive area formed by segments in
a grid ofm horizontallines and n vertical lines. Positive area requires two
distinct horizontal boundaries and two distinct vertical boundaries.
1.1.3. There are (""°)2175s words consisting of r consonants and s vowels.
There are ("**) ways to allocate the positions to consonants and vowels
and then 21”5* waystofill those positions.
1.1.4. There are (2) outcomesofan election with 30 voters and four candi-
dates, (°°) — 4(7,') with no candidate having more than halfof the votes. If
the votes are considered distinct, then there are 4°° outcomes. However,
votes go into a ballot box, so an outcomeis determined just by the num-
ber of votes for each candidate. Thus we want the numberofnonnegative
integer solutions to x1 + x2 + x3 + x4 = 30, whichis (°"7*").
Whenone candidate receives at least 16 votes, the outcomes are the
ways to distribute the remaining 14 votes arbitrarily, since votes arein-
distinguishable. Only one candidate can have a majority, but that can be
any one of the four, so there are 4(7,') outcomes we exclude.
1.1.5. For n €N, the expression (n° — 5n? + 4n)/120 is a integer. Since
n®—5n?+4n = n(n?—1)(n? —4) = (n+2)(n+1)n(n—-1)(n—2), the expression
equals ("!*), which is the numberof wasto choosefive objects from a set
of size n + 2. This by definition is an integer.
1.1.6. 13!40! orderings ofa deck ofcards such that the spade suit appears
consecutively. There are 13! ways to order the spade suit and 39! ways to
Contact me in order to access the whole complete document.
WhatsApp: https://wa.me/message/2H3BV2L5TTSUF1
Email: smtb98@gmail.com
Telegram: https://t.me/solutionmanual
s
m
t
b
9
8
@
g
m
a
i
l
.
c
o
m
s
m
t
b
9
8
@
g
m
a
i
l
.
c
o
m
complete document is available on https://unihelp.xyz/ *** contact me if site not loaded
Section 1.1: Classical Models 2
order the remaining cards. There are then 40 waysto insert the ordered
spade suit among the other cards. Alternatively, condense the spadesuit
to a single item, order the items in 40! ways, and the expand the spade
into 13! orderings of the spadesuit.
1.1.7. The probability of having at least three cards with the same rank in
a set offive ordinary cardsis aw: Amongfive cards, only one rank can
appearat least three times; pick it in 13 ways. Whenall four cards ofthis
rank appear, there are 48 ways to pick the remaining card. When only
three appear, there are four waysto pick the missing suit ofthis rank and
(4) waysto pick the other two cards. Hence there are 13-48-(1+4-47/2)
suitable sets of five cards. The desired probability is the ratio of this to
(°*). Canceling factors in 434895120 yields the claimed probability.
1.1.8. From a standard 52-card deck, There are 13+ - 304 sets of six cards
having at least one card in every suit. We may have three cardsin one suit
and one in each otherin 4: (3138 ways. We mayhave two cards in each
of two suits and one card in the other twoin (2)(23)°182 ways. These are
the only choices; we sum them.
1.1.9. There are 10:9-8-142 integers from 0 to 99 , 999 in which each digit
appears at most twice (counting leading Os as appearances. Consider cases
by how manydifferent digits are used. There are 10,5) integers usingfive
digits. There are 10(>) 93) integers using four digits; first pick and place
the repeated digit. When three digits are used, two are used twice; hence
the numberof integers of this type is 10:5-9- (5) -8. Summing the three
cases yields the answer.
1.1.10. There are 11 ( ) (*) distinguishable ways to orderthe letters of“Mis-
sissippi’. Choosing positions for the types of letters in stages, always the
number of ways to do the next stage does not depend on how the previous
stages were done. We place “M”in 11 ways, then choosefour positionsfor
“i” among the remaining 10 in ( ) ways, then choose four positions for
“9 6 ae)
s” among the remaining6 in (7) ways, the put “p” in the remaining two
positions. The rule of product then yields the answer.
1.1.11. From four colors ofmarbles, there are (3) distinguishable ways to
have 12 marbles. There are 4!” ways to have 12 ofthe marbles in a row. For
distinguishable selections with repetition, we use the multiset formula:
(en*). The numberof ways to arrange a multiset depends on the num-
ber of elements of each type. However, when weput the elements in a row
we are just making words: each position may have one of the four types,
and all such wordsare distinguishable.
3 Chapter 1: Combinatorial Arguments
1.1.12. If each New York City resident has a jar of 100 coins chosen from
five types, then some two residents have equivalent jars. The numberof
distinguishable jars of coins is the numberof multisets of size 100 from
five types. Using the formula ary for selections of k elements from n
types, the value is on , which equals 4,598,126. Without being precise,
cancelling factors yields 13-103-34-101, whichis clearly less than 5-10°.
Since New York City has more than 7- 10° residents, the claim follows.
1.1.13. When k is even, there are 2*/2-! compositions of k with every part
even (there are none when k is odd). Halving each part yields a composition
of k/2, and the mapis reversible. There are 2”! compositionsofn.
1.1.14. Families ofsubsets.
a) There are 2” — 2!"/2! subsets of [n] that contain at least one odd num-
ber. There are 2” subsetsof [n]. Among these,2!”/2! subsets are restricted
to the set of even numbers. The remainder have at least one odd number.
b) There are (”{*') k-elementsubsets of [n] that have no two consecu-
tive integers.
Proof 1. When choosing k elements, the remaining n — k mustdis-
tribute among them to have at least one between each successive pair
of chosen elements. Knowing how manygo in each slot determines the
k elements selected. Hence the legal choices correspond to solutions to
Xo $xXy +--+: +x, = n—k such that x,,...,x4_1 are positive and xo, xz
are nonnegative. Subtracting 1 from the variables required to be posi-
tive transforms these into nonnegative integer solutions ofyo +:::+y,% =
n—2k+1. By the selections with repetition model, the numberof solu-
tionsis ("7At1***1"1) which simplifies to (”"{*").
Proof 2. View the n—k unchosenintegers as dots in arow. We choose
places for the selected integers between the dots (and on the ends), but
avoidance of consecutive integers requires that no spaceis selected twice.
We have n—k+1 allowable places and choose k ofthem for bars. The bars
now mark thepositions of k selected numbers.
c) There are n! choices of subsets Ag, A, ...An of [n] such that Ap C
A; C-:-C A,. There are (n + 2)” choices such that Ap GC Ay C--: C Ap.
Whenthesets have distinct sizes, we have |A;| = 7, since all the sizes are
between 0 and n. Hence Ag = @, and the elementsof [n] are added one by
one in some order. The n! possible orders correspond to the chains.
To determinea chain of the second type, it suffices to specify for each
x € [n] the index i such that x first appears in the chain at A;. Not ap-
pearing at all is also an option. Hence there are n + 2 choices available
for each x, and the choice made for x is not restricted by the choices made
for other elements.
Section 1.1: Classical Models 4
1.1.15. The exponent on a primep in the prime factorization of (*”) is the
number ofpowers p* of p such that | 2n/p*| is odd. We use the formula
‘ai Gry In m!, | m/p| factors are divisible by p. In | m/p?| of these,
we have an extra factor of p. In | m/p°| , we have yet anotherfactorofp,
and so on. Hence the highest powerofp that divides m! is }),., | m/p*| ,
When | 2n/p* | is even, the numberof multiples ofp* in [2n] is twice
the numberin [n]; for example | 10/2| = 4, and | 5/2| = 2. When | 2n/p*|
is odd, we get one extra: | 6/2| = 8, but | 3/2| = 1. The latter case occurs
if and only if the remainderof n upon division by p* is at least p*/2.
Sincethe factorsofp in the factorization of n! are used (twice) to can-
cel factors ofp in the factorization of (2n)!, we thus find that (2n)! keeps
an extra factor of p for each k where | 2n/p*| is odd.
Prime factorsof (‘5) and ({}). A prime p will be a factorif | 2n/p*| is
odd for some k. We have | 18/2| = 9 and | 20/4| = 5, so 2 divides both.
Since | 18/3| = | 20/3] = 6 and | 18/9| = |20/9| = 2, 3 divides neither.
For higher primes, the squares are too big to give a nonzero contri-
bution. We have | 18/5| = 3 but | 20/5| = 4, so 5 divides () but not (79).
Since | 18/7| = | 20/7| = 2, 7 divides neither. However, 11, 13, and 17
yield 1 in each case, as does 19 in the latter case. Hence the primedivisors
of (j) are {2,5,11, 13,17}, and thoseof(7) are {2,11,13,17, 19}.
1.1.16. Given v(a, b) = ((,7,)- (3). (451)), there do not exist distinct pairs
(a, b) and (c, d) ofpositive integers such that v(c, d) is a multiple of v(a, b).
Suppose u(c, d) = xv(a, b). We have (5) = x(%), and then
d c_( ¢ _,f @ )L, b a | b c
c-d+1d}) d-1) “b-1) “~“a-b+1b) a-b+i1d
c—df(c [ ec _,( 2 _ 2-6 a a-b[c
d+1d) d+1) “b+1) “b+1b) b+1d
Thus (a -—b+1)d = (c—d+1)b and (6+ 1)(c —d) = (d + 1)(a— b). The
difference of these two equations yields d—a+b = b—c+d, and hence a =
c. Now,since (,°,) = #2(¢) and (,°,) = $4(5), and the ratiosof($) to (5)
and (71) to (464) are the same, we have a” = a | Thus (d + 1)(a — b) =
(6+ 1)(e—d) =(b+1)(a—d). We obtain (a + 1)(d — b) = 0, so alsod = b.
1.1.17. There are (%;)(";")lists of m 1s and n 0s having k runsof1s.
Proof1 (case analysis). The numberofruns of0s may be k — 1 (start
and end with 1s), k + 1 (start and end with Os), or k (two cases, starting
with Os or with 1s). In each of these four cases, forming compositions of
m and n with the right numberof parts completely specifies thelist.
5 Chapter 1: Combinatorial Arguments
For the 1s, we have (1) compositions of m with k parts. For the 0s,
the factor is (7-3) or ("2") or (775), the last in two cases. Summing these
and applying Pascal’s Formula three timesyields (7;)("z").
Proof 2 (direct arguments). After forming a composition with k
parts in (71) ways for the 1s, these k nonempty runs are put inton+1
possible locations among the Os (or at the ends). Runsof 1s go into dis-
tinct locations amongthe 0s, so there are (";) ways to place them. [One
can also place the 0s, with repetition allowed, among the runsof Is, en-
suring that the k — 1 interior locations are nonempty. The numberof
ways is then the numberof multisets of size n —k+1 from k + types.|
1.1.18. Runs in subsets.
n+1
a) The numberof subsets of [n] with k runs is ( Ok ). The runs ina
subset correspondto runsof 1s in the incidence vector, separated by runs
of Os. We can specify the runs by inserting a bar before and after each
run, separating it from the neighboring positions. Since thereis at least
one 0 between two runsof 1s in the incidence vector, the bars are placed
in distinct positions. The allowable positions are between entries of the
incidencevector, plus at the beginning or end. To specify k runs, we pick
2k of these n + 1 positions, so the answeris ("3,').
Comment: Thereis also an analysis that considers cases depending
on whetherthefirst and/or last element is used or not. The cases yield
binomialcoefficients that combine to ("3,') by Pascal’s Formula.
b) The numberof t-element subsets of [n] with k runsis(Maen| Garena»
Determining the length of each run and the distances between runsde-
termines the subset. Again consider the 2k bars specifying the runs;
this time we must distribute ¢t positions within the runs and n — t out-
side them. By adding positions 0 and n+ 1 as extra positions before the
first run andafter the last, we guarantee k+1 nonemptybins outside the
runs and have two composition problems. We need a composition of t with
k parts to specify the lengths of the runs and a composition of n + 2 —t
with k + 1 parts to specify the locations of the runs. Thereare (;_;) of
n+2-t-1
k+1-1
c) The numberoft-element subsets of[n] having exactly r; runs oflength
s; for 1 <i<m,wherek =o", ri, and t =)", risi, is meap): Now
we are given the lengths of the runs of 1s. To form the incidence vector,
we permute them and position them. There are again k runs with total
length t, so the factor (rr) for separating the runs of 1s remains. The
runs can come in any order. However, all r;! ways of ordering the r; runs
of length i produce the same subsetof [n] (we assume that s;,..., Sm are
distinct). Thus there are k!/[];", ri! ways to order the runsof1s.
the former and ( ) of the latter, and we choose them independently.
Section 1.1: Classical Models 6
1.1.19. The numberof binary strings of length n in which the number of
copies of 00 is the same as the numberof copies of 11 is 2 when n = 1 and
is 2(p71) when n > 1. For n= 1, both strings are counted.
Consider n > 1. Let a and b be the numberof Os and numberof |1s,
respectively. If there are i runs of 0 and j runs of 1, then there are a —i
copies of 00 and 6 — j copies of 11.
If the first and last bits differ, then i = 7, and the desired condition
holds if and only if a = b, which requires n even. If the first and last
bits are 0, then i = 7 +1, and we need a = 6+ 1, which requires n odd.
Similarly, we need a+ 1 = b and n odd whenthefirst and last bits are 1.
The needed property of the first and last bits holds in two ways. Af-
ter ensuring this, the needed condition on a and is satisfied in (22/2)
n-
(n-1
2(n)2]) in both cases. The formula is not valid when n = 1 because the
first and last bits are the same.
strings when n is even and in ( 52) when n is odd. Thus the answeris
1.1.20. The numberofelements of |3]|" with k odd entries having no 1 next
toa3 is >x5 (ret) (1)24. Let j be the numberof runsof odd entries.
Each runis all-1 or all-3, independently, since any two successive runs
of odd entries are separated by at least one 2. With k odd entries in j
runs, the run lengths of odd entries form a composition of k with j parts.
Hence there are (“772 ways to form the sublist of odd entries.
Altogether there are n—k copies of 2. These are distributed into j7+1
buckets, andall but thefirst and last must be nonempty(the list may or
may not start or end with a 2). Hence there are (7) waysto distribute
the copiesof 2.
Summingover the possibilities for 7 completes the proof.
1.1.21. Inside a convex n-gon, (1) pairs ofchords cross.
Proof 1 (brute force). Let a, be the answer. Let v;,...,0Un be the
vertices in order. The vertices v,,...,U,_1 forma convex (n — 1)-gon, and
within it a,_; pairs of chords cross. To this we add the crossings involv-
ing chords at v,. The chord from v, to vg crosses (k — 1)(n — k — 1) other
chords, so a, = Qn-1 + ok —1)(n-—k- 1). With a3 = 0, we have
an=>4 ar(k —1)(r7 —-k—1). Proof by induction after guessing the
answerfrom data, or application of identities from Section 1.2, may lead
you to the answer (").
Proof 2 (combinatorial understanding). Each crossing involves two
chords. Those two chords involve four endpoints. Thus every crossingcor-
respondsto four points on the n-gon. Furthermore,each set offour points
on the n-gonis the set of endpoints for exactly one pair of crossing chords.
Hence the numberofcrossingpairsis(7).
7 Chapter 1: Combinatorial Arguments
1.1.22. If no three chords have a common internal point in the picture
formed by drawingall (5) chords ofa convex n-gon, then the numberoftri-
angles is (3) + 4(7) + 5(Z) + (%). We count the triangles according to how
many corners lie on the boundary of the n-gon. A triangle with three
boundary cornersis determined by choosing three vertices of the n-gon.
A triangle with two boundary cornershas a full chord as oneside,
and the other two sides extend to form full chords. The endpoints of these
three chords are four points on the boundary. Hence such triangleis
associated with four vertices of the n-gon, chosen in (7) ways. On the
other hand, each choice of four vertices yields four such triangles.
A triangle with one boundary corner is determined by two chords
from that point and one chord that crosses both of them. This leads to
five vertices on the boundary. Each choice of five vertices determinesfive
triangles in this way, so the numberof triangles of this type is 5(Z).
A triangle with no boundary cornersis determined by three chords
with nocommon endpoints, obtained by extending the sides. Thussix ver-
tices must be chosen from the boundary to draw the chords. Each choice
of six yields exactly one such triangle, with opposite pairs formingpair-
wise crossing chords.
Dee ye
Comment: Other ways to group and count the triangles produce more
complicated formulas, which can be simplified to that above via identi-
ties. Having obtained a simple formula, one seeks a simple proof....
1.1.23. Rolling dice. Six dice each have three red faces, two green faces,
and one blue face. The probability that three red faces, two green faces,
and one blue face will show whenall six are rolled is 5/36.
The six dice are objects; each shows some face. The numberofar-
rangements of RRRGGBis ($)(;), which equals 60. Each has probability
(3)3(2)?(4)' ofoccurring. Hencethe desired probability is 60-(27-4-1)/6°.
1.1.24. In poker, a straight is more likely than a flush. The numberofsets
of five cards from onesuit is 4(’?). For the numberofsetsoffive cards
with consecutive values, the lowest value can be any numberfrom 1 to 10
(an ace can be considered high or low). Hence there are 10 - 4° such sets.
After canceling commonfactors, the ratio of the numberof straights to
numberofflushes simplifies to #2#?%, which is about 1.989.
1.1.25. The numberof trapezoids defined by vertices of a regular n-gon is
n("")?)if n is odd and (n — 8)("4”) if n is even. It suffices to count the
Section 1.1: Classical Models 8
pairs of parallel chords. Chords are parallel to a side or (when n is even)
perpendicular to a diametric chord.
Whenn is odd, the numberof chords parallel to a given sideis (n —
1)/2. Picking a side and picking two such chordsyields the answer. The
resulting trapezoids are distinct, because none are parallelogramssince
any two parallel chords have different lengths.
When is even, the same analysis gives 2 (7/2) pairs of chords parallel
to sides. For any diametric chord, there are (n — 2)/2 chords perpendic-
ular to it, yielding nm ((n~2)/*) pairs of such chords. Every parallelogram
has been counted twice. Each parallelogram is determined by having
two specified corners amongthefirst n/2 vertices, so there are (",”) par-
alleograms. Thus the numberoftrapezoids is 3(")") + 2(51) — ("?),
which equals (n — 3)(”,”).
1.1.26. The largest displacement d(x) of a permutation of |n] is | n?/2|,
where d(x) = >-"_, |i—(i)|. Define z’ from x by switching the elements
in positions i andi+1. If these elements are both at most i or both at
least i+ 1, then d(x’) = d(z). In the remaining case, one elementis at
most i and the otheris at least i+ 1. Now the displacementis greater (by
2) in the permutation in which the largerof the entries in positions i and
i+ 1 is in position 7.
We conclude that if any two adjacent entries are in increasing order,
then transposing them does not decrease the displacement. Hence the
displacement is maximized by a permutation in which no two consecu-
tive elements are in increasing order. The only such permutation is the
reverse of the identity permutation. The displacement of this permuta-
tion is ye 2(n — i), which equals| n?/2].
1.1.27. Bijection from the set A ofpermutations of |n] to the set B ofn-tuples
(b;,...,6,) such that 1 < b; <i foreach i. EFacha = aj,...,a,€ Aisa
list of numbers. For each i, let 6; be the position of i in the sublist of a
formed by the elements of [i]. Let f(a) be the resulting list b,,..., bn.
By construction, 1 < b; <i, so f(a) € B.
To prove that f is a bijection, we describe a function g: B — A. We
build g(b) from an emptylist by inserting numbers in the orderl,...,n.
Before inserting i, the list consists of {1,...,i—1}. We insert i to have
position b;. After processing b, we have a permutation of [n].
To prove that f and g are bijections, it suffices to show that they are
injective (in fact g = f~'), since A and B are finite and have the same
size. First consider f. Given distinct permutations in A, there is some
least value 7 such that the subpermutations using elements1,..., 7 are
different. Since they are the sameearlier but differ at the jth step, the
9 Chapter 1: Combinatorial Arguments
correspondingvaluesof b; are different.
For g, if two elementsof B differ first at the jth index (b; # b’), then
the subpermutations of 1,..., 7 inthe two image permutationsdiffer.
This bijection can also be described inductively.
1.1.28. The number of exchanges of elements in a permutation needed to
break all original adjacencies is | (n — 1)/4], for n => 6. Numberto ele-
ments from 1 to n in order. Since two elements are moved, at most four
original adjacencies can be broken by each exchange. There are n — 1
original adjacencies; this proves the lower bound.
To achieve the bound, exchange 2i with 2|(n — 1)/4| + 2, for1 <i<
r, where r = | (n - 1)/4|. When 4 | (n — 1), the first 27 even numbers
are moved, while all odd numbers remain fixed, and all adjacencies are
broken. When 4 ¢{ (n — 1), element 27 + 2 has been skipped and remains
adjacent to 2r — 1 and 2r +1. For the last switch, exchange 2r + 2 with
n when 4 | n, and exchange 2r + 2 with 1 when 4 divides n — 2 or n— 3.
1.1.29. There are (n!)?” 0, 1-matrices with n? rows and n? columns such
that (1) each row and column hasexactly one 1, and (2) when the matrix is
partitioned into n? blocks of n consecutive rows and n consecutive columns,
each block contains exactly one 1.
Choose the position of the 1 in each n-by-n tile successively, going
across a row oftiles from left to right, processing rows in order from top
to bottom. There are (n —i+ 1)(n — j + 1) choices available when dealing
with the jth tile in the ith row, due to the i—1 tiles above it and the j —-1
tiles to its left. In the ith row, the product of the numbers of choices is
(n —it+1)"n!, so over all rows we obtain (m!)"(n!)”.
More generally, when a square of size mn is divided into mn rectan-
gular tiles of width m and height n (globally, m rowsof n tiles), the same
argument shows that the number of permutation matrics of order mn
having exactly one 1 in eachtile is (m!)”(n!)”.
1.1.30. There are 2”! permutations x of [n] such that x(i+1) < x(i)+1 for
1 <i<n-—1. We view permutations as words. Call such a permutation
good. Listing thepossibilities for small n suggests the answer 2”.
Proof 1 (induction on n). There is one good permutation of [1]. For
n > 1, note that the constraint on the value following value n always
holds. Hence if z(1) = n, then we can ignore n, and the remaining con-
straints are precisely those for a permutation of [n — 1]. Hence there are
2”-2 good permutations starting with n.
If not at the beginning, then n must immediately follow element n —
1; following any other would violate a constraint. Deleting n yields a good
permutation of |n—1], since the element now following n—1 (ifany) is less
Section 1.1: Classical Models 10
than n— 1. On the other hand, n can be inserted immediately following
n—1 in any good permutation of |n—1] to form such a good permutation of
[n]. Both ofthese maps are injective, so the numberofgood permutations
of [n] in which n is not at the beginning is 2”~?.
Combining thecases yields 2”"!.
Proof 2 (combinatorial argument). We map good permutations into
subsets of [n — 1]. Given a good permutation 7, let f(z) = {i: z(i) > x(it+
1)}. To show that f is a bijection, we show that for each S C [n—1], there
is a unique permutation z of [n] such that f(z) = S.
In a good permutation, the runs of increasing steps are consecu-
tive numbers. Furthermore, the element after the end of a run must
be smaller than the element starting it. Thus the elements of each
run are smaller than the elements of each preceding run. Hence know-
ing the boundaries of the runs determines the permutation. For exam-
ple, if the first run has k elements, then the permutation must start
n—-k+1,n—k+2,...,n,and the next element will be just small enough
to allow the next run to end at n— k.
Thus the set S of locations of descents determines exactly one good
permutation. This is indeed the permutation z such that f(z) = S.
1.1.31. If the set of elements in even-indexed positions of a graceful per-
mutation of [2n] is |n], then the first and last elements differ by n, where
a permutation is graceful if the absolute differences between successive
elementsare distinct.
Call1,...,n “small” andn+1,...,2n “large”. For a gracefulper-
mutation, the differences between neighboring elements sum to (2),
which equals 2n? — n.
When the small numbersoccupy the even positions, each absolute dif-
ference is a large number minus a small number. Each number appears
in two differences, except that the first number x and last numbery only
appear once. Hence the differences sum to 2X —x—(2Y —y), where X and
Y are the sumsofthe large numbers and the small numbers,respectively.
Since X — Y = n?, we have 2n? — n = 2n? — (x — y); hence x — y =n.
Comment: The converse also holds. Suppose that 6; = be, +n. In
computing T = ye |b; — b;-1| as asum ofpositive differences, each 6; for
2 <i <2n-1 is weighted by 6; € {-2,0, +2}. We extend this to b; and
bo, by adding (b; — be,) —n = 0. We further observe ye 0; = 0, so
2n 2n
T = QO 6;b;) —-n = DD, d;(b; —n)|—n
<2 (gi —n)-2)(s;—n)—n = 2G- 28 —n = 2n?—n=T.
i=1 i=l
pia Chapter 1: Combinatorial Arguments
Thus equality holds throughout. In particular, if 6; is small, then
0; = —2. It follows that none ofthe terms|b;,; — b;| has the form |s;,1 —s;].
Hence the terms alternate between small and large. Since bo, is small,
the result follows.
1.1.32. Counting necklaces.
a) (n—1)!/2 necklaces with n beads can be madefrom n distinct beads,
for n > 3. Starting from a given point, there are n! ways to list the beads.
Each necklace corresponds to 2n such listings, since we can start the list
at any bead and go in either direction without changing the necklace.
b) i + k crowns with n beads can be made from k types of beads
when n is prime. Starting from a given point, there are k” waysto list
beads forming a circular pattern. A circular pattern arises n times in
this way unless some string repeats with period less than n. For example,
111111000 would yield a circular pattern that arises nine times, while
110110110 would yield a circular pattern that arises only three times.
However, the length of the repeating string must divide n. Since n is
prime, the only divisors are 1 and n. The & circular patterns made using
only one bead arises only once amongthe k” lists. The otherlists all group
into classes of size n; each giving one circular pattern.
1.1.33. [fa polynomial pin k variablesis 0 at all points in TI, S;, where
|S;| = d; + 1 and p has degree d; in variable x;, for 1 < i < k, then pis
identically 0. The base case k = 1 is the given hypothesis. Now consider
k > 1. Fixing any choice (x1,..., xg-1) € I: S; defines a polynomial in
the one variable x;,. By hypothesis, its value is 0 for x; € S;. By the case
k = 1, its value is 0 everywhere. Now any value of x;, not necessarily
in S;, defines a polynomial g in the variables x,,..., x,_-1 that is O when
(x1, ...,Xp-1) € Ti, S;. By the induction hypothesis, this polynomial is
0 everywhere. Hence the original polynomial p is 0 everywhere.
1.1.34. Combinatorial proofof (x + yn) = ¥, ({)x@¥n—-~ When z is an
integer, the falling factorial z(, counts the simple n-words from an alpha-
bet Z of size z. When Z is the disjoint union of an x-set X and a y-set Y,
the words can also be formedbyfirst choosing positions among the n po-
sitions in which to use letters from X. When there are k such positions,
there are x(,) waysto fill them with a simple k-word from X, and each can
be paired with any simple (n — k)-word from Y to form a simple n-word
from Z. Summing over k counts each simple n-word from Z exactly once.
The Polynomial Principle extends to any numberof variables, by in-
duction on the numberofvariables (keep all but one variable fixed). Thus
equality of two polynomials (in two variables) at all positive integer argu-
ments implies equality as polynomials (and at all real arguments).
Section 1.1: Classical Models 12
1.1.35. Flags on poles.
a) There are r™ways to put m distinct flags on r flagpoles in a row.
Proof 1. Place flag 1, then flag 2, etc. Each placement of a flag
effectively splits its location into two locations, since later flags may go
above or below it. With the numberof choices iteratively rising, there
are r(r + 1)---(r +m-—1) ways to complete the full process.
Proof 2. We obtain a permutation ofthe flags by listing in order the
flags from thefirst pole, then the second, and so on. Each permutation
can be associated with any nonnegative integer solution to x; +:::+x, =
m to specify how manyflags go on each pole; the resulting arrangements
are all distinct. Hence the answeris m!(”*’;*), simplifying to r™. The
permutation and the distribution amounts for the poles can be chosen in
either order, yielding the same computation.
b) The real numberidentity (x + y)" =, (Z)x”y"). When x and y
are nonnegative integers, the left side counts the arrangementsofn flags
onto x+y flagpoles. To count the sameset in pieces, let k be the numberof
flags placed on thefirst x flagpoles. We can choose these flags in (9) ways
and then place theseflags on thefirst x poles in x“ ways and the remain-
ing flags on the remaining poles in y~*) ways. Since each arrangement
has some numberofflags on thefirst x poles, each arrangementis counted
exactly once when we sum overk.
Hence the identity holds for infinitely many choices of both x and y.
By the Polynomial Principle, it holds for all real numbers x and y.
1.1.86. There are (n—1)!(2”—-1) ways to arrange n distinctflags on nonempty
flagpoles in a rotating circle.
Proof 1. Writing the flags in order from each flagpole yields a “cir-
cular permutation”, listing [n] in a circle. Since there are n possible
starting points for writing down a circular permutation as a linear per-
mutation, there are (n — 1)! circular permutations.
Any position in the circular permutation can be the last flag on a
pole; we obtain the arrangements on poles by choosing any subset of the
n flags to be the last flags on their poles. Since we choose each position in
the circular permutation at most once, the poles we use are all nonempty.
The numberof poles is the numberof positions chosen. Thereis no con-
straint on the numberof positions chosen, except that we must choose at
least one, because the flags must be placed.
We have shown that the arrangements correspondto a circular per-
mutation of [n] and a nonempty subset of the n flags; the product rule
now completes the proof.
Proof 2. One can also apply circularity after placing the poles.
There are n! ways to writeall the flags in order. There are (777) waysto
13 Chapter 1: Combinatorial Arguments
choose breakpoints to put these onto r poles, including the last position.
Since rotating the circle does not change the arrangement, each circular
arrangement using r poles arises in r ways by this procedure. Summing
over r to count them all and applying the Committee-Chair Identity and
the Binomial Theorem yields
n-1
yy) =(n-y°2("~ 1) =(n=°(") = (n— 1)!(2” — 1).
r r=1 r=1
1.1.37. When pis prime, ("*e*) = (*) is divisible by n, for all n. The quan-
tity ("*e*) is the number of multisets of size p from n types of elements.
Since (”) is the numberofp-subsetsof[n], the difference is the number of
multisets in which some element is repeated. Group these multisets into
groupsof size n as follows; two multisets A and B are in the same group
if B can be obtained from A by adding a constant to each element andre-
ducing the values modulo n. Because p is prime, iteratively adding 1 to
each element cannot repeat the multiset until n steps have been taken
(that is, the pattern of multiplicities has no shorter period), so all the
groups havesize n.
The reason for subtracting (*) is that this quantity is not divisible by
n when p divides n. When p distinct elements are equally spaced modulo
n, the grouping described above yields one group with only n/p sets. In
that case ("*e*) differs from a multiple of n by n/p.
1.1.38. Theprobability that a spinner with equally likely outcomes 1,...,n
sumsto n in three spins is eo) There are n® equally likely outcomes
of the experiment. The numberof outcomes with sum n is the numberof
compositions of n with three parts. The numberof these is (",").
1.1.39. Both sides of the identity below count the sameset ofternary lists.
Sl)(ae
— 2s+1])k k
Both sides count the ternary (n + 1)-tuples having a 2 in exactly k posi-
tions such that the copies of 2 separate the copies of 1 into k+ 1 portions
of odd length.
On theleft, start with n+ 1 positions, and chose an odd number(at
least 2k +1) to be nonzero. Chose k of the positions that are even-indexed
relative to this sublist to receive 2. Between any two such positions, the
numberof copies of 1 is odd, and the numberat the beginningor endis
also odd.
Section 1.1: Classical Models 14
On the right, begin with any ternarylist of length n — k having ex-
actly k copies of 2. There are (”,”)2”-?* such lists; copies of 2 may be con-
secutive. Now insert one position immediately before each 2 and at the
end. This position receives 1 or 0 as needed so that the numberof copies
of 1 in that portion between copies of 2 is odd. This choice is unique, so we
obtain exactly one of the desired lists for each of the ("*)ar-2k original
lists of length n — k.
1.1.40. Compositions ofintegers.
a) There are () solutions in positive integers to ~".
i=1
("—;) solutions in positive integers to )”_, x; = r; summing over r with
0<r<kand applying the Summation Identity yields the answer (*).
Directly, the solutions are determined by choosing n spaces to mark
the partial sums, from the k spaces following k dots in a row. The value
x; correspondsto the distance from the (i — 1)th chosen space to the ith,
where by convention the Oth chosen spaceis before thefirst dot.
Anotherdirect proofputs the desired solutions in bijective correspon-
dence with the solutions to ye x; = k+1, by adding a positive variable
Xn+1 representing the slack in the inequality. These solutions correspond
to the compositions ofk+1 withn+1 parts; the numberofthem is (+13).
b) There are 2*-! compositions of k. There are (*75) compositions of k
with n parts. Sum over n and apply the Binomial Theorem.
Bijective proof: Group dots to build a composition. From a row of k
indistinguishable dots, thefirst dot goes into the first part. Each subse-
quent dot can start a new part or enlarge the current part. Thus com-
positions are formed by making binary choices for k — 1 dots, and each
(k — 1)-tuple of choices arises from exactly one composition of k.
c) For k > 1, there are equally many compositions of k with an even
numberofparts and with an odd numberofparts. A compositionis deter-
mined by choosing a subset S of the spaces among k dots; the resulting
numberof parts is |S|+ 1. When k > 1, half the subsets of a set of size
k —1 have each parity (toggle the presence of the last element).
Comment: There are many natural bijections from A to B, where A
and B are the sets of compositions of k having an even number and an
odd numberof parts, respectively. Essentially, they pair up odd and even
subsets of the spaces between dots. For example, consider the map that
combines the last two parts if the last part is 1 and splits 1 off the last
part to form a new last part if the original last part exceeds 1.
d) For k > 2, the numberof compositions of k with an even number of
even parts equals the number of compositions of k with an odd number of
even parts. Let A and B be the sets ofcompositions of k with an even num-
ber of even parts and an odd numberof even parts, respectively. Define
x; <k. There are
15 Chapter 1: Combinatorial Arguments
f: A — Basfollows. For x € A, consider thefirst part, p. If p = 1, com-
bine p with the second part. If p > 1, split off 1 from p to make a new
first part. The 1 that appears or disappears does not affect the number of
even parts. The other changed part changesby 1, so its parity changes.
Hence the numberof even parts changes by 1, which changesits parity.
Note that the first part in f(x) is 1 if and only if the first part in x is
not 1. Continuing through the other parts shows that the first difference
between elements x and y of A causes a difference in f(x) and f(y). Hence
f is injective. By the same argument, the function g: B — A defined in
the same wayis also injective. Hence |A| = |B].
1.1.41. Compositions of integers.
a) Over all compositions of k, the total number ofparts is (k + 1)
The compositions correspond to the subsets of the k — 1 spaces in a row
of k dots. Each j-element subset yields a composition with j + 1 parts.
The first dot starts a part in each composition. Each remaining dot starts
a part in half of the compositions. Since the number of compositionsis
2*-1 the total numberofparts is 2*-!+(k—1)2*-?. (The same answercan
be obtained by computing yi (j+ 1)(5-1) using techniquesor identities
from Section 1.2.)
Proof 1 (summation). Since there are (
i): By summing the Committee-Chair
Qk-2
k-1
71) compositions with 7
parts, the total equals ean i(
Identity over the committee size, we obtain Yea j (7-1) = Yo ("77) +
aiU — 1(*}) = a1 + (k- 12"? = (kh + 12,
Proof 2 (bijection). Alternatively, compositions correspond to sub-
sets of the spaces amongk dots.
b) Over all the compositions of k, there are (k — m + 3)2*-™parts
equal to m, where 1 <m<k. Elementsof the set A;,. being counted are
expressible as the pairs (C, 7), where C is a composition of k and j isa
marked copy of min C. Subtracting 1 from the markedcopy of m yields a
pair (C’, 7’) in Ax_1,m-1. The mapis injective and surjective, so the sets
have the samesize, as desired. This leaves the problem of counting A;1.
Proof 1 (direct argument using part (a)). Skipping any 1 in a com-
position of k leaves a composition of k — 1, and each composition of k — 1
with j parts arises in 7 + 1 ways by doing this. That is, each composition
of k—1 with j parts yields 7 + 1 parts of size 1 among compositionsof k.
The answeris thus 1 for each composition of k— 1 plus the answerof part
(a) for k — 1: 24-2 + k2*-8 = (k + 2)2*-3. Theresult is the special case of
the claimed formula for m = 1.
Proof 2 (induction on k). Let ag, = |Ag_;|. Note that ag = 2 =
(2—1+8)2?-!* = 2. For k > 2, group the compositions by thelast part.
Section 1.1: Classical Models 16
With last part 1, the total numberof1s is ag_; + 2*~”, since there are 2*~?
compositions of k — 1. With last part 7, where 2 < j < k — 2, the totalis
a,—;, and there is 1 with last part k-—1. Thus a, = 1+ Qk-2 4 Yi Ap}.
We can apply the induction hypothesis and then perform the sum. To
avoid performing the sum, subtract consecutive instances to obtain for
k >8 that az, — az_) = 2°? — 2°? + a;z_1. Now the induction hypothesis
yields a; = 2(k + 1)2*-4 + 2'-3 = (k + 2)2*°3.
Proof 3 (induction variation). For k > 2, reduce the last part by 1
to obtain a composition of k — 1. Each such composition arises twice, by
deleting a final 1 or by reducing final part larger than 1. Counting 1s
over all resulting compositions thus yields 2a,_;, but we lost one for each
of the 2*-? compositions of k ending in 1, and wegainedonefor each of
the 2*-° compositions of k ending in 2. Hence a; = 2a,z_; + 24-2 — 24-3 =
(k + 2)2*-3,
Proof 4 (overall induction, sketch). One can also do the whole prob-
lem by induction on k for fixed m. The inductive ideais like that in Proof
2 or Proof 3, with adjustments for the copies of m that arise or disappear.
The computations are not as clean as above, so we omit them.
ec) 1+ yk —m+8)2*-™? = (k + 1)2*-*. By parts (a) and (b),
both sides countall parts in all compositions of k (the extra 1 counts the
composition whose only partis k).
1.1.42. The Weights Problem. The set S, = {1,3,...,3*+} permits the
checking ofall integer weights from 1 through (3* — 1)/2 ona balancescale,
and no otherchoice of k known weights permits more values to be checked.
Let f(k) = (3* — 1)/2. We first prove that S; permits us to balance
object A, of integer weight n for 1 <n f(k). It suffices to express n as
yo 6;3', where each b; € {-1, 0,1}, because then interpreting —1,0,1
for 6; to mean “sameside as A,,”, “off the balance”, and “side opposite to
A,,” yields an explicit configuration of the weights that balances A,.
Wefind the desired numbers {b;} using the ternary expansion of the
number n’ = n+ f(k). The equation n = yo b;3' holds if and only if
the equation n’ = yo (b; + 1)3’ holds, because the geometric sum yields
(3*-1)/2 = yo 3’. Since n < f(k), we haven’ < 2f(k) = 3*—1. Ternary
expansion guarantees a (unique) expression of n’ as n’ = yo a;3' with
each a; € {0,1, 2}. Setting b; = a; — 1 yields an explicit way to weigh n.
Wealso must prove that no other set ofweights can balance moreval-
ues. We count the possible configurations: each weight can be placed on
the left, on the right, or omitted, generating 3’ possible configurations.
The configuration that omits all weights balances no nonzero weight. Of
the remaining 3*—1 configurations, each balances the same weight as the
L7 Chapter 1: Combinatorial Arguments
configuration obtained by switching the left pan and right pan. Henceat
most (3* — 1)/2 distinct values can be weighed.
The construction for the lower bound can also be established using
induction on k. The advantage of the bijective proof is that it gives an
explicit description of the configuration used to balance a given weight.
1.1.43. Using weights w, < --: < w, on a two-pan balance, where S; =
>), Wi, every integer weight from 1 to S,, can be weighedifand only ifw; =
1 and wj41 < 2S; +1 for 1 < j <n. For sufficiency, we use induction
on n. When n = 1, the condition forces w; = 1, and the weight 1 can
be balanced. For the induction step, consider n > 1, and suppose that
the condition is sufficient for n — 1 weights. For 1 <i < S — wy, the
induction hypothesis implies that we can weigh i using {w,,...,W,_1}.
With w, also available, we can also weigh w, — i and w, + i, so we can
weigh every weight from wy, — S,_1 to Wn + Sn_-1 = Sy, using {w1,..., Wn}.
Since wy, — Sn-1 < Sy-1 + 1 by hypothesis, we can weigh every weight up
to S,.
For necessity, suppose we can balance all weights from 1 to S,. The
second largest possibility is S, — w1, required to be S, — 1, sow, = 1.
If wj41 > 2S; + 1 for some j, then let W = S, — 2S; — 1; we claim that
W cannot be weighed. The largest weight achievable without putting all
of {wj+1,...,Wn} in one pan is S, — wj+1 < W, but the smallest weight
achievable usingall of {wj+1,..., Wn} in one pan is S, — 2S;, which ex-
ceeds W.
1.1.44. Regions in cevian arrangements. From the three points x, y, z on
acircle, chords emerge and reach the circle between the other two points.
When counting regions, we can view this as chords from a vertex ofa tri-
angle to the opposite side (these are called cevians in geometry).
From each cevian arrangement with i, 7,k chords emerging from
x,y,z, respectively, we can reach every other such arrangement byit-
eratively sliding the foot of one chord. When a chord reaches the inter-
section of two other chords, we temporarily lose a region, but the count
is restored when the chord emerges from the intersection. Thus every
configuration without triple intersection points achieves the maximum
numberof regions.
Proof 1. The regions become easy to count when the chords from
each vertex reach the circle near the next vertex, cyclically. The chords
from x and y then form a small grid of ij regions near y. Near the xy
edge, the chords from x formi regions. Repeating this cyclically counts
all the regions except one central region, and the total isij + jk+kit+i+t
J+k+1.
Section 1.1: Classical Models 18
Proof 2. Having observed that the maximum occurs whenthere are
no triple-points and that each chord intersects every other, one can count
the regions formed as chordsare placed. First chords from x each split
1 region when added. Then the chords from y split i + 1 regions each.
Finally the chords from z split i+ 7 + 1 regions each. Starting from a
single initial region, the total becomes
1+i(1)+ jG+1)+kGt+74+1) =ij+ik+jkt+it+j+k+1.
Proof 3. Having observed that the maximum occurs when there are
no triple-points and that each chord intersects every other, one can treat
the configuration as a planar graph and apply Euler’s Formula. Here the
computations are a bit more complicated, and we are not assuming Eu-
ler’s Formula.
1.1.45. When n is divisible by r, and a k-set is chosen from |n] uniform
at random, where gced(k, r) = 1, the probability that the sum ofthe k-set is
divisible by ris 1/r. We prove more generally that the sum is equally dis-
tributed over the congruence classes modulo r. For any k-set, adding 1
to each element (n turns into 1) produces another k-set whose sum mod-
ulo r is larger by k. Since gcd(k, r) = 1, the original congruenceclassis
not revisited until r steps later, after one k-set has been found in each
congruence class. Since n is divisible by r, the translates of a given k-set
contribute equally to the r congruence classes. Since translation parti-
tions the k-sets into disjoint classes, and the claim holdsfor eachclass,
the distribution overall the k-sets is also uniform.
1.1.46. Forn,m,k € N with k <n, >i=0 mite = 1. Consider a deck
of n blue cards and m red cards. A player pulls cards at random without
replacement and wins when k blue cards are obtained. The probability
of winning is 1, since k < n. We compute the probability that the player
wins after drawing exactly 7 red cards, where 0 < j < m. Theprobabil-
ity that exactly k of the first k + j cards are blue is (Z)(")/ (Ey) The
probability that the last card is blue given that exactly k of the first k+ /
19 Chapter 1: Combinatorial Arguments
cards are blueis k/(k+,j). Hence the probability ofwinning after drawing
exactly 7 red cardsis me: Summing over j completes the proof.
+7
1.1.47. If f: A— Band g: B > Aare injections, then there exists a bijec-
tion h: A —> B, and hence A and B have the same cardinality. (Schroeder-
Bernstein Theorem)
We view A and B asdisjoint sets, making two copies of commonele-
ments. For each element z of AU B, we define the successorof z to be f(z)
if z € A, and g(z) if z € B. The descendants of z are the elements that can
be reached by repeating the successor operation. We say that z is aprede-
cessor of w if w is the successor of z. Because f and g are injective, every
element of A U B has at most one predecessor. The ancestors of z are the
elements that can be reached by repeating the predecessor operation.
The family of z consists of z together with all its ancestors and de-
scendants;call this F(z). We use the structure of families to define a one-
to-one correspondence between A and B. The successor operation defines
a function f’ on A U B; below we show several possibilities for families
using a graphical description of f’.
First suppose that z is a descendant of z. Because every element has
at most one predecessor, in this case F(z) is finite (repeatedly composing
the successor function leads to a “cycle” of elements involving z). Apply-
ing f’ alternates between A and B, and thus F(z) has even size. For every
x € Ain F(z), we pair x with f(x); because F(z) has even size, this is a
one-to-one correspondence between F(z) A and F(z)N B.
Otherwise, F(z) is infinite. In this case, the set S(z) of ancestors of
z maybe finite or infinite. When S(z)is finite, it contains an origin that
has no predecessor(all elements of F(z) have the same origin). If S(z) has
an origin in B, then for every x € AN F(z) we pair x with its predecessor
g(x); because B containstheorigin, g~!(x) exists. When S(z)is infinite
or has an origin in A, we pair x with its successor f(x).
Section 1.2: Identities 20
Because every element has at most one predecessor, the pairing we
have defined is a one-to-one correspondence between the elements ofA and
the elements of B within F(z). Since the families are pairwise disjoint,
it is also a one-to-one correspondence between A and B. In moretechni-
cal language, we have defined the function h: A — B by h(x) = g™}(x)
when the family of x has an origin in B, and h(x) = f(x) otherwise. The
function h is the desired bijection.
1.2. IDENTITIES
1.2.1. Combinatorial proofs of (,",) = %*(j) and (min) (meh) = (™"")(2).
To choose k + 1 elements from [n], one can first choose k and then choose
one element from the remaining n—k. This marks one element asspecial,
which could be any of the k + 1 chosen elements, so each (k + 1)-set has
been counted k + 1 times.
For the second equality, both sides are 0 unless 0 < k <n. Both sides
count the ternarylists of length m+n in which m positions are 0 and k of
the remaining n positions are 1. On the right side, choose the positions
for Os and then the positions for 1s. On theleft side, first choose all the
positions for 0s and 1s, and then among them choose the positionsforIs.
1.2.2. Wiig ("f*) = (2241). After applying complementation to convert
m+1
the summandto (th), the Summation Identity evaluates the sum.
1.2.3. (9) - (",”) = (1) + CO*). Using Pascal’s Formula twice,
n _[(n-1l 1 n-1 [n-1 1 n—-2 4 n-2
k) k-1 k k-1 k-1 kk}
1.2.4. Pascal’s Formula holds for the extended binomial coefficient. We
take the coefficient (%) to be 0 when k < 0, so the formula holds when
k =1. Fork >1, we use (2) = 4%
! Th,vu-j=e
vof+i(°,) with v equal to
u—1 and then u to compute
(a)(ta)=elem)(ema)=eta)=e}
1.2.5. >,(,",)(,°.)=(3). Setting 1 = n—k, the sum becomes
mtn
~, (.-))(;), and the value is given immediately by the Vandermonde
convolution.
Zl. Chapter 1: Combinatorial Arguments
1.2.6. a
=0 (er‘)= ke
=0 (er*) and ae(-re) = (er): For thefirst
equality, applying complementation to convert the summandsto (”**;')
and ("**1) allows the Summation Identity to evaluate the two sides to
(""") and (”*"), which are equal.
Applying complementation to the second factor in the summandcon-
verts the sum to >>, (7)(,,”_;), which evaluates by the Vandermondecon-
r—k
volution to (""”), whichequals em)
1.2.7. Evaluationof (|). Using the definition,
k-1 k-1
—1 1 , (-1)4
( k )- allo-9= Sr [[e+n=Co*
1.2.8. Summingthefirst npositive numbers. Inthe formulas i” = 2(3)+({)
and i? = 6(3)+6(5)+(j{), the left side counts k-tuples from an i-set, where
k € {2,3}. On the right for k = 2, we can choose two distinct elements
in is) ways andlist them in either order, while if we use the sameele-
ment twice there are i choices. For k = 3, there are six orders in which
we can list three distinct elements. When using only two elements, we
choose them, pick which of the two to use only once, andpick its location,
yielding 6(5). Again there are i ways to use only one element.
We use the Summation Identity to perform the sums.
yi). (nt+1_ nti)
Se sS((5!)=m
i=1 i=1
“2 CO, [i i o(n+1 nt+1_ n(n+1)(2n-2+8)
d= Dafa}(i)=2("5!)*("a |)=
= 3 - l L t (n+l n+1 n+1
r= Dofs)*s)*()=e( a )ee("s Je |
= n(n 1) (C=VED 1) 45) = nine 1)E™
As an application,
n
>(2 + 372 —5i) =
i=1
n2(n+1)? n(n+1)(2n+1) rn + 1)
2. - 2 oo
n(n+1) 2n+1 5
= nin + 1)( wo ~ 5) = nin + Din Din +4)
Section 1.2: Identities 22
1.2.9. There are dp, ways to put m white and n black marbles into boxes
if each box has at most one marble of each color and no box is empty until
all marbles are used. The boxes in order correspond to steps in a Delannoy
path. The steps can be horizontal (white marble) or vertical (black mar-
ble) or diagonal (one marble of each color). When all marbles are used,
the path will reach (m, n).
1.2.10. A triple product identity. We use the Committee-Chair Identity
twice, reorder the factors, and use it two more times.
n—-1l n n+1 (n-1 n [n-1n+1/[ n
(alana) k )= (hoa) al k (21)
_[n-1|n+1n(n-1 n _ (n-1/n+1 n 
-( k eTta) = ( k erate)
1.2.11. Identities by induction, using Pascal’ Formula.
a) The binomial coefficientformula (7)= En
Br The formula holdsfor
n = 0 under the convention that the “factorial” of a negative numberis
infinite. For n > 1, Pascal’s Formula and the induction hypothesis yield
(n=l 1) (n-1)! (n-1)! _ n-k nl kn! !
Q=C(e) +e) = nab + Gee
= a mone + nee! = AG
1.2.12. When flipping 100 fair coins, the number of heads andtails are
morelikely to differ by 2 than be equal.
Proof 1 (computation with factorials). The probability ofequal num-
bers is (‘{)’)/21°. The probability of differing by 2 is 2(7j)’)/2!°, sinceei-
ther heads or tails may be extra. For the ratio, we cancel like factors and
compute sygmsit = gag <1.
Proof 2 (combinatorial argument). Given any string with 50 heads
and 50 tails, switching the last flip yields a string in which the numbers
differ by 2. Distinct strings get mappedto distinct strings, so the mapis
injective. Furthermore,strings in which the last entry is in the minority
do not arise, since flipping it from equal weight makesits new value occur
51 times. Hence there are strictly more differing by 2.
b) The Summation Identity ", (;.) = (f1;) forn, k = 0. For n = 0,
the identity reduces to (?) = (,,,); both sides equal 1 if k = 0 and 0 if
k>0. Forn> 1, the induction hypothesis and Pascal’s Formula yield
or(i) = (8) + DE (i) =) + (a) = (RE).
c) The Binomial Theorem (x + y)” = Yo (Z)x*y""*. For n = 0, we
have (x + y)° = 1 = (})x°y®. For n > 0, the induction hypothesis gives
(xt yl = mo (",*)x*y"-I-k| We multiply both sides by (x + y) and
simplify the resulting expansion. To combine terms where the exponents
agree on x and agree on y, we shift the index in the first summation. We
23 Chapter 1: Combinatorial Arguments
then use Pascal’s Formula to combine corresponding terms. For the extra
terms, (”;) = 1 = (”) and (”)') = 1 = (G); these become the top and
bottom terms of the desired summation. The full computationis
n—-1
noe r
Ryn’
n—-1 n
— n—-1 n—1 k,,n—-k n _ k,n—-k
* ‘elee)-te!
“s“e (ie
k=1 k=0
d)An alternating sum: Yeo(-1)(i;) = (";'). We prove this for n, k >
0. For n = 0, the conventionsfor binomial coefficients yield 0 on both sides
unless k = 0 (where they equal 1). For n > 0, the induction hypothesis
and Pascal’s Formula yield
{on -|{(n-1 n-1l
doo, ‘ ~ dv lé - ) r (, ~j- :)|
: (n-1 : ({ n-l
~ yooh ) r den,” 1- :)
_(n-2 n-2 [n-1l
("a")(ea)=("i')
1.2.13. Combinatorial transformationsfor summing min{i, j} and max{i, j}.
a) Viet Veja Min{i, J} = Var Fe.
Proof 1. Consider an arrangement of unit cubes piled atop the
square with opposite corners (0,0) and (n,n) in the plane. Thepile of
cubes in position (i, 7) (that is, with upper right corner(i, 7)) has height
min{i, 7}. Thus the sum on the left counts the cubes. The numberof po-
sitions wherethe pile has height at least (n—k+1) isthe numberofpairs
(i, 7) such that both i and j belong to the set {n —k+1,...,n}. There
are k? such pairs, so grouping the cubesby the height of their position
yields the sum an k?. (Without geometry, this argument is the same
as summingthe entries of a matrix with min{i, 7} in position (i, /).)
Proof 2. Both sums count the squares with positive integer side-
lengths formed by the lines y = 0,...,y =nandx=0,...,x =n. There
j}.
Section 1.2: Identities 24
are k? such squares with side-length n + 1 — k, so the sum on the right
counts them by size. The sum on the left groups them by the upperright
corner. The numberof squares in the set whose upperright corneris the
point (i, 7) is precisely min{i, 7}, and we sum overall choices for i and /.
Proof 3. Both sums count the 3-tuples of integers from [n]| in which
the third element is smallest. When thefirst two elements are (i, 7), there
are min{i, 7} choices for the third element. When the third elementis r,
there are n —r+1 choices for each of the first two elements. Letting
k=n-r+1 again yields thesum )°7_, k’.
b) yr, kh? = 2("3")+("3"). Both sides count 3-tuples(r, s, t) € [n+1]?
such that t > max{r, s}. The sum on theleft counts the triples according
to the value of t; when t = k+1, there are k? ways to specify r and s. The
terms on the right group the triples according to whether r = s. If so,
then we pick two elements and put the larger in ¢t. If not, then we pick
three, put the largest in t, and choose either orderfor r ands.
ce) yey Vijay Min{i, j} = gn(n+1)(2n+ 1) and Yr, Y_, max{i, j} =
an(n + 1)(4n — 1). For the first sum, we invoke parts(a) and (b) and then
compute 2("3")+("3") = 3(n+1)n(n—-1)+ $(n4+1)n = (n+ I)n[2n-2+3].
For the second, since min{i, 7} + max{i, 7} =i+ 7, we subtract thefirst
sum from }Yy_, );-,(i+ j), which equals n }Y_,i +n i, J, or 2n(”5").
Thefinal value is (n+ 1)n[n— £(2n+1)], which yields the desired formula.
Comment: These identities can also be obtained by algebraic manip-
ulation of known identities involving things like sums of squares.
1.2.14. 0(m— j)2i-! = 2" —m-1.
Proof 1 (induction). Let f(m) denote the given sum. Note that
f(m)- f(m-1) = an 2/-1=2™1_1, Also f(0) = 0, since the sum is
empty. Therefore,
f(m) =D",(F@- f@-D) = OM4-1) = 2" -1-m.
Proof 2 (counting two ways). The family of all subsets of [m] with
size at least two has size 2” — 1—m. The given sum countsthis by the
position of the next-to-last 1 in the incidence vector. When the next-to-
last 1 is in position 7, there are m — j choices for the rightmost 1 and
2/-! waystofill the first 7 — 1 positions. The sum counts precisely the
incidence vectors with at least two 1s, because those are the vectors that
have a next-to-last 1.
1.2.15. Combinatorial argumentsfor identities.
a) (*”) = 2(°"|'). To pick a set ofsize n from [2n], one can use element
n and choose n — 1 from the remaining 2n — 1 elements to add, or omit
element n and choosen — 1 from the remaining 2n — 1 elements to omit.
25 Chapter 1: Combinatorial Arguments
b) ©, (7)(7) = (7)2”-). The kth term in the sum counts the ways to
form a committee of size k with a subcommittee of size / from a set of n
people, choosing the committee first and then the subcommittee. When
we sum over k, we are consideringall possible sizes for the committee, so
the sum countsall possible committees with a subcommitteeofsize /.
Selecting the subcommittee first can be done in (a) ways, and then
the rest of the committee can befilled by choosing an arbitrary subset of
the people that remain. Thus the right side also counts this set.
The proofcan equivalently be phrased by saying that both sides count
the ternary n-tuples with / zeros.
c) HI gel= 7 forg,n€N. Consider a tournament with q” play-
ers in which gamesinvolve q players and exactly one survives. In thefirst
round,there are gq”! games.In the jth round, g”/*+ players remain and
there are g”/ games. In the nth round,there is one game, and the win-
ning survives. Setting k = n+1-—/ shows that the left side ofthe identity
is the total number of games. On the other hand, gq” — 1 players must be
eliminated, and each game eliminates g—1 players, so the right side also
counts the games.
d) *_, i(n—i) = “_, (). Both sides count the 3-element subsets of
[n+1]. The left side groups them according to the middle element; there
are i(n — i) triples in which the middle element isi+1. The right side
groups them according to the top element; there are (5) triples in which
the top element is i+ 1.
1.2.16. Strehl’s Identity: ©, (”)(*) =O, (%)”.
Proof 1 (Vandermonde convolution). Special cases of the Vander-
mondeconvolution include )*, (7)(;) = ("*°) and ©, (“)(,",) = (7). With
these (at the beginning and end), the Subcommittee Identity, and revers-
ing the sum on k, we compute
(2)= SOY)- xX QOZWH)
EE(NOI)-20)ECE
Ele)ECMO)EHO
“E(i)()
Proof 2 (counting two ways). Given n distinct red cards and n dis-

More Related Content

PDF
Round2: Maths Challenge organised by ‘rep2rep’ research group at Sussex&Cambr...
DOC
Quant Fomulae
PDF
Introduction to probability solutions manual
PDF
Lohans’ magic squares and the Gaussian elimination method
PDF
Math formulas (recovered)
DOC
Gmat Math Tough Problems
DOC
Tough Quant
PDF
Prin digcommselectedsoln
Round2: Maths Challenge organised by ‘rep2rep’ research group at Sussex&Cambr...
Quant Fomulae
Introduction to probability solutions manual
Lohans’ magic squares and the Gaussian elimination method
Math formulas (recovered)
Gmat Math Tough Problems
Tough Quant
Prin digcommselectedsoln

Similar to Answers to Problems for Combinatorial Mathematics by Douglas West (20)

PDF
Number theory
PDF
101 math short cuts [www.onlinebcs.com]
PPTX
Mathematical Statistics Homework Help
PPT
counting principle.ppt
PPTX
Mathematical Statistics Assignment Help
PDF
101-maths short cut tips and tricks for apptitude
PDF
Quant formulae
PPTX
Mathematical Statistics Homework Help
PDF
Appt and reasoning
DOCX
Math ia analysis
DOCX
File ...handouts complete
PDF
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
PPTX
Mathematical Statistics Assignment Help
PPTX
Mathematical Statistics Assignment Help
DOCX
20230124 PLOS Fractal Manuscript 8.docx
PDF
The complete book_of_number_system1
PPT
Graphing Trig Functions-Tangent and Cotangent.ppt
PDF
A Proof of Twin primes and Golbach's Conjecture
Number theory
101 math short cuts [www.onlinebcs.com]
Mathematical Statistics Homework Help
counting principle.ppt
Mathematical Statistics Assignment Help
101-maths short cut tips and tricks for apptitude
Quant formulae
Mathematical Statistics Homework Help
Appt and reasoning
Math ia analysis
File ...handouts complete
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
20230124 PLOS Fractal Manuscript 8.docx
The complete book_of_number_system1
Graphing Trig Functions-Tangent and Cotangent.ppt
A Proof of Twin primes and Golbach's Conjecture
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Presentation on HIE in infants and its manifestations
PDF
RMMM.pdf make it easy to upload and study
PDF
Classroom Observation Tools for Teachers
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
01-Introduction-to-Information-Management.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
master seminar digital applications in india
Lesson notes of climatology university.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Presentation on HIE in infants and its manifestations
RMMM.pdf make it easy to upload and study
Classroom Observation Tools for Teachers
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning
Anesthesia in Laparoscopic Surgery in India
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
102 student loan defaulters named and shamed – Is someone you know on the list?
01-Introduction-to-Information-Management.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
VCE English Exam - Section C Student Revision Booklet
Ad

Answers to Problems for Combinatorial Mathematics by Douglas West

  • 1. | Chapter 1: Combinatorial Arguments 1. COMBINATORIAL ARGUMENTS ©Douglas B. West 1.1. CLASSICAL MODELS 1.1.1. When rolling n dice, the probability that the sum is even is 1/2. No matter what is rolled on thefirst n — 1 dice, the last die has three even values and three odd values, so in each case the probability of ending with an even total is 1/2. 1.1.2. There are (’})(5) rectangles with positive area formed by segments in a grid ofm horizontallines and n vertical lines. Positive area requires two distinct horizontal boundaries and two distinct vertical boundaries. 1.1.3. There are (""°)2175s words consisting of r consonants and s vowels. There are ("**) ways to allocate the positions to consonants and vowels and then 21”5* waystofill those positions. 1.1.4. There are (2) outcomesofan election with 30 voters and four candi- dates, (°°) — 4(7,') with no candidate having more than halfof the votes. If the votes are considered distinct, then there are 4°° outcomes. However, votes go into a ballot box, so an outcomeis determined just by the num- ber of votes for each candidate. Thus we want the numberofnonnegative integer solutions to x1 + x2 + x3 + x4 = 30, whichis (°"7*"). Whenone candidate receives at least 16 votes, the outcomes are the ways to distribute the remaining 14 votes arbitrarily, since votes arein- distinguishable. Only one candidate can have a majority, but that can be any one of the four, so there are 4(7,') outcomes we exclude. 1.1.5. For n €N, the expression (n° — 5n? + 4n)/120 is a integer. Since n®—5n?+4n = n(n?—1)(n? —4) = (n+2)(n+1)n(n—-1)(n—2), the expression equals ("!*), which is the numberof wasto choosefive objects from a set of size n + 2. This by definition is an integer. 1.1.6. 13!40! orderings ofa deck ofcards such that the spade suit appears consecutively. There are 13! ways to order the spade suit and 39! ways to Contact me in order to access the whole complete document. WhatsApp: https://wa.me/message/2H3BV2L5TTSUF1 Email: smtb98@gmail.com Telegram: https://t.me/solutionmanual s m t b 9 8 @ g m a i l . c o m s m t b 9 8 @ g m a i l . c o m complete document is available on https://unihelp.xyz/ *** contact me if site not loaded
  • 2. Section 1.1: Classical Models 2 order the remaining cards. There are then 40 waysto insert the ordered spade suit among the other cards. Alternatively, condense the spadesuit to a single item, order the items in 40! ways, and the expand the spade into 13! orderings of the spadesuit. 1.1.7. The probability of having at least three cards with the same rank in a set offive ordinary cardsis aw: Amongfive cards, only one rank can appearat least three times; pick it in 13 ways. Whenall four cards ofthis rank appear, there are 48 ways to pick the remaining card. When only three appear, there are four waysto pick the missing suit ofthis rank and (4) waysto pick the other two cards. Hence there are 13-48-(1+4-47/2) suitable sets of five cards. The desired probability is the ratio of this to (°*). Canceling factors in 434895120 yields the claimed probability. 1.1.8. From a standard 52-card deck, There are 13+ - 304 sets of six cards having at least one card in every suit. We may have three cardsin one suit and one in each otherin 4: (3138 ways. We mayhave two cards in each of two suits and one card in the other twoin (2)(23)°182 ways. These are the only choices; we sum them. 1.1.9. There are 10:9-8-142 integers from 0 to 99 , 999 in which each digit appears at most twice (counting leading Os as appearances. Consider cases by how manydifferent digits are used. There are 10,5) integers usingfive digits. There are 10(>) 93) integers using four digits; first pick and place the repeated digit. When three digits are used, two are used twice; hence the numberof integers of this type is 10:5-9- (5) -8. Summing the three cases yields the answer. 1.1.10. There are 11 ( ) (*) distinguishable ways to orderthe letters of“Mis- sissippi’. Choosing positions for the types of letters in stages, always the number of ways to do the next stage does not depend on how the previous stages were done. We place “M”in 11 ways, then choosefour positionsfor “i” among the remaining 10 in ( ) ways, then choose four positions for “9 6 ae) s” among the remaining6 in (7) ways, the put “p” in the remaining two positions. The rule of product then yields the answer. 1.1.11. From four colors ofmarbles, there are (3) distinguishable ways to have 12 marbles. There are 4!” ways to have 12 ofthe marbles in a row. For distinguishable selections with repetition, we use the multiset formula: (en*). The numberof ways to arrange a multiset depends on the num- ber of elements of each type. However, when weput the elements in a row we are just making words: each position may have one of the four types, and all such wordsare distinguishable.
  • 3. 3 Chapter 1: Combinatorial Arguments 1.1.12. If each New York City resident has a jar of 100 coins chosen from five types, then some two residents have equivalent jars. The numberof distinguishable jars of coins is the numberof multisets of size 100 from five types. Using the formula ary for selections of k elements from n types, the value is on , which equals 4,598,126. Without being precise, cancelling factors yields 13-103-34-101, whichis clearly less than 5-10°. Since New York City has more than 7- 10° residents, the claim follows. 1.1.13. When k is even, there are 2*/2-! compositions of k with every part even (there are none when k is odd). Halving each part yields a composition of k/2, and the mapis reversible. There are 2”! compositionsofn. 1.1.14. Families ofsubsets. a) There are 2” — 2!"/2! subsets of [n] that contain at least one odd num- ber. There are 2” subsetsof [n]. Among these,2!”/2! subsets are restricted to the set of even numbers. The remainder have at least one odd number. b) There are (”{*') k-elementsubsets of [n] that have no two consecu- tive integers. Proof 1. When choosing k elements, the remaining n — k mustdis- tribute among them to have at least one between each successive pair of chosen elements. Knowing how manygo in each slot determines the k elements selected. Hence the legal choices correspond to solutions to Xo $xXy +--+: +x, = n—k such that x,,...,x4_1 are positive and xo, xz are nonnegative. Subtracting 1 from the variables required to be posi- tive transforms these into nonnegative integer solutions ofyo +:::+y,% = n—2k+1. By the selections with repetition model, the numberof solu- tionsis ("7At1***1"1) which simplifies to (”"{*"). Proof 2. View the n—k unchosenintegers as dots in arow. We choose places for the selected integers between the dots (and on the ends), but avoidance of consecutive integers requires that no spaceis selected twice. We have n—k+1 allowable places and choose k ofthem for bars. The bars now mark thepositions of k selected numbers. c) There are n! choices of subsets Ag, A, ...An of [n] such that Ap C A; C-:-C A,. There are (n + 2)” choices such that Ap GC Ay C--: C Ap. Whenthesets have distinct sizes, we have |A;| = 7, since all the sizes are between 0 and n. Hence Ag = @, and the elementsof [n] are added one by one in some order. The n! possible orders correspond to the chains. To determinea chain of the second type, it suffices to specify for each x € [n] the index i such that x first appears in the chain at A;. Not ap- pearing at all is also an option. Hence there are n + 2 choices available for each x, and the choice made for x is not restricted by the choices made for other elements.
  • 4. Section 1.1: Classical Models 4 1.1.15. The exponent on a primep in the prime factorization of (*”) is the number ofpowers p* of p such that | 2n/p*| is odd. We use the formula ‘ai Gry In m!, | m/p| factors are divisible by p. In | m/p?| of these, we have an extra factor of p. In | m/p°| , we have yet anotherfactorofp, and so on. Hence the highest powerofp that divides m! is }),., | m/p*| , When | 2n/p* | is even, the numberof multiples ofp* in [2n] is twice the numberin [n]; for example | 10/2| = 4, and | 5/2| = 2. When | 2n/p*| is odd, we get one extra: | 6/2| = 8, but | 3/2| = 1. The latter case occurs if and only if the remainderof n upon division by p* is at least p*/2. Sincethe factorsofp in the factorization of n! are used (twice) to can- cel factors ofp in the factorization of (2n)!, we thus find that (2n)! keeps an extra factor of p for each k where | 2n/p*| is odd. Prime factorsof (‘5) and ({}). A prime p will be a factorif | 2n/p*| is odd for some k. We have | 18/2| = 9 and | 20/4| = 5, so 2 divides both. Since | 18/3| = | 20/3] = 6 and | 18/9| = |20/9| = 2, 3 divides neither. For higher primes, the squares are too big to give a nonzero contri- bution. We have | 18/5| = 3 but | 20/5| = 4, so 5 divides () but not (79). Since | 18/7| = | 20/7| = 2, 7 divides neither. However, 11, 13, and 17 yield 1 in each case, as does 19 in the latter case. Hence the primedivisors of (j) are {2,5,11, 13,17}, and thoseof(7) are {2,11,13,17, 19}. 1.1.16. Given v(a, b) = ((,7,)- (3). (451)), there do not exist distinct pairs (a, b) and (c, d) ofpositive integers such that v(c, d) is a multiple of v(a, b). Suppose u(c, d) = xv(a, b). We have (5) = x(%), and then d c_( ¢ _,f @ )L, b a | b c c-d+1d}) d-1) “b-1) “~“a-b+1b) a-b+i1d c—df(c [ ec _,( 2 _ 2-6 a a-b[c d+1d) d+1) “b+1) “b+1b) b+1d Thus (a -—b+1)d = (c—d+1)b and (6+ 1)(c —d) = (d + 1)(a— b). The difference of these two equations yields d—a+b = b—c+d, and hence a = c. Now,since (,°,) = #2(¢) and (,°,) = $4(5), and the ratiosof($) to (5) and (71) to (464) are the same, we have a” = a | Thus (d + 1)(a — b) = (6+ 1)(e—d) =(b+1)(a—d). We obtain (a + 1)(d — b) = 0, so alsod = b. 1.1.17. There are (%;)(";")lists of m 1s and n 0s having k runsof1s. Proof1 (case analysis). The numberofruns of0s may be k — 1 (start and end with 1s), k + 1 (start and end with Os), or k (two cases, starting with Os or with 1s). In each of these four cases, forming compositions of m and n with the right numberof parts completely specifies thelist.
  • 5. 5 Chapter 1: Combinatorial Arguments For the 1s, we have (1) compositions of m with k parts. For the 0s, the factor is (7-3) or ("2") or (775), the last in two cases. Summing these and applying Pascal’s Formula three timesyields (7;)("z"). Proof 2 (direct arguments). After forming a composition with k parts in (71) ways for the 1s, these k nonempty runs are put inton+1 possible locations among the Os (or at the ends). Runsof 1s go into dis- tinct locations amongthe 0s, so there are (";) ways to place them. [One can also place the 0s, with repetition allowed, among the runsof Is, en- suring that the k — 1 interior locations are nonempty. The numberof ways is then the numberof multisets of size n —k+1 from k + types.| 1.1.18. Runs in subsets. n+1 a) The numberof subsets of [n] with k runs is ( Ok ). The runs ina subset correspondto runsof 1s in the incidence vector, separated by runs of Os. We can specify the runs by inserting a bar before and after each run, separating it from the neighboring positions. Since thereis at least one 0 between two runsof 1s in the incidence vector, the bars are placed in distinct positions. The allowable positions are between entries of the incidencevector, plus at the beginning or end. To specify k runs, we pick 2k of these n + 1 positions, so the answeris ("3,'). Comment: Thereis also an analysis that considers cases depending on whetherthefirst and/or last element is used or not. The cases yield binomialcoefficients that combine to ("3,') by Pascal’s Formula. b) The numberof t-element subsets of [n] with k runsis(Maen| Garena» Determining the length of each run and the distances between runsde- termines the subset. Again consider the 2k bars specifying the runs; this time we must distribute ¢t positions within the runs and n — t out- side them. By adding positions 0 and n+ 1 as extra positions before the first run andafter the last, we guarantee k+1 nonemptybins outside the runs and have two composition problems. We need a composition of t with k parts to specify the lengths of the runs and a composition of n + 2 —t with k + 1 parts to specify the locations of the runs. Thereare (;_;) of n+2-t-1 k+1-1 c) The numberoft-element subsets of[n] having exactly r; runs oflength s; for 1 <i<m,wherek =o", ri, and t =)", risi, is meap): Now we are given the lengths of the runs of 1s. To form the incidence vector, we permute them and position them. There are again k runs with total length t, so the factor (rr) for separating the runs of 1s remains. The runs can come in any order. However, all r;! ways of ordering the r; runs of length i produce the same subsetof [n] (we assume that s;,..., Sm are distinct). Thus there are k!/[];", ri! ways to order the runsof1s. the former and ( ) of the latter, and we choose them independently.
  • 6. Section 1.1: Classical Models 6 1.1.19. The numberof binary strings of length n in which the number of copies of 00 is the same as the numberof copies of 11 is 2 when n = 1 and is 2(p71) when n > 1. For n= 1, both strings are counted. Consider n > 1. Let a and b be the numberof Os and numberof |1s, respectively. If there are i runs of 0 and j runs of 1, then there are a —i copies of 00 and 6 — j copies of 11. If the first and last bits differ, then i = 7, and the desired condition holds if and only if a = b, which requires n even. If the first and last bits are 0, then i = 7 +1, and we need a = 6+ 1, which requires n odd. Similarly, we need a+ 1 = b and n odd whenthefirst and last bits are 1. The needed property of the first and last bits holds in two ways. Af- ter ensuring this, the needed condition on a and is satisfied in (22/2) n- (n-1 2(n)2]) in both cases. The formula is not valid when n = 1 because the first and last bits are the same. strings when n is even and in ( 52) when n is odd. Thus the answeris 1.1.20. The numberofelements of |3]|" with k odd entries having no 1 next toa3 is >x5 (ret) (1)24. Let j be the numberof runsof odd entries. Each runis all-1 or all-3, independently, since any two successive runs of odd entries are separated by at least one 2. With k odd entries in j runs, the run lengths of odd entries form a composition of k with j parts. Hence there are (“772 ways to form the sublist of odd entries. Altogether there are n—k copies of 2. These are distributed into j7+1 buckets, andall but thefirst and last must be nonempty(the list may or may not start or end with a 2). Hence there are (7) waysto distribute the copiesof 2. Summingover the possibilities for 7 completes the proof. 1.1.21. Inside a convex n-gon, (1) pairs ofchords cross. Proof 1 (brute force). Let a, be the answer. Let v;,...,0Un be the vertices in order. The vertices v,,...,U,_1 forma convex (n — 1)-gon, and within it a,_; pairs of chords cross. To this we add the crossings involv- ing chords at v,. The chord from v, to vg crosses (k — 1)(n — k — 1) other chords, so a, = Qn-1 + ok —1)(n-—k- 1). With a3 = 0, we have an=>4 ar(k —1)(r7 —-k—1). Proof by induction after guessing the answerfrom data, or application of identities from Section 1.2, may lead you to the answer ("). Proof 2 (combinatorial understanding). Each crossing involves two chords. Those two chords involve four endpoints. Thus every crossingcor- respondsto four points on the n-gon. Furthermore,each set offour points on the n-gonis the set of endpoints for exactly one pair of crossing chords. Hence the numberofcrossingpairsis(7).
  • 7. 7 Chapter 1: Combinatorial Arguments 1.1.22. If no three chords have a common internal point in the picture formed by drawingall (5) chords ofa convex n-gon, then the numberoftri- angles is (3) + 4(7) + 5(Z) + (%). We count the triangles according to how many corners lie on the boundary of the n-gon. A triangle with three boundary cornersis determined by choosing three vertices of the n-gon. A triangle with two boundary cornershas a full chord as oneside, and the other two sides extend to form full chords. The endpoints of these three chords are four points on the boundary. Hence such triangleis associated with four vertices of the n-gon, chosen in (7) ways. On the other hand, each choice of four vertices yields four such triangles. A triangle with one boundary corner is determined by two chords from that point and one chord that crosses both of them. This leads to five vertices on the boundary. Each choice of five vertices determinesfive triangles in this way, so the numberof triangles of this type is 5(Z). A triangle with no boundary cornersis determined by three chords with nocommon endpoints, obtained by extending the sides. Thussix ver- tices must be chosen from the boundary to draw the chords. Each choice of six yields exactly one such triangle, with opposite pairs formingpair- wise crossing chords. Dee ye Comment: Other ways to group and count the triangles produce more complicated formulas, which can be simplified to that above via identi- ties. Having obtained a simple formula, one seeks a simple proof.... 1.1.23. Rolling dice. Six dice each have three red faces, two green faces, and one blue face. The probability that three red faces, two green faces, and one blue face will show whenall six are rolled is 5/36. The six dice are objects; each shows some face. The numberofar- rangements of RRRGGBis ($)(;), which equals 60. Each has probability (3)3(2)?(4)' ofoccurring. Hencethe desired probability is 60-(27-4-1)/6°. 1.1.24. In poker, a straight is more likely than a flush. The numberofsets of five cards from onesuit is 4(’?). For the numberofsetsoffive cards with consecutive values, the lowest value can be any numberfrom 1 to 10 (an ace can be considered high or low). Hence there are 10 - 4° such sets. After canceling commonfactors, the ratio of the numberof straights to numberofflushes simplifies to #2#?%, which is about 1.989. 1.1.25. The numberof trapezoids defined by vertices of a regular n-gon is n("")?)if n is odd and (n — 8)("4”) if n is even. It suffices to count the
  • 8. Section 1.1: Classical Models 8 pairs of parallel chords. Chords are parallel to a side or (when n is even) perpendicular to a diametric chord. Whenn is odd, the numberof chords parallel to a given sideis (n — 1)/2. Picking a side and picking two such chordsyields the answer. The resulting trapezoids are distinct, because none are parallelogramssince any two parallel chords have different lengths. When is even, the same analysis gives 2 (7/2) pairs of chords parallel to sides. For any diametric chord, there are (n — 2)/2 chords perpendic- ular to it, yielding nm ((n~2)/*) pairs of such chords. Every parallelogram has been counted twice. Each parallelogram is determined by having two specified corners amongthefirst n/2 vertices, so there are (",”) par- alleograms. Thus the numberoftrapezoids is 3(")") + 2(51) — ("?), which equals (n — 3)(”,”). 1.1.26. The largest displacement d(x) of a permutation of |n] is | n?/2|, where d(x) = >-"_, |i—(i)|. Define z’ from x by switching the elements in positions i andi+1. If these elements are both at most i or both at least i+ 1, then d(x’) = d(z). In the remaining case, one elementis at most i and the otheris at least i+ 1. Now the displacementis greater (by 2) in the permutation in which the largerof the entries in positions i and i+ 1 is in position 7. We conclude that if any two adjacent entries are in increasing order, then transposing them does not decrease the displacement. Hence the displacement is maximized by a permutation in which no two consecu- tive elements are in increasing order. The only such permutation is the reverse of the identity permutation. The displacement of this permuta- tion is ye 2(n — i), which equals| n?/2]. 1.1.27. Bijection from the set A ofpermutations of |n] to the set B ofn-tuples (b;,...,6,) such that 1 < b; <i foreach i. EFacha = aj,...,a,€ Aisa list of numbers. For each i, let 6; be the position of i in the sublist of a formed by the elements of [i]. Let f(a) be the resulting list b,,..., bn. By construction, 1 < b; <i, so f(a) € B. To prove that f is a bijection, we describe a function g: B — A. We build g(b) from an emptylist by inserting numbers in the orderl,...,n. Before inserting i, the list consists of {1,...,i—1}. We insert i to have position b;. After processing b, we have a permutation of [n]. To prove that f and g are bijections, it suffices to show that they are injective (in fact g = f~'), since A and B are finite and have the same size. First consider f. Given distinct permutations in A, there is some least value 7 such that the subpermutations using elements1,..., 7 are different. Since they are the sameearlier but differ at the jth step, the
  • 9. 9 Chapter 1: Combinatorial Arguments correspondingvaluesof b; are different. For g, if two elementsof B differ first at the jth index (b; # b’), then the subpermutations of 1,..., 7 inthe two image permutationsdiffer. This bijection can also be described inductively. 1.1.28. The number of exchanges of elements in a permutation needed to break all original adjacencies is | (n — 1)/4], for n => 6. Numberto ele- ments from 1 to n in order. Since two elements are moved, at most four original adjacencies can be broken by each exchange. There are n — 1 original adjacencies; this proves the lower bound. To achieve the bound, exchange 2i with 2|(n — 1)/4| + 2, for1 <i< r, where r = | (n - 1)/4|. When 4 | (n — 1), the first 27 even numbers are moved, while all odd numbers remain fixed, and all adjacencies are broken. When 4 ¢{ (n — 1), element 27 + 2 has been skipped and remains adjacent to 2r — 1 and 2r +1. For the last switch, exchange 2r + 2 with n when 4 | n, and exchange 2r + 2 with 1 when 4 divides n — 2 or n— 3. 1.1.29. There are (n!)?” 0, 1-matrices with n? rows and n? columns such that (1) each row and column hasexactly one 1, and (2) when the matrix is partitioned into n? blocks of n consecutive rows and n consecutive columns, each block contains exactly one 1. Choose the position of the 1 in each n-by-n tile successively, going across a row oftiles from left to right, processing rows in order from top to bottom. There are (n —i+ 1)(n — j + 1) choices available when dealing with the jth tile in the ith row, due to the i—1 tiles above it and the j —-1 tiles to its left. In the ith row, the product of the numbers of choices is (n —it+1)"n!, so over all rows we obtain (m!)"(n!)”. More generally, when a square of size mn is divided into mn rectan- gular tiles of width m and height n (globally, m rowsof n tiles), the same argument shows that the number of permutation matrics of order mn having exactly one 1 in eachtile is (m!)”(n!)”. 1.1.30. There are 2”! permutations x of [n] such that x(i+1) < x(i)+1 for 1 <i<n-—1. We view permutations as words. Call such a permutation good. Listing thepossibilities for small n suggests the answer 2”. Proof 1 (induction on n). There is one good permutation of [1]. For n > 1, note that the constraint on the value following value n always holds. Hence if z(1) = n, then we can ignore n, and the remaining con- straints are precisely those for a permutation of [n — 1]. Hence there are 2”-2 good permutations starting with n. If not at the beginning, then n must immediately follow element n — 1; following any other would violate a constraint. Deleting n yields a good permutation of |n—1], since the element now following n—1 (ifany) is less
  • 10. Section 1.1: Classical Models 10 than n— 1. On the other hand, n can be inserted immediately following n—1 in any good permutation of |n—1] to form such a good permutation of [n]. Both ofthese maps are injective, so the numberofgood permutations of [n] in which n is not at the beginning is 2”~?. Combining thecases yields 2”"!. Proof 2 (combinatorial argument). We map good permutations into subsets of [n — 1]. Given a good permutation 7, let f(z) = {i: z(i) > x(it+ 1)}. To show that f is a bijection, we show that for each S C [n—1], there is a unique permutation z of [n] such that f(z) = S. In a good permutation, the runs of increasing steps are consecu- tive numbers. Furthermore, the element after the end of a run must be smaller than the element starting it. Thus the elements of each run are smaller than the elements of each preceding run. Hence know- ing the boundaries of the runs determines the permutation. For exam- ple, if the first run has k elements, then the permutation must start n—-k+1,n—k+2,...,n,and the next element will be just small enough to allow the next run to end at n— k. Thus the set S of locations of descents determines exactly one good permutation. This is indeed the permutation z such that f(z) = S. 1.1.31. If the set of elements in even-indexed positions of a graceful per- mutation of [2n] is |n], then the first and last elements differ by n, where a permutation is graceful if the absolute differences between successive elementsare distinct. Call1,...,n “small” andn+1,...,2n “large”. For a gracefulper- mutation, the differences between neighboring elements sum to (2), which equals 2n? — n. When the small numbersoccupy the even positions, each absolute dif- ference is a large number minus a small number. Each number appears in two differences, except that the first number x and last numbery only appear once. Hence the differences sum to 2X —x—(2Y —y), where X and Y are the sumsofthe large numbers and the small numbers,respectively. Since X — Y = n?, we have 2n? — n = 2n? — (x — y); hence x — y =n. Comment: The converse also holds. Suppose that 6; = be, +n. In computing T = ye |b; — b;-1| as asum ofpositive differences, each 6; for 2 <i <2n-1 is weighted by 6; € {-2,0, +2}. We extend this to b; and bo, by adding (b; — be,) —n = 0. We further observe ye 0; = 0, so 2n 2n T = QO 6;b;) —-n = DD, d;(b; —n)|—n <2 (gi —n)-2)(s;—n)—n = 2G- 28 —n = 2n?—n=T. i=1 i=l
  • 11. pia Chapter 1: Combinatorial Arguments Thus equality holds throughout. In particular, if 6; is small, then 0; = —2. It follows that none ofthe terms|b;,; — b;| has the form |s;,1 —s;]. Hence the terms alternate between small and large. Since bo, is small, the result follows. 1.1.32. Counting necklaces. a) (n—1)!/2 necklaces with n beads can be madefrom n distinct beads, for n > 3. Starting from a given point, there are n! ways to list the beads. Each necklace corresponds to 2n such listings, since we can start the list at any bead and go in either direction without changing the necklace. b) i + k crowns with n beads can be made from k types of beads when n is prime. Starting from a given point, there are k” waysto list beads forming a circular pattern. A circular pattern arises n times in this way unless some string repeats with period less than n. For example, 111111000 would yield a circular pattern that arises nine times, while 110110110 would yield a circular pattern that arises only three times. However, the length of the repeating string must divide n. Since n is prime, the only divisors are 1 and n. The & circular patterns made using only one bead arises only once amongthe k” lists. The otherlists all group into classes of size n; each giving one circular pattern. 1.1.33. [fa polynomial pin k variablesis 0 at all points in TI, S;, where |S;| = d; + 1 and p has degree d; in variable x;, for 1 < i < k, then pis identically 0. The base case k = 1 is the given hypothesis. Now consider k > 1. Fixing any choice (x1,..., xg-1) € I: S; defines a polynomial in the one variable x;,. By hypothesis, its value is 0 for x; € S;. By the case k = 1, its value is 0 everywhere. Now any value of x;, not necessarily in S;, defines a polynomial g in the variables x,,..., x,_-1 that is O when (x1, ...,Xp-1) € Ti, S;. By the induction hypothesis, this polynomial is 0 everywhere. Hence the original polynomial p is 0 everywhere. 1.1.34. Combinatorial proofof (x + yn) = ¥, ({)x@¥n—-~ When z is an integer, the falling factorial z(, counts the simple n-words from an alpha- bet Z of size z. When Z is the disjoint union of an x-set X and a y-set Y, the words can also be formedbyfirst choosing positions among the n po- sitions in which to use letters from X. When there are k such positions, there are x(,) waysto fill them with a simple k-word from X, and each can be paired with any simple (n — k)-word from Y to form a simple n-word from Z. Summing over k counts each simple n-word from Z exactly once. The Polynomial Principle extends to any numberof variables, by in- duction on the numberofvariables (keep all but one variable fixed). Thus equality of two polynomials (in two variables) at all positive integer argu- ments implies equality as polynomials (and at all real arguments).
  • 12. Section 1.1: Classical Models 12 1.1.35. Flags on poles. a) There are r™ways to put m distinct flags on r flagpoles in a row. Proof 1. Place flag 1, then flag 2, etc. Each placement of a flag effectively splits its location into two locations, since later flags may go above or below it. With the numberof choices iteratively rising, there are r(r + 1)---(r +m-—1) ways to complete the full process. Proof 2. We obtain a permutation ofthe flags by listing in order the flags from thefirst pole, then the second, and so on. Each permutation can be associated with any nonnegative integer solution to x; +:::+x, = m to specify how manyflags go on each pole; the resulting arrangements are all distinct. Hence the answeris m!(”*’;*), simplifying to r™. The permutation and the distribution amounts for the poles can be chosen in either order, yielding the same computation. b) The real numberidentity (x + y)" =, (Z)x”y"). When x and y are nonnegative integers, the left side counts the arrangementsofn flags onto x+y flagpoles. To count the sameset in pieces, let k be the numberof flags placed on thefirst x flagpoles. We can choose these flags in (9) ways and then place theseflags on thefirst x poles in x“ ways and the remain- ing flags on the remaining poles in y~*) ways. Since each arrangement has some numberofflags on thefirst x poles, each arrangementis counted exactly once when we sum overk. Hence the identity holds for infinitely many choices of both x and y. By the Polynomial Principle, it holds for all real numbers x and y. 1.1.86. There are (n—1)!(2”—-1) ways to arrange n distinctflags on nonempty flagpoles in a rotating circle. Proof 1. Writing the flags in order from each flagpole yields a “cir- cular permutation”, listing [n] in a circle. Since there are n possible starting points for writing down a circular permutation as a linear per- mutation, there are (n — 1)! circular permutations. Any position in the circular permutation can be the last flag on a pole; we obtain the arrangements on poles by choosing any subset of the n flags to be the last flags on their poles. Since we choose each position in the circular permutation at most once, the poles we use are all nonempty. The numberof poles is the numberof positions chosen. Thereis no con- straint on the numberof positions chosen, except that we must choose at least one, because the flags must be placed. We have shown that the arrangements correspondto a circular per- mutation of [n] and a nonempty subset of the n flags; the product rule now completes the proof. Proof 2. One can also apply circularity after placing the poles. There are n! ways to writeall the flags in order. There are (777) waysto
  • 13. 13 Chapter 1: Combinatorial Arguments choose breakpoints to put these onto r poles, including the last position. Since rotating the circle does not change the arrangement, each circular arrangement using r poles arises in r ways by this procedure. Summing over r to count them all and applying the Committee-Chair Identity and the Binomial Theorem yields n-1 yy) =(n-y°2("~ 1) =(n=°(") = (n— 1)!(2” — 1). r r=1 r=1 1.1.37. When pis prime, ("*e*) = (*) is divisible by n, for all n. The quan- tity ("*e*) is the number of multisets of size p from n types of elements. Since (”) is the numberofp-subsetsof[n], the difference is the number of multisets in which some element is repeated. Group these multisets into groupsof size n as follows; two multisets A and B are in the same group if B can be obtained from A by adding a constant to each element andre- ducing the values modulo n. Because p is prime, iteratively adding 1 to each element cannot repeat the multiset until n steps have been taken (that is, the pattern of multiplicities has no shorter period), so all the groups havesize n. The reason for subtracting (*) is that this quantity is not divisible by n when p divides n. When p distinct elements are equally spaced modulo n, the grouping described above yields one group with only n/p sets. In that case ("*e*) differs from a multiple of n by n/p. 1.1.38. Theprobability that a spinner with equally likely outcomes 1,...,n sumsto n in three spins is eo) There are n® equally likely outcomes of the experiment. The numberof outcomes with sum n is the numberof compositions of n with three parts. The numberof these is (","). 1.1.39. Both sides of the identity below count the sameset ofternary lists. Sl)(ae — 2s+1])k k Both sides count the ternary (n + 1)-tuples having a 2 in exactly k posi- tions such that the copies of 2 separate the copies of 1 into k+ 1 portions of odd length. On theleft, start with n+ 1 positions, and chose an odd number(at least 2k +1) to be nonzero. Chose k of the positions that are even-indexed relative to this sublist to receive 2. Between any two such positions, the numberof copies of 1 is odd, and the numberat the beginningor endis also odd.
  • 14. Section 1.1: Classical Models 14 On the right, begin with any ternarylist of length n — k having ex- actly k copies of 2. There are (”,”)2”-?* such lists; copies of 2 may be con- secutive. Now insert one position immediately before each 2 and at the end. This position receives 1 or 0 as needed so that the numberof copies of 1 in that portion between copies of 2 is odd. This choice is unique, so we obtain exactly one of the desired lists for each of the ("*)ar-2k original lists of length n — k. 1.1.40. Compositions ofintegers. a) There are () solutions in positive integers to ~". i=1 ("—;) solutions in positive integers to )”_, x; = r; summing over r with 0<r<kand applying the Summation Identity yields the answer (*). Directly, the solutions are determined by choosing n spaces to mark the partial sums, from the k spaces following k dots in a row. The value x; correspondsto the distance from the (i — 1)th chosen space to the ith, where by convention the Oth chosen spaceis before thefirst dot. Anotherdirect proofputs the desired solutions in bijective correspon- dence with the solutions to ye x; = k+1, by adding a positive variable Xn+1 representing the slack in the inequality. These solutions correspond to the compositions ofk+1 withn+1 parts; the numberofthem is (+13). b) There are 2*-! compositions of k. There are (*75) compositions of k with n parts. Sum over n and apply the Binomial Theorem. Bijective proof: Group dots to build a composition. From a row of k indistinguishable dots, thefirst dot goes into the first part. Each subse- quent dot can start a new part or enlarge the current part. Thus com- positions are formed by making binary choices for k — 1 dots, and each (k — 1)-tuple of choices arises from exactly one composition of k. c) For k > 1, there are equally many compositions of k with an even numberofparts and with an odd numberofparts. A compositionis deter- mined by choosing a subset S of the spaces among k dots; the resulting numberof parts is |S|+ 1. When k > 1, half the subsets of a set of size k —1 have each parity (toggle the presence of the last element). Comment: There are many natural bijections from A to B, where A and B are the sets of compositions of k having an even number and an odd numberof parts, respectively. Essentially, they pair up odd and even subsets of the spaces between dots. For example, consider the map that combines the last two parts if the last part is 1 and splits 1 off the last part to form a new last part if the original last part exceeds 1. d) For k > 2, the numberof compositions of k with an even number of even parts equals the number of compositions of k with an odd number of even parts. Let A and B be the sets ofcompositions of k with an even num- ber of even parts and an odd numberof even parts, respectively. Define x; <k. There are
  • 15. 15 Chapter 1: Combinatorial Arguments f: A — Basfollows. For x € A, consider thefirst part, p. If p = 1, com- bine p with the second part. If p > 1, split off 1 from p to make a new first part. The 1 that appears or disappears does not affect the number of even parts. The other changed part changesby 1, so its parity changes. Hence the numberof even parts changes by 1, which changesits parity. Note that the first part in f(x) is 1 if and only if the first part in x is not 1. Continuing through the other parts shows that the first difference between elements x and y of A causes a difference in f(x) and f(y). Hence f is injective. By the same argument, the function g: B — A defined in the same wayis also injective. Hence |A| = |B]. 1.1.41. Compositions of integers. a) Over all compositions of k, the total number ofparts is (k + 1) The compositions correspond to the subsets of the k — 1 spaces in a row of k dots. Each j-element subset yields a composition with j + 1 parts. The first dot starts a part in each composition. Each remaining dot starts a part in half of the compositions. Since the number of compositionsis 2*-1 the total numberofparts is 2*-!+(k—1)2*-?. (The same answercan be obtained by computing yi (j+ 1)(5-1) using techniquesor identities from Section 1.2.) Proof 1 (summation). Since there are ( i): By summing the Committee-Chair Qk-2 k-1 71) compositions with 7 parts, the total equals ean i( Identity over the committee size, we obtain Yea j (7-1) = Yo ("77) + aiU — 1(*}) = a1 + (k- 12"? = (kh + 12, Proof 2 (bijection). Alternatively, compositions correspond to sub- sets of the spaces amongk dots. b) Over all the compositions of k, there are (k — m + 3)2*-™parts equal to m, where 1 <m<k. Elementsof the set A;,. being counted are expressible as the pairs (C, 7), where C is a composition of k and j isa marked copy of min C. Subtracting 1 from the markedcopy of m yields a pair (C’, 7’) in Ax_1,m-1. The mapis injective and surjective, so the sets have the samesize, as desired. This leaves the problem of counting A;1. Proof 1 (direct argument using part (a)). Skipping any 1 in a com- position of k leaves a composition of k — 1, and each composition of k — 1 with j parts arises in 7 + 1 ways by doing this. That is, each composition of k—1 with j parts yields 7 + 1 parts of size 1 among compositionsof k. The answeris thus 1 for each composition of k— 1 plus the answerof part (a) for k — 1: 24-2 + k2*-8 = (k + 2)2*-3. Theresult is the special case of the claimed formula for m = 1. Proof 2 (induction on k). Let ag, = |Ag_;|. Note that ag = 2 = (2—1+8)2?-!* = 2. For k > 2, group the compositions by thelast part.
  • 16. Section 1.1: Classical Models 16 With last part 1, the total numberof1s is ag_; + 2*~”, since there are 2*~? compositions of k — 1. With last part 7, where 2 < j < k — 2, the totalis a,—;, and there is 1 with last part k-—1. Thus a, = 1+ Qk-2 4 Yi Ap}. We can apply the induction hypothesis and then perform the sum. To avoid performing the sum, subtract consecutive instances to obtain for k >8 that az, — az_) = 2°? — 2°? + a;z_1. Now the induction hypothesis yields a; = 2(k + 1)2*-4 + 2'-3 = (k + 2)2*°3. Proof 3 (induction variation). For k > 2, reduce the last part by 1 to obtain a composition of k — 1. Each such composition arises twice, by deleting a final 1 or by reducing final part larger than 1. Counting 1s over all resulting compositions thus yields 2a,_;, but we lost one for each of the 2*-? compositions of k ending in 1, and wegainedonefor each of the 2*-° compositions of k ending in 2. Hence a; = 2a,z_; + 24-2 — 24-3 = (k + 2)2*-3, Proof 4 (overall induction, sketch). One can also do the whole prob- lem by induction on k for fixed m. The inductive ideais like that in Proof 2 or Proof 3, with adjustments for the copies of m that arise or disappear. The computations are not as clean as above, so we omit them. ec) 1+ yk —m+8)2*-™? = (k + 1)2*-*. By parts (a) and (b), both sides countall parts in all compositions of k (the extra 1 counts the composition whose only partis k). 1.1.42. The Weights Problem. The set S, = {1,3,...,3*+} permits the checking ofall integer weights from 1 through (3* — 1)/2 ona balancescale, and no otherchoice of k known weights permits more values to be checked. Let f(k) = (3* — 1)/2. We first prove that S; permits us to balance object A, of integer weight n for 1 <n f(k). It suffices to express n as yo 6;3', where each b; € {-1, 0,1}, because then interpreting —1,0,1 for 6; to mean “sameside as A,,”, “off the balance”, and “side opposite to A,,” yields an explicit configuration of the weights that balances A,. Wefind the desired numbers {b;} using the ternary expansion of the number n’ = n+ f(k). The equation n = yo b;3' holds if and only if the equation n’ = yo (b; + 1)3’ holds, because the geometric sum yields (3*-1)/2 = yo 3’. Since n < f(k), we haven’ < 2f(k) = 3*—1. Ternary expansion guarantees a (unique) expression of n’ as n’ = yo a;3' with each a; € {0,1, 2}. Setting b; = a; — 1 yields an explicit way to weigh n. Wealso must prove that no other set ofweights can balance moreval- ues. We count the possible configurations: each weight can be placed on the left, on the right, or omitted, generating 3’ possible configurations. The configuration that omits all weights balances no nonzero weight. Of the remaining 3*—1 configurations, each balances the same weight as the
  • 17. L7 Chapter 1: Combinatorial Arguments configuration obtained by switching the left pan and right pan. Henceat most (3* — 1)/2 distinct values can be weighed. The construction for the lower bound can also be established using induction on k. The advantage of the bijective proof is that it gives an explicit description of the configuration used to balance a given weight. 1.1.43. Using weights w, < --: < w, on a two-pan balance, where S; = >), Wi, every integer weight from 1 to S,, can be weighedifand only ifw; = 1 and wj41 < 2S; +1 for 1 < j <n. For sufficiency, we use induction on n. When n = 1, the condition forces w; = 1, and the weight 1 can be balanced. For the induction step, consider n > 1, and suppose that the condition is sufficient for n — 1 weights. For 1 <i < S — wy, the induction hypothesis implies that we can weigh i using {w,,...,W,_1}. With w, also available, we can also weigh w, — i and w, + i, so we can weigh every weight from wy, — S,_1 to Wn + Sn_-1 = Sy, using {w1,..., Wn}. Since wy, — Sn-1 < Sy-1 + 1 by hypothesis, we can weigh every weight up to S,. For necessity, suppose we can balance all weights from 1 to S,. The second largest possibility is S, — w1, required to be S, — 1, sow, = 1. If wj41 > 2S; + 1 for some j, then let W = S, — 2S; — 1; we claim that W cannot be weighed. The largest weight achievable without putting all of {wj+1,...,Wn} in one pan is S, — wj+1 < W, but the smallest weight achievable usingall of {wj+1,..., Wn} in one pan is S, — 2S;, which ex- ceeds W. 1.1.44. Regions in cevian arrangements. From the three points x, y, z on acircle, chords emerge and reach the circle between the other two points. When counting regions, we can view this as chords from a vertex ofa tri- angle to the opposite side (these are called cevians in geometry). From each cevian arrangement with i, 7,k chords emerging from x,y,z, respectively, we can reach every other such arrangement byit- eratively sliding the foot of one chord. When a chord reaches the inter- section of two other chords, we temporarily lose a region, but the count is restored when the chord emerges from the intersection. Thus every configuration without triple intersection points achieves the maximum numberof regions. Proof 1. The regions become easy to count when the chords from each vertex reach the circle near the next vertex, cyclically. The chords from x and y then form a small grid of ij regions near y. Near the xy edge, the chords from x formi regions. Repeating this cyclically counts all the regions except one central region, and the total isij + jk+kit+i+t J+k+1.
  • 18. Section 1.1: Classical Models 18 Proof 2. Having observed that the maximum occurs whenthere are no triple-points and that each chord intersects every other, one can count the regions formed as chordsare placed. First chords from x each split 1 region when added. Then the chords from y split i + 1 regions each. Finally the chords from z split i+ 7 + 1 regions each. Starting from a single initial region, the total becomes 1+i(1)+ jG+1)+kGt+74+1) =ij+ik+jkt+it+j+k+1. Proof 3. Having observed that the maximum occurs when there are no triple-points and that each chord intersects every other, one can treat the configuration as a planar graph and apply Euler’s Formula. Here the computations are a bit more complicated, and we are not assuming Eu- ler’s Formula. 1.1.45. When n is divisible by r, and a k-set is chosen from |n] uniform at random, where gced(k, r) = 1, the probability that the sum ofthe k-set is divisible by ris 1/r. We prove more generally that the sum is equally dis- tributed over the congruence classes modulo r. For any k-set, adding 1 to each element (n turns into 1) produces another k-set whose sum mod- ulo r is larger by k. Since gcd(k, r) = 1, the original congruenceclassis not revisited until r steps later, after one k-set has been found in each congruence class. Since n is divisible by r, the translates of a given k-set contribute equally to the r congruence classes. Since translation parti- tions the k-sets into disjoint classes, and the claim holdsfor eachclass, the distribution overall the k-sets is also uniform. 1.1.46. Forn,m,k € N with k <n, >i=0 mite = 1. Consider a deck of n blue cards and m red cards. A player pulls cards at random without replacement and wins when k blue cards are obtained. The probability of winning is 1, since k < n. We compute the probability that the player wins after drawing exactly 7 red cards, where 0 < j < m. Theprobabil- ity that exactly k of the first k + j cards are blue is (Z)(")/ (Ey) The probability that the last card is blue given that exactly k of the first k+ /
  • 19. 19 Chapter 1: Combinatorial Arguments cards are blueis k/(k+,j). Hence the probability ofwinning after drawing exactly 7 red cardsis me: Summing over j completes the proof. +7 1.1.47. If f: A— Band g: B > Aare injections, then there exists a bijec- tion h: A —> B, and hence A and B have the same cardinality. (Schroeder- Bernstein Theorem) We view A and B asdisjoint sets, making two copies of commonele- ments. For each element z of AU B, we define the successorof z to be f(z) if z € A, and g(z) if z € B. The descendants of z are the elements that can be reached by repeating the successor operation. We say that z is aprede- cessor of w if w is the successor of z. Because f and g are injective, every element of A U B has at most one predecessor. The ancestors of z are the elements that can be reached by repeating the predecessor operation. The family of z consists of z together with all its ancestors and de- scendants;call this F(z). We use the structure of families to define a one- to-one correspondence between A and B. The successor operation defines a function f’ on A U B; below we show several possibilities for families using a graphical description of f’. First suppose that z is a descendant of z. Because every element has at most one predecessor, in this case F(z) is finite (repeatedly composing the successor function leads to a “cycle” of elements involving z). Apply- ing f’ alternates between A and B, and thus F(z) has even size. For every x € Ain F(z), we pair x with f(x); because F(z) has even size, this is a one-to-one correspondence between F(z) A and F(z)N B. Otherwise, F(z) is infinite. In this case, the set S(z) of ancestors of z maybe finite or infinite. When S(z)is finite, it contains an origin that has no predecessor(all elements of F(z) have the same origin). If S(z) has an origin in B, then for every x € AN F(z) we pair x with its predecessor g(x); because B containstheorigin, g~!(x) exists. When S(z)is infinite or has an origin in A, we pair x with its successor f(x).
  • 20. Section 1.2: Identities 20 Because every element has at most one predecessor, the pairing we have defined is a one-to-one correspondence between the elements ofA and the elements of B within F(z). Since the families are pairwise disjoint, it is also a one-to-one correspondence between A and B. In moretechni- cal language, we have defined the function h: A — B by h(x) = g™}(x) when the family of x has an origin in B, and h(x) = f(x) otherwise. The function h is the desired bijection. 1.2. IDENTITIES 1.2.1. Combinatorial proofs of (,",) = %*(j) and (min) (meh) = (™"")(2). To choose k + 1 elements from [n], one can first choose k and then choose one element from the remaining n—k. This marks one element asspecial, which could be any of the k + 1 chosen elements, so each (k + 1)-set has been counted k + 1 times. For the second equality, both sides are 0 unless 0 < k <n. Both sides count the ternarylists of length m+n in which m positions are 0 and k of the remaining n positions are 1. On the right side, choose the positions for Os and then the positions for 1s. On theleft side, first choose all the positions for 0s and 1s, and then among them choose the positionsforIs. 1.2.2. Wiig ("f*) = (2241). After applying complementation to convert m+1 the summandto (th), the Summation Identity evaluates the sum. 1.2.3. (9) - (",”) = (1) + CO*). Using Pascal’s Formula twice, n _[(n-1l 1 n-1 [n-1 1 n—-2 4 n-2 k) k-1 k k-1 k-1 kk} 1.2.4. Pascal’s Formula holds for the extended binomial coefficient. We take the coefficient (%) to be 0 when k < 0, so the formula holds when k =1. Fork >1, we use (2) = 4% ! Th,vu-j=e vof+i(°,) with v equal to u—1 and then u to compute (a)(ta)=elem)(ema)=eta)=e} 1.2.5. >,(,",)(,°.)=(3). Setting 1 = n—k, the sum becomes mtn ~, (.-))(;), and the value is given immediately by the Vandermonde convolution.
  • 21. Zl. Chapter 1: Combinatorial Arguments 1.2.6. a =0 (er‘)= ke =0 (er*) and ae(-re) = (er): For thefirst equality, applying complementation to convert the summandsto (”**;') and ("**1) allows the Summation Identity to evaluate the two sides to (""") and (”*"), which are equal. Applying complementation to the second factor in the summandcon- verts the sum to >>, (7)(,,”_;), which evaluates by the Vandermondecon- r—k volution to (""”), whichequals em) 1.2.7. Evaluationof (|). Using the definition, k-1 k-1 —1 1 , (-1)4 ( k )- allo-9= Sr [[e+n=Co* 1.2.8. Summingthefirst npositive numbers. Inthe formulas i” = 2(3)+({) and i? = 6(3)+6(5)+(j{), the left side counts k-tuples from an i-set, where k € {2,3}. On the right for k = 2, we can choose two distinct elements in is) ways andlist them in either order, while if we use the sameele- ment twice there are i choices. For k = 3, there are six orders in which we can list three distinct elements. When using only two elements, we choose them, pick which of the two to use only once, andpick its location, yielding 6(5). Again there are i ways to use only one element. We use the Summation Identity to perform the sums. yi). (nt+1_ nti) Se sS((5!)=m i=1 i=1 “2 CO, [i i o(n+1 nt+1_ n(n+1)(2n-2+8) d= Dafa}(i)=2("5!)*("a |)= = 3 - l L t (n+l n+1 n+1 r= Dofs)*s)*()=e( a )ee("s Je | = n(n 1) (C=VED 1) 45) = nine 1)E™ As an application, n >(2 + 372 —5i) = i=1 n2(n+1)? n(n+1)(2n+1) rn + 1) 2. - 2 oo n(n+1) 2n+1 5 = nin + 1)( wo ~ 5) = nin + Din Din +4)
  • 22. Section 1.2: Identities 22 1.2.9. There are dp, ways to put m white and n black marbles into boxes if each box has at most one marble of each color and no box is empty until all marbles are used. The boxes in order correspond to steps in a Delannoy path. The steps can be horizontal (white marble) or vertical (black mar- ble) or diagonal (one marble of each color). When all marbles are used, the path will reach (m, n). 1.2.10. A triple product identity. We use the Committee-Chair Identity twice, reorder the factors, and use it two more times. n—-1l n n+1 (n-1 n [n-1n+1/[ n (alana) k )= (hoa) al k (21) _[n-1|n+1n(n-1 n _ (n-1/n+1 n -( k eTta) = ( k erate) 1.2.11. Identities by induction, using Pascal’ Formula. a) The binomial coefficientformula (7)= En Br The formula holdsfor n = 0 under the convention that the “factorial” of a negative numberis infinite. For n > 1, Pascal’s Formula and the induction hypothesis yield (n=l 1) (n-1)! (n-1)! _ n-k nl kn! ! Q=C(e) +e) = nab + Gee = a mone + nee! = AG 1.2.12. When flipping 100 fair coins, the number of heads andtails are morelikely to differ by 2 than be equal. Proof 1 (computation with factorials). The probability ofequal num- bers is (‘{)’)/21°. The probability of differing by 2 is 2(7j)’)/2!°, sinceei- ther heads or tails may be extra. For the ratio, we cancel like factors and compute sygmsit = gag <1. Proof 2 (combinatorial argument). Given any string with 50 heads and 50 tails, switching the last flip yields a string in which the numbers differ by 2. Distinct strings get mappedto distinct strings, so the mapis injective. Furthermore,strings in which the last entry is in the minority do not arise, since flipping it from equal weight makesits new value occur 51 times. Hence there are strictly more differing by 2. b) The Summation Identity ", (;.) = (f1;) forn, k = 0. For n = 0, the identity reduces to (?) = (,,,); both sides equal 1 if k = 0 and 0 if k>0. Forn> 1, the induction hypothesis and Pascal’s Formula yield or(i) = (8) + DE (i) =) + (a) = (RE). c) The Binomial Theorem (x + y)” = Yo (Z)x*y""*. For n = 0, we have (x + y)° = 1 = (})x°y®. For n > 0, the induction hypothesis gives (xt yl = mo (",*)x*y"-I-k| We multiply both sides by (x + y) and simplify the resulting expansion. To combine terms where the exponents agree on x and agree on y, we shift the index in the first summation. We
  • 23. 23 Chapter 1: Combinatorial Arguments then use Pascal’s Formula to combine corresponding terms. For the extra terms, (”;) = 1 = (”) and (”)') = 1 = (G); these become the top and bottom terms of the desired summation. The full computationis n—-1 noe r Ryn’ n—-1 n — n—-1 n—1 k,,n—-k n _ k,n—-k * ‘elee)-te! “s“e (ie k=1 k=0 d)An alternating sum: Yeo(-1)(i;) = (";'). We prove this for n, k > 0. For n = 0, the conventionsfor binomial coefficients yield 0 on both sides unless k = 0 (where they equal 1). For n > 0, the induction hypothesis and Pascal’s Formula yield {on -|{(n-1 n-1l doo, ‘ ~ dv lé - ) r (, ~j- :)| : (n-1 : ({ n-l ~ yooh ) r den,” 1- :) _(n-2 n-2 [n-1l ("a")(ea)=("i') 1.2.13. Combinatorial transformationsfor summing min{i, j} and max{i, j}. a) Viet Veja Min{i, J} = Var Fe. Proof 1. Consider an arrangement of unit cubes piled atop the square with opposite corners (0,0) and (n,n) in the plane. Thepile of cubes in position (i, 7) (that is, with upper right corner(i, 7)) has height min{i, 7}. Thus the sum on the left counts the cubes. The numberof po- sitions wherethe pile has height at least (n—k+1) isthe numberofpairs (i, 7) such that both i and j belong to the set {n —k+1,...,n}. There are k? such pairs, so grouping the cubesby the height of their position yields the sum an k?. (Without geometry, this argument is the same as summingthe entries of a matrix with min{i, 7} in position (i, /).) Proof 2. Both sums count the squares with positive integer side- lengths formed by the lines y = 0,...,y =nandx=0,...,x =n. There
  • 24. j}. Section 1.2: Identities 24 are k? such squares with side-length n + 1 — k, so the sum on the right counts them by size. The sum on the left groups them by the upperright corner. The numberof squares in the set whose upperright corneris the point (i, 7) is precisely min{i, 7}, and we sum overall choices for i and /. Proof 3. Both sums count the 3-tuples of integers from [n]| in which the third element is smallest. When thefirst two elements are (i, 7), there are min{i, 7} choices for the third element. When the third elementis r, there are n —r+1 choices for each of the first two elements. Letting k=n-r+1 again yields thesum )°7_, k’. b) yr, kh? = 2("3")+("3"). Both sides count 3-tuples(r, s, t) € [n+1]? such that t > max{r, s}. The sum on theleft counts the triples according to the value of t; when t = k+1, there are k? ways to specify r and s. The terms on the right group the triples according to whether r = s. If so, then we pick two elements and put the larger in ¢t. If not, then we pick three, put the largest in t, and choose either orderfor r ands. ce) yey Vijay Min{i, j} = gn(n+1)(2n+ 1) and Yr, Y_, max{i, j} = an(n + 1)(4n — 1). For the first sum, we invoke parts(a) and (b) and then compute 2("3")+("3") = 3(n+1)n(n—-1)+ $(n4+1)n = (n+ I)n[2n-2+3]. For the second, since min{i, 7} + max{i, 7} =i+ 7, we subtract thefirst sum from }Yy_, );-,(i+ j), which equals n }Y_,i +n i, J, or 2n(”5"). Thefinal value is (n+ 1)n[n— £(2n+1)], which yields the desired formula. Comment: These identities can also be obtained by algebraic manip- ulation of known identities involving things like sums of squares. 1.2.14. 0(m— j)2i-! = 2" —m-1. Proof 1 (induction). Let f(m) denote the given sum. Note that f(m)- f(m-1) = an 2/-1=2™1_1, Also f(0) = 0, since the sum is empty. Therefore, f(m) =D",(F@- f@-D) = OM4-1) = 2" -1-m. Proof 2 (counting two ways). The family of all subsets of [m] with size at least two has size 2” — 1—m. The given sum countsthis by the position of the next-to-last 1 in the incidence vector. When the next-to- last 1 is in position 7, there are m — j choices for the rightmost 1 and 2/-! waystofill the first 7 — 1 positions. The sum counts precisely the incidence vectors with at least two 1s, because those are the vectors that have a next-to-last 1. 1.2.15. Combinatorial argumentsfor identities. a) (*”) = 2(°"|'). To pick a set ofsize n from [2n], one can use element n and choose n — 1 from the remaining 2n — 1 elements to add, or omit element n and choosen — 1 from the remaining 2n — 1 elements to omit.
  • 25. 25 Chapter 1: Combinatorial Arguments b) ©, (7)(7) = (7)2”-). The kth term in the sum counts the ways to form a committee of size k with a subcommittee of size / from a set of n people, choosing the committee first and then the subcommittee. When we sum over k, we are consideringall possible sizes for the committee, so the sum countsall possible committees with a subcommitteeofsize /. Selecting the subcommittee first can be done in (a) ways, and then the rest of the committee can befilled by choosing an arbitrary subset of the people that remain. Thus the right side also counts this set. The proofcan equivalently be phrased by saying that both sides count the ternary n-tuples with / zeros. c) HI gel= 7 forg,n€N. Consider a tournament with q” play- ers in which gamesinvolve q players and exactly one survives. In thefirst round,there are gq”! games.In the jth round, g”/*+ players remain and there are g”/ games. In the nth round,there is one game, and the win- ning survives. Setting k = n+1-—/ shows that the left side ofthe identity is the total number of games. On the other hand, gq” — 1 players must be eliminated, and each game eliminates g—1 players, so the right side also counts the games. d) *_, i(n—i) = “_, (). Both sides count the 3-element subsets of [n+1]. The left side groups them according to the middle element; there are i(n — i) triples in which the middle element isi+1. The right side groups them according to the top element; there are (5) triples in which the top element is i+ 1. 1.2.16. Strehl’s Identity: ©, (”)(*) =O, (%)”. Proof 1 (Vandermonde convolution). Special cases of the Vander- mondeconvolution include )*, (7)(;) = ("*°) and ©, (“)(,",) = (7). With these (at the beginning and end), the Subcommittee Identity, and revers- ing the sum on k, we compute (2)= SOY)- xX QOZWH) EE(NOI)-20)ECE Ele)ECMO)EHO “E(i)() Proof 2 (counting two ways). Given n distinct red cards and n dis-