LN 2
LN 2
LN 2
KRISHNA KAIPA
Abstract. Class notes for the course MTH318 Combinatorics at IISER-Pune during August se-
mester of 2019.
1. Introduction
The course policy can be found on the course webpage
www.iiserpune.ac.in/~kaipa/teaching/MTH318.
In this introductory lecture, we gave an overview of the contents of the course. Then we discussed
two problems without going into details, in order to motivate the subject and its methods.
(1) Let bn,k denote the number of ways to pick k objects out of a set of n-objects with repetition
(i.e. with replacement). This is also the number of ‘monomials’ X1a1 X2a2 . . . Xnan with ai
non-negative integers satisfying a1 + · · · + an = k. We talked about the generating functions
method to obtain this number bn,k .
Consider the ‘formal power series’ Bn (x) = k≥0 bn,k xk .
P
ClearlyP b1,k = 1 for all k ≥ 0 and hence B1 (x) = 1 + x + x2 + . . . . Then we showed that
bn,k = j bn−1,j by considering the possible values for an in the monomials interpretation
above. This gives Bn (x) = (1 + x + x2 + . . . )Bn−1 (x). Thus Bn (x) = (1 + x + x2 + . . . )n .
Since (1 + x + x2 + . . . )(1 − x) = 1, it follows that Bn (x)(1 − x)n = 1. From this, it can be
shown (see §2 below) that bn,k = n+k−1
k
.
1
2 KRISHNA KAIPA
As an example of multiplication, check that the product of the formal geometric seriesP1 + X +
X + . . . with the formal series 1 − X is just the series 1. More generally the formal series i≥0 ai X i
2
has a multiplicative inverse if and only if a0 6= 0. When a0 6= 0 the multiplicative inverse is unique.
(See
PAssignment 1).PThe formal derivative of the monomial X i is iX i−1 . We define the derivative
of i≥0 ai X to be i≥1 iai X i−1 . Given formal series a(X) and b(X), the product rule
i
d d d
dX
a(X)b(X) = ( dX a(X))b(X) + a(X)( dX b(X))
holds (See Assignment 1). As in calculus, there is also a higher-order derivative version of product
rule (See Assignment 1)
Xn
dn n
di dn−i
dX n a(X)b(X) = i
( dX i a(X))( dX n−i b(X))
i=0
This gives
d n−1 n−1
( dX n−1 B1 (X))(1 − X) = (n − 1)!B1 (X).
Multiplying by (1 − X) we get
n−1
d n
( dX n−1 B1 (X))(1 − X) = (n − 1)!,
P1) (from [Brualdi]) How many seven-digit numbers are there such that the digits are distinct
integers taken from {1, 2, . . . , 9} and such that the digits 5 and 6 do not appear consecutively in
either order?
Ans: The desired number is 9 P7 minus the number of seven-digit numbers with the last condition
replaced by the condition that 5 and 6 appear together. The latter number is (7 P5 ) × (6) × 2, where
7 P5 is the number of five-digit numbers with distinct digits drawn from {1, 2, 3, 4, 7, 9}, and the
factor 6 is for the 6 places in this five-digit number where the symbol 56 or 65 can be inserted, and
the last factor of 2 is for the two choices 56, 65.
4 KRISHNA KAIPA
P3) (from [Brualdi]) How many eight-letter words can be constructed by using the 26 letters
{A, B, . . . , Z} if each word contains j letters from the set {A, E, I, O, U }? It is understood that
there isno restriction on the number of times a letter can be used in a word.
Ans: 8j · 5j · 218−j .
P4) (from [Brualdi]) A bakery has eight varieties of biscuits. If a box of biscuits contains 12
biscuits, how manydifferent options are there for a box of biscuits?
Ans: 1912
= n+k−1
k
with n = 8 and k = 12.
P4) (from [Brualdi]) What is the number of integral solutions of the equation x1 +x2 +x3 +x4 = 20
satisfying the constraints x1 ≥ 3, x2 ≥ 1, x3 ≥ 0, x4 ≥ 5 ?
Ans: same as the number of solutions in non-negative integers of the equation y1 +y2 + y3 + y4 = 11
where y1 = x1 − 3, y2 = x2 − 1, y3 = x3 , y4 = x4 − 5. Therefore, the answer is 14
11
= n+k−1
k
with
n = 4 and k = 11.
Permutations of Multisets
Consider a multiset {a1 · X1 , a2 · X2 , . . . , an · Xn } of n distinct objects Xi appearing with multiplicity
ai ∈ N for 1 ≤ i ≤ n. (Here all ai ’s are finite. The number of permutations of this multiset is:
(a1 + · · · + an )!
.
a1 !a2 ! . . . an !
Let m be the desired number. If the multiple copies of each symbol Xi are treated as being distinct,
then the number of permutations is clearly (a1 + · · · + an )!. But this also equals the number m in
question multiplied by the number (a1 !a2 ! . . . an !) of permutations of the ai copies of Xi for each i.
Thus we get the asserted formula for m.
It is complicated to write down a general formula for the number of r-permutations of this mul-
tiset. But for given n, r, ai ’s we can always determine the number
P6) (from [Brualdi]) Consider the multiset S = {3 · x, 2 · y, 4 · z} of nine objects of three types.
Find the number of 8-permutations of S.
Ans: The desired number is the number of 8-permutations of {2 · x, 2 · y, 4 · z} plus the number of
8-permutations {3 · x, 1 · y, 4 · z} plus the number of 8-permutations of {3 · x, 2 · y, 3 · z}. Hence the
answer is 8!/(2!2!4!) + 8!/(3!1!4!) + 8!/(3!2!3!). See also Assignment.
MTH 318: COMBINATORICS 5
We note that the equivalence relation constructed (above) from a partition of S, coincides with ∼
when the partition is by equivalence classes of an equivalence relation ∼. Similarly, the partition into
equivalence classes of an equivalence relation ∼ on S constructed (above) from a partition of S coin-
cides with the original partition. This shows that the assignment ∼ 7→ partition by eq. classes of ∼
gives a bijective correspondence between the set of equivalence relations on S, and the set of parti-
tions of S.
6 KRISHNA KAIPA
4. Assignment 1
(1) Given a multiset S = {a1 · x1 , . . . , an · xn } of size m = a1 + · · · + an . Show that the number
of (m − 1) permutations of S is the number of permutations of S.
(2) In how many ways can four men and eight women be seated at a round table if there are to
be two women between consecutive men around the table?
(3) A group of mn people are to be arranged into m teams each with n players.
(a) Determine the number of ways if each team has a different name.
(b) Determine the number of ways if the teams don’t have names.
(4) Prove that a power series i≥0 ai xi has a multiplicative inverse if and only if a0 6= 0. More-
P
over, the multiplicative inverse is unique when it exists.
(5) Prove the product rule and the higher-order derivative product rule for formal power series.
5. Pigeonhole principle
Pigeonhole principle states that if n > k identical balls are distributed among k boxes, then
there exists a box with at least two balls.
A proof by contradiction is as follows: let ni be the number of balls placed in the i-th box for
1 ≤ i ≤ k. Suppose ni ≤ 1 for all i, then
k
X
n−k = (ni − 1) ≤ 0,
i=1
contradicting n > k.
1) (from [Bona]) A chess tournament has n participants, and any two players play exactly one
game against each other. Then it is true that in any given point of time, there are two players who
have finished the same number of games.
For 0 ≤ k ≤ n − 1, let bk be the number of players who have played k matches at the given point
in time. We have b0 + b1 + · · · + bn−1 = n. If b0 = 0 or if bn−1 = 0, then by pigeonhole principle
(with k = n − 1) we get that some bi ≥ 2. The case in which both b0 , bn−1 > 0 is impossible because
b0 > 0 ⇒ bn−1 = 0.
2) (from [Bona]) There is an element in the sequence {7, 77, 777, 7777, . . . , } that is divisible by
2019.
Let ai demote the i-th element of the sequence. We claim there exists 1 ≤ i ≤ 2019 for which
ai is divisible by 2019. Suppose not, then the list of 2019 remainders ai mod2019 take values in
1, 2, . . . , 2018. By pigeonhole principle, there exist 1 ≤ i < j ≤ 2019 with ai = aj mod2019, i.e.
2019 divides the number 77 . . . 7 × 10i = aj−i · 10i . Since 10i is relatively prime to 2019, it follows
that 2019 divides aj−i contradicting the hypothesis. Therefore, there exists 1 ≤ i ≤ 2019 for which
ai is divisible by 2019.
3) (from [Brualdi]) A chess master who has 11 weeks to prepare for a tournament decides to play
at least one game every day but, to avoid tiring himself, he decides not to play more than 12 games
during any calendar week. Show that there exists a succession of (consecutive) days during which
the chess master will have played exactly 21 games.
Let ai be the number of games played at the end of day i. We have 1 < a1 < a2 < · · · < a77 ≤
12 · 11 − 132. Consider the list of natural numbers:
a1 , a2 , . . . , a77 , a1 + 21, a2 + 21, . . . , a77 + 21
If the list has repetition, the only possibility is that ai + 21 = aj for some i < j, which means that
on the days i + 1, . . . j exactly 21 games have been played. Therefore, it suffices to show that the
list has repetition. Suppose not, then the list has 154 entries. This is impossible because the largest
entry of the list a77 + 21 ≤ 132 + 21 = 153.
8 KRISHNA KAIPA
4) (from[Brualdi]) Chinese Remainder Theorem: Given relatively prime natural numbers m and
n, and integers 0 ≤ a ≤ m − 1 and 0 ≤ b ≤ n. There exists a natural number x such that
x ≡ a mod m and x ≡ b mod n.
6. Assignment 2
(1) (from [Bona]) (a) The set M consists of nine positive integers, none of which has a prime divi-
sor larger than six. Prove that M has two elements whose product is the square of an integer.
(b)* The set A consists of n + 1 positive integers, none of which have a prime divisor
that is larger than the n-th smallest prime number. Prove that there exists a non-empty
subset B ⊂ A so that the product of the elements of B is a perfect square. (Hint: rank
nullity theorem holds over any field including the binary field {0, 1} with 1 +1 = 0, 1 · 1 = 1.)
(2) (from [Bona]) Prove that among 502 positive integers, there are always two integers so that
either their sum or their difference is divisible by 1000.
(3) (from [Bona]) We select n + 1 different integers from the set {1, 2, . . . , 2n}. Prove that there
will always be two relatively prime integers among the selected integers.
10 KRISHNA KAIPA
Example (from [Bona]): Ten points are given within a square of unit size. Then there are two of
them that are closer to each other than 0.48, and there are three of them that can be covered by a
disk of radius 0.5. √
We divide the unit square into 9 equal squares. Each sub-square has diameter 2/3 < 0.48. By
pigeonhole principle, there exists a sub-square with at least 2 points.
Similarly if we divide √
the unit square into four equal sub-squares, then each sub-square has a cir-
cumcircle of radius 1/ 8 < 0.5.
Problem (1) from Assignment 2: a) Label the numbers n1 , . . . , n9 and write nj = 2aj 3bj 5cj . Con-
sider the 3×9 matrix A with entries over {0, 1} whose j-th column is (aj mod 2, bj mod 2, cj mod 2)T .
There are in total 8 elements of {0, 1}3 and hence two of the nine column are identical, say columns
i and j. Then ni nj is a square.
(b) Label the numbers m1 , . . . , mn+1 , and let the first n primes be denoted p1 , . . . , pn . Write
n
a
Y
mj = pi ij .
i=1
Let M be the n × (n + 1) matrix with entries in {0, 1} defined by Mij = aij mod 2. Treating M as
a matrix over the binary field F2 , and using the rank-nullity theorem, the matrix M has nullity at
least 1. So there exists a non-zero vector (c1 , . . . , cn )T ∈ Fn2 such that M c = ~0. Let B be the subset
of A consisting of those mj for which cj 6= 0. It follows that:
X
aij = 0 mod 2, ∀ 1 ≤ i ≤ n.
{j:cj 6=0}
There is also a combinatorial proof of the polynomial identity (3) : Since the polynomial on the
right has degree at most k, it suffices to show that this polynomial has more than k roots. We will
show that every natural number is a root. If x = n with n ∈ N, then x+1 k
is thenumber of size k
n
subsets of {1, . . . , n + 1}. The number of such subsets which contain n + 1 is k−1 and the number
n
of such subsets which do not contain (n + 1) is k+1 . Thus each x ∈ N is a root of (3).
Proof.
If k < 0 both sides of the identity are 0. If k = 0, then the left side is 1 and the right-side is
x y
0 0
= 1. If k > 0, then it suffices to show the following identity in the polynomial ring R[X, Y ]:
X k
X +Y X Y
0 = h(X, Y ) := − .
k i=0
k−i i
Note that the (total) degree of h(X, Y ) is at-most k. (This means that any monomial X µ Y ν that
appears in h(X, Y ) must satisfy µ + ν ≤ k). Therefore, we can write
k
X
h(X, Y ) = hi (X)Y k−i ,
i=0
for some polynomials hi (X) ∈ R[X] of degree at most i. We note that h(m, n) = 0 for m, n ∈ N:
indeed any size-k subset of the set {1, . . . , m+n} is the disjoint union
ofP n of {1, . . . , m}
a size i subset
m+n k m
and a size (k − i) subset of {m + 1, . . . , m + n}. Therefore k = i=0 k−i i . In particular
for m ∈ N, the polynomial h(m, Y ) in R[Y ] of degree at most k has infinitely many roots (namely
Y = n for n ∈ N), and is hence the zero polynomial. Therefore
k
X
h(m, Y ) = hi (m)Y k−i = 0,
i=0
(here 0 is the zero polynomial in R[Y ]). This, in turn shows that for each 0 ≤ i ≤ k, the polynomial
hi (X) ∈ R[X] of degree at most i has infinitely many roots (namely X = m for m ∈ N), and is
therefore the zero polynomial. Returning to the expression h(X, Y ) = ki=0 hi (X)Y k−i , we conclude
P
that h(X, Y ) is the zero polynomial in R[X, Y ].
Example: Setting y = −1 and x = n in (4) and using the fact that −1
i
= (−1)i we get the
identity
X k
n−1 k−i n
= (−1) .
k i=0
i
Another generalization of (2) is as follows. Repeatedly using (2) (n + 1)-times (where n is a
non-negative integer), we get:
x+1 x x−1 x−n x−n
(5) = + + ··· + + .
k+1 k k k k+1
In particular for x = n where n is a non-negative integer, k ≥ 0 (or more generally k 6= −1) we
have:
X n
n+1 n n−1 0 j
(6) = + + ··· + = .
k+1 k k k j=k
k
The most well known identity about binomial coefficients is the duality
n n
(8) = for n ∈ {0, 1, 2, . . . }, k ∈ Z.
k n−k
This follows from the symmetric expression n!/(k!(n − k)!) for either side of the identity.
Lemma 2. (Unimodality of binomial coefficients) Let 0 ≤ k ≤ n be integers. If n is even then the
maximum value of nk as a function of k occurs for k = n/2, and:
n n n n n
< < ··· < > > ··· > .
0 1 n/2 n/2 − 1 n
If n is odd, then the maximum value of nk as a function of k occurs at k = (n − 1)/2 and
k = (n + 1)/2, and:
n n n n n
< < ··· < = > ··· > .
0 1 (n − 1)/2 (n + 1)/2 n
Proof. This follows from the fact that
n
k − n−1
k k+1 2
n −1= −1=2 ,
k+1
n−k n−k
is negative if k < (n − 1)/2, positive if k > (n − 1)/2 and zero if k = (n − 1)/2.
For n ∈ {0, 1, 2, . . . }, the n-th Pascal matrix An of size (n + 1) × (n + 1) matrix defined by
Aij = j−1i−1
. The matrix An is upper triangular and has ones on the diagonal, and is hence
invertible.
Lemma 3. The ij-th entry of A−1
n is (−1)
i+j
times the ij-th entry of An . In other words,
1 ! 1 !
−1 −1
.. An .. .
. .
(−1)n (−1)n
In long form:
X
i+q p i
(−1) = δpq , p, q ∈ {0, 1, 2, . . . }
i
i q
Proof. Let V be the (n + 1)-dimensional vector space of polynomials in one variable X of degree at
most n and real coefficients:
V = {a0 + a1 X + · · · + an X n : a0 , . . . , an ∈ R}.
The function T : V → V given by T (f (X)) = f (X + 1) is a linear transformation. The matrix of T
with respect to the basis {1, X, X 2 , . . . , X n } is clearly An . The inverse transformation T −1 is given
by T −1 (f (X)) = f (X − 1). Since
(X − 1)j−1 = X j−1 − (j − 1)X j−2 + · · · + (−1)j−1 X 0 ,
it follows that the ij-th entry of the matrix representing T −1 is (−1)i+j j−1
i−1
.
Two other proofs of this result are in the Assignment.
14 KRISHNA KAIPA
9. Assignment 3
(1) Prove Lemma 3 by considering
1 dr
(1 + X)m .
r! dX r |X=−1
(2) Show the long form of Lemma 3 by first proving the identity:
n k n n−m
= .
k m m k−m
(3) Give two proofs –one combinatorial and one algebraic– of the following identities:
P n2
(a) 2n = .
P n k nk
n
(b) k k = 2 .
(c) i pi qi = pq 2p−q , p, q ∈ {0, 1, 2, . . . }.
P
Given an antichain A, for each A ∈ A let CA denote the set of all maximal chains of S which
contain A. If A, B ∈ A, then we note that CA and CB are disjoint because, as noted above, a chain
can contain at most one of A and B. Therefore, the quantity
X
|CA |,
A∈A
is the number of those maximal chains of S which have at least one element in common with A.
This number is clearly less than the number of all maximal chains of S, which as observed above is
n!. Hence, we get
X
(9) n! ≥ |CA |
A∈A
For each 1 ≤ k ≤ n, let αk denote the number of elements of A of size k. We must show that
n
≥ |A| = α1 + α2 + · · · + αn .
bn/2c
We also know that if |A| = k, then |CA | = k!(n − k)!. Therefore:
n n
X X X αk
|CA | = αk k!(n − k)! = n! n
A∈A k=1 k=1 k
(2) How many sets of three integers between 1 and 20 are possible if no two consecutive integers
are to be in a set?
(3) Use the pigeonhole principle to prove that the decimal expansion of a rational number m/n
eventually is repeating. For example,
34478/99900 = 0.34512512512512512 . . .
(4) (a) Show that if n + 1 integers are chosen from the set {1, 2, . . . , 2n}, then there are always
two which differ by 1.
(b) Show that if n + 1 distinct integers are chosen from the set {1, 2, . . . , 3n}, then there
are always two which differ by at most 2.
(c) Generalize the previous two parts of this problem.
(5) A collection of subsets of {1, 2, . . . , n} has the property that each pair of subsets has at least
one element in common. Prove that there are at most 2n−1 subsets in the collection.
Pn k n
k
(6) Evaluate k=0 (−1) k 10 .
12. Quiz-1
(1) ([5 points]) Consider the multiset {n · a, 1, 2, 3, ..., n} of size 2n. Determine the number of
its n-combinations.
(4) ([5 points]) There are 100 people at a party. Each person has an even number (possibly zero)
of acquaintances . Prove that there are three people at the party with the same number of
acquaintances (i.e. who know each other).
Answers.
(1) An n-combination of the given multiset is the same as the multiset formed by taking a with
multiplicity µ together with a size (n − µ) subset of {1, 2, . . . , n} for some 0 ≤ µ ≤ n. Thus
the desired answer is :
n
X n
= 2n .
µ=0
µ
Alternative Solution: We give another solution which is more complicated and hence not
preferable. But it does illustrate some binomial coefficient identities and generating function
techniques. Let X be the original multiset and let Y be the multiset {∞·a, ∞·1, . . . , ∞·n} of
n+1 distinct objects each having infinite multiplicity. Note that for treating n-combinations
of X, we may assume that the multiplicity of a in X is ∞ instead of n. The number of n-
combinations of Y is (n+1)+n−1 2n
n
= n
. Let Bi ⊂ Y denote the set of those n-combinations
of Y in which the element i of Y is used more than once. Clearly, the set of n-combinations
of X consists of the complement of ∪ni=1 Bi in the set of n-combinations of Y . Also for
I = (i1 , . . . , ik ) with 1 ≤ i1 < · · · < ik ≤ n, we have
(n + 1) + (n − 2k) − 1 2(n − k)
| ∩i∈I Bi | = = ,
n − 2k n
as it is equal to the number of solutions of y0 + y1 + · · · + yn = n − 2k with all yi being
non-negative integers. By the inclusion-exclusion principle, the number of n-combinations
of X is:
2n
Pn k−1 n 2(n−k)
Pn k n
2(n−k) P n−j n 2j
n
− k=1 (−1) k n
= k=0 (−1) n−k n
= j≥0 (−1) j n
.
MTH 318: COMBINATORICS 19
where D = d/dX. Since Dn (1 − X)−1 = (1 − X)−(n+1) /n!, we need the constant term in the
Laurent-expansion of
(1 + X)n /(X n (1 − X))
which is the same as the coefficient of X n in the power series:
(1 + X)n (1 + X + X 2 + . . . ).
We conclude that the answer is ni=0 ni = 2n .
P
(2) The desired number is the coefficient of X n in
(1 + X)m1 (1 + X)m2 (1 + X)m3 = (1 + X)m1 +m2 +m3 .
Therefore, the answer is m1 +mn2 +m3 .
(3) The desired number is the same as the the number of permutations of the multiset
F 2 L3 O2 C 4 N 3 A2 U 1 H 1 P 1 T 1
of size 20 (we just removed the 9 I’s) multiplied by the number of ways to pick 9 spots
from the 21 spots consisting of the positions preceding, following and intermediate to the
20 letters created in step 1. This works out to be:
20! 21
×
2!3!2!4!3!2!1!1!1!1! 9
(4) Let n0 , n2 , . . . , n98 denote the number of persons in the party who have 0, 2, . . . , 98 acquain-
tances respectively. Suppose ni < 3 for all i. Since n0 + · · · + n98 = 100, we must have
ni = 2 for all i. Let A and B denote the 2 persons having zero acquaintances. The set of
acquaintances of any person C excludes at least 3 persons namely A, B, C. Thus n98 = 0,
contradicting the fact that n98 = 2. So the assumption that ni < 3 for all i is false.
20 KRISHNA KAIPA
Inclusion-Exclusion Principle
Let A1 , A2 , . . . , An be finite subsets of a set S. Then
| ∪ni=1 Ai | = E1 − E2 + E3 + · · · + (−1)n−1 En ,
where
X
Ek = |Ai1 ∩ Ai2 ∩ · · · ∩ Aik |.
1≤i1 <i2 <···<ik ≤n
We also define E000 = |An |. It is understood that the quantities are zero when the summation runs
over an empty set: for example En0 = En00 = 0. We note that :
Ek = Ek0 + Ek−1
00
, 1≤k≤n
For 1 ≤ k ≤ n − 1 define Bi = Ai ∩ An . We can rewrite the expression for Ek00 as:
X
Ek00 = |Bi1 ∩ Bi2 ∩ · · · ∩ Bik |.
1≤i1 <i2 <···<ik ≤n−1
Therefore
n
X n−1
X n−1
X
(−1) i−1
Ei = (−1) i−1
Ei0 + E000 − (−1)i−1 Ei00 .
i=1 i=1 i=1
We will now show how this result implies the inclusion-exclusion principle. First we make an
observation:
Let B1 , . . . , Bn be subsets of a set S. Let X = {1, . . . , n} and 2X the power set of X. For each
element I of 2X , i.e. for each subset of X, let SI denote the subset of S consisting of those elements
which belong to Bi for each i ∈ I but do not belong to Bj for j ∈ / I. In this definition, note that
n n
S∅ = S \ (∪i=1 Bi ) and SX = (∩i=1 Bi ). Clearly each element of S is in exactly one of the SI ’s. Thus
a
S= SI ,
I⊂X
where
SI = (∩i∈I Bi ) ∩ (∩j ∈I
/ (S \ Bj )).
At this stage we note that a
(∩i∈I Bi ) = SJ
J⊃I
Consider the function f : 2X → R given by f (I) = |SX\I |. Using the previous equality, we have
X
f † (I) = |SX\J | = | ∩i∈I
/ Bi |.
J⊂I
MTH 318: COMBINATORICS 23
The equality between the first and last terms of this chain of equalities is the inclusion-exclusion
principle.
24 KRISHNA KAIPA
15. Assignment 4
(1) Let n be a positive integer and let p1 , p2 , . . . pk be all the different prime numbers that divide
n. Let
φ(n) = #{1 ≤ j ≤ n : j is relatively prime to n}.
Use the inclusion-exclusion principle to show that
k
Y
φ(n) = n (1 − p−1
i )
i=1
(2) A metro train has six stops on its route from its starting station. There are 10 people on
the metro train as it departs its starting station. Each person exits the metro train at one
of its six stops, and at each stop at least one person exits. In how many ways can this happen?
This multiplication is not necessarily commutative, i.e. f ∗g need not equal g ∗f . The multiplication
is however associative
X
(f ∗ g ∗ h)(x, y) = f (x, u)g(u, v)h(v, y) = (f ∗ g) ∗ h = f ∗ (g ∗ h)
{u,v:x≤u≤v≤y}
26 KRISHNA KAIPA
There is a unique multiplicative identity g with the property that f ∗g = g ∗f = f for all f ∈ F(X).
The Kronecker delta function g(x, y) = δx,y is a multiplicative identity because
(f ∗ δ)(x, y) = f (x, y) = (δ ∗ f ).
The uniqueness is left as an exercise (Assignment 5). Note that if X = {1, . . . , n} with the usual
meaning of ≤, then F(X) is isomorphic to the algebra Un of n × n real upper triangular matrices
by the map f 7→ Af where the ij-th entry of Af is f (i, j).
Returning to a general poset X, suppose f ∈ F(X) has a left inverse g i.e. g ∗ f = δ. Then, the
identity 1 = δ(x, x) = g(x, x)f (x, x) shows that f (x, x) 6= 0. Similarly if f has a right inverse h, i.e.
f ∗ h = δ, then again the condition f (x, x)h(x, x) = 1 forces f (x, x) 6= 0.
Lemma 7. Any f ∈ F(X) satisfying f (x, x) 6= 0 for all x ∈ X has a unique two-sided multiplicative
inverse.
Proof. First we note that if g is a left inverse of f and h is a right inverse of f then
h = δ ∗ h = (g ∗ f ) ∗ h = g ∗ (f ∗ h) = g ∗ δ = g.
Therefore, if f has a left inverse and a right inverse, then every left inverse equals a right inverse.
This shows that there is a unique h such that f ∗ h = h ∗ f = δ. We have already seen that
g(x, x) = h(x, x) = 1/f (x, x) for a left inverse g or a right inverse h.
We will now determine g(x, y) for x < y. We recall that the interval {z : x ≤ z ≤ y} is finite.
We partition this interval into parts M0 , M1 , . . . , Mn where M0 = {x} and for i > 0, Mi consists
of those z in this interval for which #{t : x < t ≤ z} = i. If z ∈ Mi where i > 0 and u satisfies
x ≤ u < z then
{t : x < t ≤ z} ⊃ {t : x < t ≤ u} q {t : u < t ≤ z}.
The sets in the disjoint union are nonempty because u belongs to the first set and z belongs to the
second set. Therefore, it follows that
#{t : x < t ≤ u} < #{t : x < t ≤ z} = i,
and hence u ∈ Mj for some j < i. Assume inductively that g(x, z) has been defined for z ∈
M0 , . . . , Mi−1 . For z ∈ Mi , we have
X
0 = δ(x, z) = g(x, z)f (z, z) + g(x, u)f (u, z).
{u:x≤u<z}
As observed above, each u satisfying x ≤ u < z also satisfies u ∈ Mj for some j < i. Therefore
g(x, u) is known by the inductive hypothesis. This allows us to determine
−1 X
g(x, z) = g(x, u)f (u, z).
f (z, z)
{u:x≤u<z}
Next, we determine the right inverse h(x, y) for x < y. We partition the interval {z : x ≤ z ≤ y}
into parts M00 , M10 , . . . , Mn0 where M00 = {y} and for i > 0, Mi0 consists of those z in this interval for
which #{t : z ≤ t < y} = i. If z ∈ Mi0 where i > 0 and v satisfies z < v ≤ y then
{t : z ≤ t < y} ⊃ {t : z ≤ t < v} q {t : v ≤ t < y}.
MTH 318: COMBINATORICS 27
The sets in the disjoint union are nonempty because v belongs to the second set and z belongs to
the first set. Therefore, it follows that
#{t : v ≤ t < y} < #{t : z ≤ t < y} = i,
and hence v ∈ Mj0 for some j < i. Assume inductively that h(z, y) has been defined for z ∈
M00 , . . . , Mi−1
0
. For z ∈ Mi0 , we have
X
0 = δ(z, y) = f (z, z)h(z, y) + f (z, v)h(v, y).
v:z<v≤y
As observed above, each v satisfying z < v ≤ y also satisfies v ∈ Mj0 for some j < i. Therefore
h(v, y) is known by the inductive hypothesis. This allows us to determine
−1 X
h(z, y) = f (z, v)h(v, y).
f (z, z)
{v:z<v≤y}
28 KRISHNA KAIPA
The function ζ(x, y) defined by ζ(x, y) = 1 if x ≤ y and zero otherwise, has an inverse by the
previous lemma. The Möbius function of X is the multiplicative inverse of ζ. It is denoted µ(x, y).
We have µ(x, x) = 1 and for x < y:
X
µ(x, y) = − µ(x, z).
{z:x≤z<y}
Note that ζ = ı(ζ 0 ) and δ = ı(δ 0 ) where ζ 0 (A) = 1 for all A ⊂ X and δ 0 (A) = δ∅,A . Any f ∈ F 0 (X)
satisfying f (∅) 6= 0 has a multiplicative inverse given by
X
g(Y ) = f−1(∅)
g(Z)f (Y \ Z).
Z(Y
It follows that ı(g) is the multiplicative inverse of ı(f ). In particular µ(A, B) = µ0 (B \ A) where
µ0 (∅) = 1 and for non-empty A we have
X
µ0 (A) = − µ0 (B).
B(A
It is clear that µ0 (A) depends only on the size of A, say µ0 (A) = ϕ(|A|) for some function ϕ :
{0, 1, . . . } → R satisfying ϕ(0) = 1 and for n > 0:
n−1
X n
ϕ(n) = − ϕ(i).
i=0
i
This can be expressed as saying that An (ϕ(0), . . . , ϕ(n))T = (1, 0, . . . , 0)T where An is the (n + 1) ×
i+j i−1
(n + 1) lower triangular Pascal matrix. Since we know that the (ij)-th entry of A−1
n is (−1) j−1
,
we get for m > 0: ϕ(0)
1
! 1 !
ϕ(1) 0 −1
. = A−1 .. = .. .
.. . .
ϕ(n) 0 (−1)n
Therefore µ0 (A) = (−1)|A| and returning to F(X), we conclude µ(K, L) = (−1)|L\K| for K ⊂ L.
MTH 318: COMBINATORICS 29
((Πki=1 fi )∗(Πki=1 gi ))(~a, ~b) = ~a≤~c≤~b (Πki=1 fi )(~a, ~c) (Πki=1 gi )(~c, ~b) = Πki=1 ai ≤ci ≤bi fi (ai , ci )gi (ci , bi ) =
P P
Theorem 8. (Möbius Inversion on posets) Let (X, ≤) be a poset with the finite intervals property.
Suppose Pthat there is a least element 0 in X (i.e. 0 ≤ x for all x ∈ X). Given f : X → R define
f † (x) = y≤x f (y). We can recover f from f † by the formula
X
f (x) = f † (y)µX (y, x).
y≤x
Proof. Let F ∈ F(X) be defined by F (z, x) = δ0,z f (x). Let G = F ∗ ζ. We note that G(z, x) =
δ0,z f † (x). Since G ∗ µX = F ∗ ζ ∗ µ = F , it follows that
X X
f (x) = F (0, x) = G(0, y)µX (y, x) = f † (y)µX (y, x).
y≤x y≤x
Example 1) If X is a totally ordered set with a least element then Möbius Inversion states that
for any f : X → R: X
f † (x) = f (y) ⇒ f (x) = f † (x) − f † (x − 1)
y≤x
30 KRISHNA KAIPA
Example 2) For X = 2S with S finite, the least element is the empty set ∅ and Möbius Inversion
states that for any f : X → R:
X X
f † (K) = f (L) ⇒ f (K) = (−1)|K\L| f † (L),
L⊂K L⊂K
which is Lemma 6.
If p1 , . . . , pk are the prime divisors of n, then µ(1, d) is zero unless d|p1 p2 . . . pk . In case d|p1 p2 . . . pk ,
we have µ(1, d) equals +1 if d has an even number of prime factors and −1 is d has an odd number
of prime factors. It follows that
X
−1
µ(1, d)/d = (1 − p−1 −1
1 )(1 − p2 ) . . . (1 − pk ),
d|n
and hence
k
Y
φ(n) = n (1 − p−1
i ).
i=1
MTH 318: COMBINATORICS 31
18. Assignment 5
(1) Check that if X is poset, then δ(x, y) is the unique multiplicative identity element of F(X).
(2) If X1 , . . . , Xk are posets, consider the relation on on the Cartesian product X = X1 ×· · ·×Xk
defined by (a1 , . . . , ak ) ≤ (b1 , . . . bk ) if ai ≤ bi for each i. Check that ≤ is a partial order.
(3) Consider the power set of {1, 2, 3} denoted X = 2{1,2,3} partially ordered by set containment.
Let a function f ∈ F(X) be defined by
1, if A = B
2, if A ⊂ B and |B| − |A| = 1
f (A, B) =
1, if A ⊂ B and |B| − |A| = 2
−1, if A ⊂ B and |B| − |A| = 3
19. Quiz-2
(1) ([4 points]) Let X be a poset with finite intervals property. Let µ(·, ·) denote the Möbius
function of X. Write down a recursive/inductive formula for µ(x, y) where x ≤ y.
P
Ans: µ(x, x) = 1 and µ(x, y) = − {z:x≤z<y} µ(x, z).
(2) ([8 points]) The function λ(n) is defined for positive integers n by the rule
X
λ(d) = log(n).
d|n
e
Prove that λ(n) = log(p) if n = p where p is a prime, and λ(n) = 0 otherwise.
where µ(d) is 0 if d is not square-free, and in case d is square free then µ(d) = (−1)#prime factors of d .
If n = 1, we get
λ(1) = log(1)µ(1) = 0 × 1 = 0.
If n > 1, let p1 , . . . , pk denote the prime divisors of n. We can write:
X X
λ(n) = (log(n) − log(Πi∈I pi )) (−1)#I = log(n)(1 − 1)k − (−1)#I log(Πi∈I pi ))
I⊂{1,...,k} I⊂{1,...,k}
We recall our convention that 0k = δ0,k . Since k ≥ 1, the first term is 0. The other term is
k
X X k
X
− log(pi ) (−1)#I = log(pi ) (1 − 1)k−1 .
i=1 {i}⊂I⊂{1,...,k} i=1
Since (1 − 1)k−1 = δ1,k , we conclude that λ(n) = 0 if n has more than one prime factor, and
in case n = pe for some prime p and e ∈ N, we have log(n) = log(p).
(3) ([8 points]) Let ak,n denote the number of surjective functions (also called onto functions)
from {1, 2, . . . , k} to {1, 2, . . . , n}. Using inclusion-exclusion principle, find an expression for
ak,n . (Remark: The case k = 10 and n = 6 should be familiar !)
Ans: For I ⊂ {1, . . . , n} let BI denote the set of functions from {1, . . . , k} to {1, . . . , n}
whose image does not contain the members of I. For example if I = ∅ then BI consists of all
functions from {1, . . . , k} to {1, . . . , n}. Clearly #BI = (n − #I)k . By inclusion-exclusion
principle
n
n−j n
X X
#I k
ak,n = (−1) (n − #I) = (−1) jk.
j=0
j
I⊂{1,...,n}
MTH 318: COMBINATORICS 33
b) Suppose we have a set of 502 positive integers x1 , . . . , x502 such that the difference of
any two of these integers is not divisible by 1000. The remainders yi = xi mod 1000 form a
size-502 subset of {0, . . . , 999}. The latter set can be partitioned into 501 boxes:
{0}, {500}, {1, 999}, {2, 998}, {499, 501}.
Any subset of {0, . . . , 999} which does not contain {j, 1000 − j} for any j ∈ {1, . . . , 499}, has
size at most 501. Therefore, every size 502-subset of {0, . . . , 999} must contain {j, 1000 − j}
for some j ∈ {1, . . . , 499}, in other words there exist i 6= j such that xi + xj is divisible by
1000.
(2) ( 6 points) How many permutations are there of the digits 1, 2, . . . , 8 in which none of the
patterns 12, 34, 56, 78 appears?
solution Let j ∈ {1, 2, 3, 4}. The number of permutations of the digits 1, 2, . . . , 8 in which j
of the patterns 12, 34, 56, 78 appear, is (8 − j)!. Therefore, by inclusion-exclusion principle
the answer to the problem is
8! − 4 × 7! + 6 × 6! − 4 × 5! + 4! = 24024.
(3) (7 points) Let n be a positive integer. Suppose we choose a sequence i1 , i2 , . . . , in of integers
between 1 and n at random. Note that order of the sequence matters, and repetition of
digits is allowed. What is the probability that the sequence contains exactly n − 3 different
integers?
solution The probability is #favourable outcomes/nn . A favourable item is obtained by the
following steps
(a) Pick a size n − 3 subset of {1, . . . , n},
(b) Form a multiset of size n whose underlying set is the set picked in the previous step
(c) Choose a permutation of the multiset in the previous step,
There are n3 ways to pick the set in step 1. For step 2, there are 3 different kinds of multisets
depending on the set of multiplicities: a) 4, 1,. . . , 1, b) 3, 2, 1, . . . , 1, c) 2,2, 2, 1, . . . , 1. The
number of corresponding multisets is a) n−3 1
, b) (n − 3)(n − 4), c) n−3 3
. For step 3, the
number of permutations depends on the types a)-c) in step 2): it is a) n!/4!, b) n!/(3!2!), c)
n!/(2!2!2!).
The total number of favourable outcomes is therefore:
n
× n−3 + n−3
n! n!
n!
3 1
· 4! + (n − 3)(n − 4) · 3!2! 3
· 2!2!2! ,
34 KRISHNA KAIPA
Thus, we get the differential equation g 0 (X)(1 − X) = Xg(X). We can write this as
d
(g(X)(1 − X)) + g(X)(1 − X) = 0.
dX
The unique solution of this differential equation is g(X) = ce−X /(1−X) where c = g(0) = 1.
Thus g(X) = e−X /(1 − X).
Pn i
(b) We know dn /n! = i=0 (−1) /i!. Therefore
n n−1 n−1
(−1)i (−1)i (−1)i (−1)n (−1)n+1
X X X
n n 1
(d
n+1! n
+ dn−1 ) = n+1
( i!
)+ n+1
( i!
)=( i!
)+ n!
+ (n+1)!
.
i=0 i=0 i=0
The last expression above is also equal to dn+1 /(n+1)!. This shows that dn+1 = n(dn +dn−1 ).
Alternative solution of (b): Let ∆n denote the set of derangements of {1, . . . , n}. For
1 ≤ i ≤ n, let Fi be the set of derangements of {1, . . . , n + 1} which map n + 1 to i. Clearly
∆n+1 = qni=1 Fi .
It suffices to show that #Fi = (dn +dn−1 ). We can partition each Fi as qnj=1 Fij where Fij ⊂ Fi
consists of those derangements which map j to n + 1. Clearly #Fii = dn−1 . For j 6= i any
element of Fij is a bijective function g : {1, . . . , j −1, j +1, . . . , n} → {1, . . . , i−1, i+1, . . . , n}
satisfying g(x) 6= x for all x. For each j 6= i, there is a bijection from Fij to the set of
derangements of {1, . . . , n} which map j to i: This bijection is given by g 7→ ĝ where
(
g(x) if x 6= j
ĝ(x) =
i if x = j.
MTH 318: COMBINATORICS 35
Thus
#∆n = #(qj∈{1,...,n}\i Fij .)
This shows that n
X
#Fi = #Fij = dn−1 + dn
i=1
(5) (7 points) Let a ≤ b be elements of a poset X with finite intervals property. By a chain of
length i between a and b we mean a sequence a = x0 < · · · < xi = b. Let µX denote the
Möbius function of X. Prove that :
X
µX (a, b) = (−1)length(C) ,
C
where the sum runs over all C chains between a and b.
In terms of Sanskrit poetry, we want a vritta (poetry meter) of n − 1 matras (time units),
using two types of varnas (syllables): a laghu varna having one matra (short syllable of duration
one) and a guru varna having two matras (long syllable of duration 2). This goes back to Indian
mathematician Pingala (before Christ), or in less ancient work of Hemachandra (around 1150 AD
but before Fibonacci). The number of meters with i long syllables, is the number of permutations
of the multiset {(n − 1 − 2i) · a, i · b} which is n−1−i
i
. Thus
X
n−1−i
fn = i
.
i
Also fn = fn0
+ fn00
where fn0 , fn00
are the number of meters in which the last syllable is short, long
respectively. Clearly fn0 = fn−1 and fn00 = fn−2 , and hence
fn = fn−1 + fn−2 .
We assume that f0 = 0 and f1 = 1. Let H(x) = ∞ i
P
i=0 fi X be the generating function for the
Hemachandra numbers. We have
X
H(X) = X + (fi−1 + fi−2 )X i = X + XH(X) + X 2 H(X),
i≥2
which gives
H(X) = X/(1 − X − X 2 ).
√
Using the fact that X 2 + X − 1 = (X − φ−1 )(X + φ) where φ = 1+ 5
2
and using partial fractions
we get:
H(X) = √15 ( 1−Xφ
1 1
− 1+X/φ )
Using geometric series expansion we get:
√ √
fn = √1
5
(φn − (−φ−1 )n ) = √1
5
(( 1+2 5 )n − ( 1−2 5 )n ).
As another example of generating functions we recall that:
∞
X
−n n+k−1
(1 − X) = k
X k.
k=0
The Stirling number of the second kind Sn,k is the number of equivalence relations on {1, . . . , n}
having exactly k equivalence classes. Clearly k!Sn,k is the number of surjective functions from
{1, . . . , n} to {1, . . . , k} which we have worked out to be kj=0 (−1)k−j kj j n . Therefore
P
k
X
1
(−1)k−j kj j n .
Sn,k = k!
j=0
MTH 318: COMBINATORICS 37
X k
X
k Pk k−j k
X n k!1 (−1)k−j 1 1
Sk (X) = j
jn = k! j=0 (−1) j 1−jX
.
n≥0 j=0
(Note that we have used the convention 00 = 1 here for the term j = 0.)
38 KRISHNA KAIPA
Multiplying the expression for Sk (X) by Πki=1 (1 − iX) we get the expression:
k
Y k
X Y
1 X−1/i
f (X) = (X − 1/j) + jk 1/j−1/i
.
j=1 j=1 {i:i6=j}
We recall that the Lagrange interpolation polynomial for the data points (x1 , y1 ), . . . , (xk , yk ) (i.e.
the unique polynomial of degree at most k − 1 whose graph passes through these points) is
k
X Y
X−xi
yk xj −xi
.
j=1 {i:i6=j}
Qk
Therefore, we conclude f (X) − j=1 (X − 1/j) is the desired Lagrange interpolation polynomial for
the data points (1/j, 1/j k ) for 1 ≤ j ≤ k. However the polynomial X k − kj=1 (X − 1/j) is also a
Q
polynomial of degree at most k − 1 which interpolates the same data points. Therefore, we conclude
that f (X) = X k . In other words
Xk
Sk (X) = .
(1 − X)(1 − 2X) . . . (1 − kX)
The numbers Sn,k obey the recurrence
Sn,k = kSn−1,k + Sn−1,k−1 .
To see this, we note that given a partition of {1, . . . , n} into k parts, either the subset {1, . . . , n − 1}
is partitioned into k parts or k − 1 parts. In the former case, there are k ways to complete this
partition of {1, . . . , n − 1} to a partition of {1, . . . , n} ( by deciding where to send n). In the latter
case the only partition of {1, . . . , n} into k parts is to take {n} as a part together with the k − 1
parts of {1, . . . , n − 1}. Using this recurrence we get
X X X
Sk (X) = X k + Sn,k X n = X k + (X Sn−1,k−1 X n−1 ) + kX( Sn−1,k X n−1 ).
n>k n>k n>k
In other words
Sk (X) = XSk−1 (X) + kXSk (X).
Since Sn,1 = 1, we have S1 (X) = X/(1 − X) and hence we recover the formula:
Xk
Sk (X) = .
(1 − X)(1 − 2X) . . . (1 − kX)
The exponential generating function SkE (X) = n≥0 Sn,k X n /n! can be expressed as
P
X k
X Pk
SkE (X) X n n!k!
1
(−1)k−j kj j n = 1 k
k−j
= k! j=0 (−1) j
exp jX = (eX − 1)k /k!.
n≥0 j=0
The Bell number Bn is the number of equivalence relations on a set a set of size n.
Bn = Sn,0 + · · · + Sn,n .
MTH 318: COMBINATORICS 39
If g(X) ∈ R[[X]] is a formal power series with zero constant term, then for any f ∈ R[[X]] the
composition f (g(X)) is well defined in R[[X]]. To see this suppose g(X) = b1 X + b2 X 2 + · · · +,
and f (X) = a0 + a1 X + . . . , then the coefficient of X m in f (g(X)) is the coefficient of X m in the
polynomial f˜(g̃(X) where:
f˜(X) = a0 + a1 X + . . . am X m , g(X) = b1 X + b2 X 2 + · · · + bm X m .
In particular if g(X) ∈ R[[X]] has zero constant term, then eg(X) is well defined. For example
X X
ee −1 ∈ R[[X]] but ee is not defined in R[[X]].
Returning to the differential equation B 0 (X) − eX B(X) = 0 in R[[X]], we can write this within
R[[X]] as
X X
ee −1 dX
d
(B(X)e1−e ) = 0
Note that for f (X), g(X) ∈ R[[X]], the product f (X)g(X) is the zero element of R[[X]] if and
X
only if one of f (X), g(X) is the zero element of R[[X]] (Assignment). Since ee −1 is not zero, it
d X
follows that dX (B(X)e1−e ) = 0. A formal power series f (X) has zero derivative if and only if
X
f (X) = c has only the constant term. Therefore, we conclude that B(X) = cee −1 . Since both of
X
the series B(X) and ee −1 have constant term 1, it follows that c = 1 and hence:
X −1
B(X) = ee .
P∞
Another way to derive this is to note that B n = S n,0 + · · · + Sn,n = k=0 Sn,k . Thus the exponential
generating function B(X) equals ∞ E
P
S
k=0 k (X) (the sum of the exponential generating functions of
X
the Stirling numbers of the second kind). Since Sk (X) = (e − 1) /k! we again get B(X) = ee −1 .
E X k
Stepping out of R[[X]] into the analytic setting of convergent real power series, we can write
eX −1 X
e = 1e ee . The coefficient of X n /n! in this convergent power series is:
n ∞
jn
X X
−1 n jX −1
e coeff. of X /n! in e /j! = e j!
j≥1 j=1
23. Assignment 6
(1) A Poisson random variable X with parameter λ has probability mass function
Pr(X = k) = λk e−λ /k!, k = 0, 1, 2, . . . .
The n-th moment of a discrete random variable Y is y y n Pr(Y = y). Determine the n-th
P
moment of the Poisson random variable having unit expectation (mean) in terms of the
topics of this section. (Ans: Bn .)
(2) Let Vm be the vector space of polynomials with real coefficients of degree at most m in one
variable. Show that Ek (X) = X(X − 1) . . . (X − k + 1) for 0 ≤ k ≤ m (with E0 (X) = 1)
k
form a basis for Vm . Express the P standard basis ek (X) = X for 0 ≤ k ≤ m in terms of the
basis E0 , . . . , Em . (Ans: ej = i Sj,i Ei where Sj,i is the Stirling number of second kind.)
(First method: See quiz 3)
(Second method: Let P be the m + 1 × m + 1 matrix such that [e0 , . . . , em ] = [E0 , . . . , Em ]P .
Let P̃ be the matrix defined by P̃ij = (i − 1)!Pij . Obtain the relation B = AP̃ where A is
the upper triangular Pascal matrix and Bij = (i − 1)j−1 . Use knowledge of A−1 to solve the
problem.)
(3) Prove √that the n-th Fibonacci number fn is the integer that is closest to the number
√1 ( 1+ 5 )n .
5 2
(5) By examining the Fibonacci sequence, make a conjecture about when fn is divisible by 7
and then prove your conjecture. (Ans 8|n.)
(6) Show that the product of two elements of R[[X]] is zero if and only if one of them is zero.
(7) (Optional) Let m and n be positive integers. Prove that if m is divisible by n, then fm is
divisible by fn .
Catalan numbers
Ballot problem: A and B are contesting an election. Suppose n people vote for A and n people
vote for B. What is the probability that while counting the votes A never trails B?
Lattice Paths: Consider the integer lattice Z × Z. A walk consists of one step right (m, n) 7→
(m + 1, n) or one step up (m, n) 7→ (m, n + 1). How many paths are there from (0, 0) to (n, n) which
stay below the diagonal (but can touch it).
Triangulating a convex (n + 2)-gon (Euler): In how many ways can we triangulate a (n + 2)-gon
using (n − 1) ‘diagonals’ which do not cross each other.
The answer to the lattice problem and the polygon problem is Cn and the answer to the ballot
problem is Cn / 2nn
where Cn is the Catalan number
1 2n
Cn = .
n+1 n
The first few Catalan numbers are C0 = C1 = 1 and C2 = 2. In order to get the above formula for
Cn we will first derive the recurrence
Cn = C0 Cn−1 + C1 Cn−2 + · · · + Cn−1 C0 , n ≥ 1,
n
P
and then use the recurrence to determine the generating function C(X) = n≥0 Cn X . The
coefficient of X n in C(X) will give the formula for Cn . The Ballot problem can be converted to
the Lattice problem as follows. To a count of votes, we associate a lattice walk beginning at (0, 0)
and ending at (n, n) by taking a vote for A to a step ‘right’, and a vote for B as a step ‘up’. A
vote count in which A never trails B is a lattice walk which remains below diagonal. For the lattice
problem, given a sub-diagonal walk W let (k, k) – for 0 ≤ k ≤ n − 1 – be the last point prior to
(n, n) which lies on the given walk. Note that the walk can be broken as
W 0 → (k + 1, k) → W 0 → (n, n),
where W 0 is a lattice walk from (0, 0) to (k, k) and W 0 is a lattice walk from (k + 1, k) to (n, n − 1).
The number of such walks W 0 is Ck and the number of such walks W 00 is the same as the walk from
(0, 0) to (n, n − 1) − (k + 1, k) = (n − k − 1, n − k − 1) which is Cn−k−1 . Thus we get the desired
42 KRISHNA KAIPA
Pn−1
recurrence Cn = k=0 Ck Cn−k−1 .
To obtain the same recurrence for the polygon problem, label the vertices as v0 , . . . , vn+1 and
treat the edge vn vn+1 as the ‘base’ of the polygon. Given a triangulation of the polygon, the base
is part of a triangle vn vi vn+1 for some 0 ≤ i ≤ n − 1. To the left of this triangle is a triangulated
(n − i + 1)-gon (with vertices vi , vi+1 , . . . , vn ) and to the right of P
this triangle is a triangulated
(i + 2)-gon (with vertices vn+1 , v0 , . . . , vi ). Thus we again get Cn = n−1
i=0 Ci Cn−i−1 as desired.
In terms of the generating function C(X), the recurrence relation can be simply stated as saying
that the coefficient of X n−1 in C(X)2 for n ≥ 1 is the coefficient of X n in C(X). In other words
XC(X)2 = C(X) − 1.
By completing squares, we get
X
1/2
(2XC(X) − 1) = ±(1 − 4X)1/2 = ±
n
(−4)n X n .
n≥0
Since the constant term on the left side is −1, we must take ± in the right side to be − rather than
+. Therefore
X
1/2 1/2
n−1 2n−1 n−1
j 2j+1
Xj.
P
C(X) = n
(−1) 2 X = j≥0 j+1 (−1) 2
n≥1
Since
1/2 1 · 3 · . . . (2j − 1) 2j!
= (−1)j j+1
= (−1)j ,
j+1 (j + 1)!2 j!(j + 1)!22j+1
we get
1/2 j 2n+1 1 2n
Cn = (−1) 2 = .
n+1 n+1 n
MTH 318: COMBINATORICS 43
25. Assignment 7
(1) Solve the recurrence relation hn = 8hn−1 − 16hn−2 for n ≥ 2. Take initial values h0 = −1
and h1 = 0.
(Ans: h(x) = (8x − 1)/(1 − 4x)2 = ∞ n n
P
n=0 4 (n − 1)x )
(3) Let hn be the size of the set Mn consisting of 2 × n matrices of the form ( xy11 xy22 ... xn
... yn ) with
entries from {1, 2, . . . , 2n} (with no repetition) with rows and columns strictly increasing.
Prove that hn = Cn (the n-th Catalan number).
Solution 1 : Define h0 = 1. For a matrix M ∈ Mn , we note that yj ≥ 2j because yj is
the largest member of {x1 , . . . , xj , y1 , . . . , yj }. Similarly, xj ≤ 2j − 1 because xj is the least
member of {xj , . . . , xn , yj , . . . , yn }. Given M ∈ Mn , let j be the largest integer less than n
such that yj = 2j. We then have for n ≥ 1, the recurrence hn = h0 h̃n + h1 h̃n−1 + · · · + hn h̃0
where h̃n is the size of the subset M̃n ⊂ Mn consisting of matrices with the additional
property that yj >
x2 −1 x3 −1 ... xn −1
2j for 1 ≤ j ≤ n − 1. For M̃ ∈ M̃n , we note that the associated matrix
y1 −1 y2 ... yn−1 is in Mn−1 : The columns are increasing because xj − 1 ≤ 2j − 2 < yj−1 .
Thus, h̃n = hn−1 . We have shown that hn ’s obey the same recurrence as Cn and h0 = C0 = 1
and hence hn = Cn )
Solution 2 : A Dyck path is a path in the first quadrant of the integer lattice from (0, 0) to
(2n, 0) using n steps of the form (x, y) 7→ (x + 1, y + 1) (denoted %) and n steps of the form
(x, y) 7→ (x + 1, y − 1) (denoted &). We have seen that the number of Dyck paths is the
Catalan number Cn . For a Dyck path, we associate a matrix M ∈ M: the first row consists
of integers i such that the i-th step is % and the second row consists of integers i such that
the i-th step is &. Note that xi is the step number of the i-th % step and yi is the step
number of the i-th & step. At the end of xi steps the location is (xi , 2i − xi ) which must be
strictly above the x-axis, and hence which xi ≤ 2i − 1. At the end of yi steps the location is
(yi , yi − 2i) which must be on or above the x-axis, and hence which yi ≥ 2i. This shows that
M has increasing columns. Reversing the process we can define a Dyck path to a matrix
M ∈ M: The i-th step is % or & according as i appears in the first or second row of M ).
The maps are inverses of each other.
Thus
! !
X X
h(x) = 1000(1 − 1.06x)−1 [4 + (1 − x)−1 ] = 1000 (1.06x)n · 5+ xn .
n≥0 n≥1
In particular
n
!
1.06n − 1
X
n n−k n
hn = 1000 5 · (1.06) + (1.06) = 1000 5(1.06) +
k=1
0.06
(3) (6 points) Let Vm be the vector space of polynomials with real coefficients of degree at most
m in one variable. Consider the basis Ek (X) = X(X − 1) . . . (X − k + 1) for 0 ≤ k ≤ m
(with E0 (X) = 1) for Vm . Express the standard basis ek (X) = X k for 0 ≤ k ≤ m in terms
of the basis E0 , . . . , Em and the Stirling number of second kind. (with proof)
Ans: Given m ≤ n, the total number mn of functions from {1, . . . , n} to {1, . . . , m} equals
the sum over k (as kranges from 0 to m) of the number of ways choosing a size k subset of
{1, . . . , m} and then choosing a surjective map from {1, . . . , n} to this subset. Hence:
m
n
X m
m = k!Sn,k .
k=0
k
The sum on k in the right side can be taken as going from 0 to n instead of 0 to m (because
m
k
= 0 when k > m). In particular the polynomial
n
X
Xn − Sn,k Ek (X),
k=0
of degree at most n has n + 1 roots namely 0, 1, . . . , m. This shows that
j
X
ej (X) = Sj,i Ei (X).
i=0
MTH 318: COMBINATORICS 45
Stirling numbers of the first kind cn,k is the number of ways to arrange n people into k non-empty
circles. The recurrence obeyed by cn,k is
cn+1,k = cn,k−1 + ncn,k .
This is because the first n of the n + 1 people can be arranged in either i) k − 1 circles or ii) k circles.
In case i), n + 1-st person forms a circle all by him/herself. In case ii) the n + 1-st Pperson has to
n
be inserted into one of the k circles, and there are n ways to insert. Let Ck (X) = n≥k cn,k X /n!
be the exponential generating function of the numbers cn,k . We note that cn,0 = δ0,n and hence
C0 (X) = 1. We also consider a generating function C(X, Y ) ∈ R[[X, Y ]] defined by
X
C(X, Y ) = Ck (X)Y k
k≥0
Thus
d Ck−1 (X)
C (X)
dX k
= 1−X
.
This in turn gives the differential equation
∂ Y
∂X
C(X, Y )− 1−X
C(X, Y ) = 0.
As usual, if we have an element of h(X, Y ) = R[[X, Y ]] with zero constant term (i.e. h(0, 0) = 0)
∂h Y
and such that ∂X = − 1−X , then we can write the above equation as
∂
exp(−h) ∂X (C(X, Y ) exp(h)) = 0.
We can take
h(X, Y ) = Y log(1 − X) = −Y (X + X 2 /2 + X 3 /3 + . . . ).
We note that
X Y X
Y
exp(h) = (1 − X) = (−X)n = En (Y )(−1)n X n /n!
n≥0
n n≥0
Finally, we get
C(X, Y ) = (1 − X)−Y .
46 KRISHNA KAIPA
where the first expansion has been noted above, and the second follows by writing (1 − X)−Y as
exp(−Y log(1 − X)) This shows that
Ck (X) = (− log(1 − X))k /k!
Moreover the expansion
X X X
En (−Y )(−1)n X n /n! = C(X, Y ) = X n /n! ( Cn,k Y k )
n≥0 n≥0 k≤n
Therefore, just as the Stirling numbers Sn,k of the second kind were change of basis coefficients
expressing ej ’s in terms of Ei ’s, we see that the Stirling numbers Cn,k of the first kind (multiplied
by (−1)n−k ) are change of basis coefficients expressing Ej ’s in terms of ei ’s in the vector space of
polynomials of degree at most m in one variable Z.
MTH 318: COMBINATORICS 47
P
The analogue of Bell numbers for Stirling numbers of the first kind, i.e. k Cn,k works out to be
just n!. To see this we compare the coefficient of X n in the first and last power series in the equation
below: X X X
X i = (1 − X)−1 = C(X, 1) = X n /n! ( Cn,k ).
i≥0 n≥0 k≤n
In combinatorial terms, the number of ways of arranging n people into circles is n!. We note that
n! is also the number of permutations of the same n people, and in fact there is a natural bijection
between Perm(S) the set of permutations of a set S of size n, and the set Circ(S) of arranging S
into circles (where the circles are not labeled). Given σ ∈ Perm(S) we will associate an element
σ † ∈ Circ(S). Similarly, given τ ∈ Circ(S) we will associate an element τ† ∈ Perm(S), and we will
show that these maps are inverses of each other, thus defining a bijection between Perm(S) and
Circ(S).
Let S = {1, 2, . . . , n}. Given σ ∈ Perm(S) and i ∈ {1, . . . , n} the orbit of i is the subset of S
given by {i, σ(i), σ 2 (i), . . . }. Since this is a finite set there must be natural numbers k, m such that
σ k (i) = σ k+m (i). Since σ is a bijection, it follows that σ m (i) = i. Let m be the smallest integer with
this property. It follows that the orbit of i has size m. Note that if j is in the orbit of i, then the
orbit of j is the same as the orbit of i. In other words two distinct orbits do not overlap. Moreover
any j ∈ S is in its own orbit. We write the orbit as a circle with the clockwise traversal of the
circle corresponding to the sequence i, σ(i), σ 2 (i), . . . . Thus, we have obtained an arrangement S
into circles (namely the orbits), which we define to be σ † . Given an element τ ∈ Circ(S), we define
a permutation τ† of S by defining σ(i) (for each i ∈ S) to be the successor of i while traversing the
circle clockwise. (in particular, if the circle containing i has no other member except i, then σ fixes
i). Starting with σ ∈ Perm(S), it is clear that the element of Perm(S) defined by (σ † )† equals σ.
Similarly starting with a τ ∈ Circ(S), the element of Circ(S) defined by (τ† )† equals τ .
Partitions
We now study the analogue of Bell numbers when the set S = {1, . . . , n} is replaced by the multiset
{n · a}. Let p0 = 1 and let pn denote the ways to partition the multiset {n · a} into any number
of parts. In other words the number of ways to write n = n1 + n2 + · · · + nk where k ∈ {1, . . . , n}
and each ni > 0. Suppose there are ai parts of size i (where we allow ai = 0, then clearly pn is the
number of solutions a1 , . . . , an in non-negative integers to the equation
1a1 + 2a2 + · · · + nan = n.
We note that the coefficient of X n in the infinite product
X X X
( X i )( X 2i ) . . . ( X ji ) . . .
i≥0 i≥0 i≥0
is also the number of solution to the above equation. Thus the generating function
∞
X
n
Y 1
p(X) = pn X = i
.
n≥0 i=1
1 − X
48 KRISHNA KAIPA
Note that the infinite product makes sense because pn is the coefficient of X n in the finite product
n X n
Y Y 1
( X ji ) = i
.
j=1 i≥0 i=1
1 − X
n
Q∞ i
Similarly, the coefficient of X in the infinite product i=1 (1 − X ) actually equals the coefficient
of X n in the finite product ni=1 (1 − X i ). Since the coefficient of X n in the product
Q
∞ ∞
Y 1 Y
· (1 − X i )
i=1
1 − X i i=1
n
is the same as the coefficient of X in the finite product
n n
Y 1 Y
i
· (1 − X i ) = 1,
i=1
1 − X i=1
An elementary combinatorial proof is certainly within the scope of this course, but will not give
it here. The interested student can see look up ‘Franklin’s proof of Euler’s pentagonal number
theorem’.
Another famous partition identity of Euler is:
Theorem. (Euler) Let po (n) be the number of partitions of n into parts of odd size, and let pd (n)
be the number of partitions of n into parts of distinct sizes. Then po (n) = pd (n).
n
P
Proof. We prove this by showing that the generating functions p o (X) = n≥0 po (n)X and pd (X) =
n
P
n≥0 pd (n)X are equal. It is easy to see that
∞
Y
pd (X) = (1 + X i ),
i=1
n
because the coefficient of X in this infinite product is the number of solutions to the above equation
P n
i=1 iai = n) with ai ∈ {0, 1}. Thus
Q∞ 2i
i=1 (1 − X ) 1
pd (X) = ∞Q i
= Q∞ 2i−1 )
= po (X)
i=1 (1 − X ) i=1 (1 − X
The subject of partitions is a vast and deep subject into which we do not go further. Ramanujan
observed and proved that : i) 5|p(n) if n ≡ 4 mod 5, ii) 7|p(n) if n ≡ 5 mod 7, iii) 11|p(n) if n ≡ 6
mod 11. The pentagonal number’s theorem is closely related to the Dedekind Eta function in the
MTH 318: COMBINATORICS 49
Remark (for those familiar with group theory): Let S = {1, . . . , n}. Recall the bijection σ 7→ σ †
from Perm(S) to Circ(S). Given σ ∈ Perm(S) let Lσ be the multiset consisting of the lengths of
the circles in σ † . Note that Lσ is just a partition of n. We introduce an equivalence relation on
Perm(S) be defining σ and τ to be equivalent if Lσ = Lτ . It is clear that the number of equivalence
classes is pn the number of partitions of n. The significance of this is that the equivalence relation
on Perm(S) we defined has an interpretation in the theory the symmetric group Sn (i.e. Perm(S)
viewed as a group): two permutations are equivalent if they are conjugate in the sense of group
theory. The equivalence classes are the conjugacy classes in the symmetric group. The conclusion
is that pn is the number of conjugacy classes in the symmetric group Sn .
50 KRISHNA KAIPA
Number of labeled trees on n vertices A graph consists of a set V consisting of n vertices, and a
subset E of the n2 possible edges between these vertices. A path v1 v2 . . . vk in the graph consists
of a sequence of distinct vertices v1 , . . . , vk such that there is an edge between vi and vi+1 for each
1 ≤ i ≤ k − 1. A tree is a graph in which there is a unique path between any two vertices. Clearly,
a tree with one vertex has no edges. So, we now assume n > 1. Pick any vertex, say vn . Let r be
the number of edges emanating from vn . If r = 0, then there can be no path starting at vn which
is not the case. Therefore 1 ≤ r ≤ n − 1. Let w1 , . . . , wr be the neighbours of vn . If we remove vn
and the r edges emanating from vn , then we are left with a graph G0 on n − 1 vertices. In G0 , if
a vertex u can be connected to wi then it cannot be connected to wj for j 6= i: for otherwise, in
the original graph, we would have two distinct paths between wi and wj , namely wi − vn − wj and
the path P P 0 where P and P 0 are the paths in the new graph from wi to u and u to wj . Moreover,
any vertex u is connected to wi for some i, because otherwise u cannot be connected to vn in the
original graph G. Thus G0 decomposes into a disjoint union of graphs G1 , . . . , Gr with the property
that if u, v ∈ Gi then the unique path joining u and v in G actually lies in Gi . In other words, each
Gi is a tree. We claim that the number of edges in a tree is one less than the number of vertices
ν. This is true if ν = 1. Assume, inductively that the result is true for less than ν vertices. In
particular , in the graph G0 above the number of vertices exceeds the number of edges by r. In G,
there is one more vertex vn and r more edges (joining vn to w1 , . . . , wr ). Therefore the number of
vertices of G exceeds the number of edges by r + 1 − r = 1.
Let us label the vertices as v1 , v2 , . . . , vn . How many distinct trees are there on this set of vertices?
Let tn denote this number. Clearly t1 = 1 (no edges), and t2 = 1 (one edge) . If n = 3, of the 3
vertices one of them has 2 edges and the other two have 1 edge emanating. The vertex with 2 edges
can be chosen in 31 = 3 ways, and hence t3 = 3.
Theorem. (Cayley 1885) tn = nn−2 .
There are several proofs of this theorem. We give a proof using exponential generating functions.
A rooted labeled tree is a tree in which a particular vertex has been singled out. Let τn denote the
number of rooted labeled trees on n vertices. Clearly τn = ntn . Our goal is to show that τn = nn−1 .
This will show tn = nn−2 . It is easy to see that τ1 = t1 = 1. We define a formal power series:
∞
X
(12) T (x) = τn X n /n!
n=1
n
P
Theorem. (Lagrange ∼ 1770). Let f (X) = P n≥0 fnnX ∈ R[[X]] with f0 = 0, f1 6= 0. There
is a unique compositional inverse g(X) = n≥0 gn X ∈ R[[X]] with g0 = 0, g1 6= 0 satisfying
f (g(X)) = X. The coefficients of g are given by :
k[X k ]g(X) = Res(1/f k )
We will explain the term Res used above. Before, doing that we note that the existence of
g(X) is not difficult: If we plug in an unknown series g(X) = g1 X + g2 X 2 + . . . into the equation
f (g(X)) = X, we get:
f1 (g1 X + g2 X 2 + . . . ) + f2 (g1 X + g2 X 2 + . . . )2 + · · · = X(f1 g1 ) + X 2 (f1 g2 + f2 g12 ) + . . .
This gives g1 = 1/f1 , g2 = −f2 g12 /f1 . Similarly, having solved for g1 , . . . , gk we can determine gk+1
in terms of g1 , . . . , gk . Thus the exact formula for the coefficient gk is the important part of this
theorem.
We need to enlarge our ring R[[X]] of formal power series to include negative powers of X. The
ring of Laurent series denoted R((X)) consists of the set of formal series
X
{ an X n | k ∈ Z}
n≥k
with finitely many negative powers of X. The operations of addition and multiplication of Laurent
series are clear. Note that any non-zero element f (X) of of R((X)) can be written uniquely as
X m f † (X) where m ∈ Z (possibly negative) and f † (X) ∈ R[[X]] and has nonzero constant term.
The integer m is called the order of f and denoted ord(f ). At this point we note that the reciprocal
of f already exists in R((X)): it is X −m (1/f † (X)) where the reciprocal 1/f † (X) exists in R[[X]]
because f † (X) has non-zero constant term. Since every non-zero element of R((X)) has a recipro-
cal, it follows that R((X)) is a field.
52 KRISHNA KAIPA
We can extend the differentiation operation D on R[[X]] to R((X)): we just define DX n = nX n−1
for all integers n and differentiate a Laurent series term-wise. We note that
D : R((X)) → R((X))
is a linear transformation whose kernel is clearly the constants (i.e. power series with only constant
term). Note that the image of D consists of all Laurent series in which the coefficient of X −1 is
zero. This is because DX n = nX n−1 can never be a nonzero scalar multiple of X −1 .
We define the residue Res(f ) of a Laurent series f to be the coefficient of X −1 in f . Note that
Res : R((X)) → R
is a surjective linear transformation (of vector spaces over R). As noted above:
ker(Res) = Im(D).
In other words Res(f 0 ) = 0 where f 0 = Df . As a corollary we note that:
Res(f g 0 ) = −Res(f 0 g).
Another property of Res is:
[X k ]f = Res(X −k−1 f ),
which follows from the definition of Res.
The most important property of Res (for the proof of Lagrange’s theorem) is
Res((f ◦ g)(X) · g 0 (X)) = Res(f )ord(g)
where g(X) ∈ R[[X]] with zero constant term (in other words ord(g) > 0). To see this we write
f = Res(f )X −1 + f1 (X), where f1 ∈ Ker(Res). Since Ker(Res) = Im(D) it follows that f1 = f20 for
some Laurent series f2 . We have
0
(f ◦ g)(X) · g 0 (X) = Res(f ) gg + (f2 ◦ g)0 .
Thus Res((f ◦ g)(X) · g 0 (X)) = Res(f )ord(g).
Returning to the proof of Lagrange’s theorem, let g(X) be the compositional inverse of f (X).
Note that ord(f ) = ord(g) = 1.
k[X k ]g = kRes(X −k−1 g) = −Res((DX −k )g) = Res(X −k g 0 ) = Res((f −k ◦ g)g 0 ) = Res(f −k )ord(g)
Since ord(g) = 1, we conclude that
k[X k ]g = Res(f −k ).
MTH 318: COMBINATORICS 53
The function W (x) = −T (−x) is the power series at x = 0 of the Lambert W -function which oc-
curs in many contexts in physics and chemistry. See https://en.wikipedia.org/wiki/Lambert_
W_function.
54 KRISHNA KAIPA
30. Assignment 8
(1) Consider a rooted tree on n vertices. We divide the vertex set as V0 , V1 , . . . where V0 consists
of the root and Vi consists of those vertices such that the unique path from the root to this
vertex has i edges. We say that an unlabeled rooted tree is a binary tree if for each for each
i and for each v ∈ Vi set of neighbours of v in Vi+1 –called the children of v– is at most 2
in number. The children are partitioned into two (possibly empty) parts called left children
and right children. If a vertex has only one child, then this child can be left or right. If a
vertex has two children, then one child is left and the other is right. Show that the number
of binary trees on n vertices is the Catalan number Cn . Example: for n = 3 the five binary
trees are (where r is root):
r → L → L, r → L → R, r → R → L, r → R → R, r → LR
(Ans: Let an be the number of such binary trees. Define a0 = 1. The left side ‘branch’
of the root is again a binary tree with j vertices, and the right side ‘branch’ of the root is a
binary tree with n − 1 − j vertices. Therefore, the numbers an satisfy the same recurrence
as that of the Catalan numbers an = a0 an−1 + a1 an−2 + · · · + an−1 a0 for n ≥ 1 and a0 = C0 .
Therefore, an = Cn .)
(2) In this problem we will give a combinatorial proof of the following partition identity in
R[[X, Y ]]:
∞ ∞
Y 1 X
k Xk
= Y
i=1
1 − Y Xi k=0
(1 − X)(1 − X 2 ) . . . (1 − X k )
(a) We can expand the left side as a power series k,n pn,k X n Y k . Interpret pn,k as the
P
number of partitions of n into exactly k parts. P
(b) We can expand the right side as a power series k,n qn,k X n Y k . Interpret qn,k as the
number of partitions of n whose largest part is k.
(c) Prove the identity by proving that pn,k = qn,k . Given a partition n = n1 + · · · + nk
with n1 ≥ n2 ≥ · · · ≥ nk , consider a n × n matrix with entries in {0, 1}. The i-th row
has ni ones followed by (n − ni ) zeros. For i > k the rows consist of zeros. Conversely
to each such n × n matrix (with {0, 1} entries, in which the number of ones in each
row is non-increasing, and within each row the zeros trail the ones) we get a partition.
Consider the transpose operation on such matrices.
(3) Consider the equation XC(X)2 = C(X) − 1 for the generating function n≥0 Cn X n of the
P
Catalan numbers. Let A(X) = C(X) − 1. Convert the above equation to a functional
equation for A(X) of a form to which Lagrange inversion can be applied. Using Lagrange
1 2n
inversion obtain the formula Cn = n+1 n .
MTH 318: COMBINATORICS 55
Examples:
• Let X = {1, . . . , 5} and S1 = {1, 2, 3} , S2 = {1, 4, 5} and S3 = {3, 5}. Here a transversal is
given by f (1) = 2, f (2) = 4, f (3) = 5. Another transversal is f (1) = 2, f (2) = 1, f (3) = 3.
• Let S1 , S2 , S3 , S4 be the family of subsets of the set X = {a, b, c, d, e}, defined by S1 =
{a, b, c}, S2 = S4 = {b, d}, S3 = {a, b, d}. Here (c, b, a, d) is an SDR.
Marriage Problem Let X be a set of n men, and A = {W1 , . . . , Wm } a set of m women. Each
woman Wi prefers a subset Si ⊂ X. The marriage problem is to find a SDR, i.e. to find m distinct
men M1 , . . . Mm such that for each 1 ≤ i ≤ m, the man Mi is in the preferred list of Wi .
In case i) suppose wlog that |S1 ∪ · · · ∪ Sj | = j. Since j < m by inductive hypothesis, we get
distinct elements x1 , . . . , xj such that xi ∈ Si . Moreover S1 ∪ · · · ∪ Sj must equal {x1 , . . . , xj } as
both sets have the same size j. Now let Y = X \ {x1 , . . . , xj } and Ai = Sj+i \ {x1 , . . . , xj } for
1 ≤ i ≤ m−j. We claim that the condition (14) holds for this new collection: for B ⊂ {1, . . . , m−j}
we have:
∪i∈B Ai = (∪i∈B Sj+i ) \ {x1 , . . . , xj } = ((S1 ∪ · · · ∪ Sj ) ∪ (∪i∈B Sj+i )) \ {x1 , . . . , xj }.
Since (S1 ∪ · · · ∪ Sj ) ∪ (∪i∈B Sj+i ) has size at least |B| + j by (14), it follows that
| ∪i∈B Ai | = | ((S1 ∪ · · · ∪ Sj ) ∪ (∪i∈B Sj+i )) \ {x1 , . . . , xj }| ≥ |B|.
56 KRISHNA KAIPA
Since m − j < m, the inductive hypotheses gives an SDR xj+1 , . . . , xm for A1 , . . . , Am−j . Combining
with x1 , . . . , xj we get an SDR x1 , . . . , xm for S1 , . . . , Sm .
Case ii): here | ∪i∈B Si | > |B| for all B ⊂ {1, . . . , m}. Since |Sm | > 1, pick xm ∈ Sm and consider
Y = X \ {xm } and Ai = Si \ {xm } for 1 ≤ i ≤ m − 1. The condition (14) holds for this new
collection because for B ⊂ {1, . . . , m − 1} we have:
| ∪i∈B Ai | = |(∪i∈B Si ) \ {xm }| > |B| − 1 ≥ |B|.
Since m − 1 < m, the inductive hypotheses gives an SDR x1 , . . . , xm−1 for A1 , . . . , Am−1 . Combining
with xm we get an SDR x1 , . . . , xm for S1 , . . . , Sm .
Proof. We will prove the theorem under the extra assumption that G is finite. In the Assignment,
we will drop this assumption. Let |H| = n and |G| = mn. We apply the previous lemma with
A1 , . . . , Am and B1 , . . . , Bm being respectively, the set of left cosets of H in G and the set of right
cosets of H in G. By the lemma there exist distinct elements a1 , . . . , am of G such that:
G = qm m
i=1 ai H = qi=1 Hai .
MTH 318: COMBINATORICS 57
Second application of Philip Hall theorem: The Birkhoff- von Neumann theorem.
Therefore, by Philip Hall theorem there exists a permutation σ of X = {1, . . . , n} such that σ(i) ∈
Si , or in other words Ai,σ(i) > 0. Let λ = min{Ai,σ(i) : 1 ≤ i ≤ n}. Note that 0 < λ ≤ 1 and that
λ = 1 if and only if A = Pσ . Therefore, if λ = 1 then we have already expressed A as a convex
combination of permutation matrices. If λ < 1, we define
A − λPσ
A0 = .
1−λ
Note that the sum of the j-th column of A0 equals
( sum of the j-th column of A) − λ
=1
1−λ
58 KRISHNA KAIPA
The same is true for the row-sums of A0 also. Moreover A0ij ≥ 0, because:
(
Aij /(1 − λ) if j 6= σ(i)
A0ij = Aiσ(i) −λ ≥ 0.
1−λ
if j = σ(i)
Thus A0 is doubly stochastic. Also, the number of non-zero entries of A exceeds the number of
non-zero entries of A0 by
#{i : Ai,σ(i) = λ} ≥ 1.
Thus the number of non-zero entries of A0 is strictly P less than
P the number of non-zero entries of A.
By the inductive hypothesis, it follows that A0 = τ tτ Pτ , τ tτ = 1, where the sum runs over all
permutations τ of {1, . . . , n}, and where tτ ≥ 0. It follows that
X
A = λPσ + (1 − λ)tτ Pτ .
τ
We note that the right side is indeed a convex combination of permutation matrices.
MTH 318: COMBINATORICS 59
Let S1 , . . . , Sm be subsets of a finite set X. For a nonempty subset B of {1, . . . , m}, let SB = ∪i∈B Si .
We recall the Philip Hall theorem: for an SDR of S1 , . . . , Sm to exist, the necessary condition
|SB | ≥ |B| ∀B ⊂ {1, . . . , m},
is also sufficient. There is a generalization of the theorem when the necessary condition does not
hold. We define a deficit of S1 , . . . , Sm to capture the worst case of the violation of the necessary
condition, i.e. the largest value of |B| − |SB | for which |SB | < |B|:
Combining these two assertions,we conclude that the maximum possible size of a sub-collection
of S1 , . . . , Sm which has an SDR is m − ∆.
The next theorem (∼ 1914) stated in terms of 0, 1-matrices is a another version of the generalized
Philip Hall theorem.
Theorem 10. (Kőnig-Egerváry theorem) Let A be a m × n matrix with 0, 1 entries. Define a line
of a m × n matrix to be a row or column. The maximum possible size of a subset of the set of 1’s of
A, no two of which are on the same line is equal to the minimum possible size of a subset of lines
of A which together contain all the 1’s of A.
60 KRISHNA KAIPA
Given a collection of lines of A which includes all the 1’s of A, let C ⊂ {1, . . . , m} be the set
of rows in this collection (it is possible that C = ∅). Let B = {1, . . . , m} \ C. The columns
SB = ∪i∈B Si must be in the collection of lines. Thus the minimum possible size of a collection of
such lines is
min{m − |B| + |SB | : B ⊂ {1, . . . , m}}.
If B = ∅ i.e. C = {1, . . . , m} then the corresponding collection has size m. So the minimum value
above is m − ∆ where
∆ = max{|B| − |SB | : B ⊂ {1, . . . , m}, |B| > |SB |}.
The result now follows from the generalized Philip Hall theorem. Moreover, given a collection
S1 , . . . , Sm of subsets of a finite set X (say of size n), we can form the 0, 1 -matrix A of size
m × n above, and hence the Kőnig-Egerváry theorem is equivalent to the generalized Philip Hall
theorem.
MTH 318: COMBINATORICS 61
34. Assignment 9
(1) Let A = (A1 , A2 , . . . , An ) be a family of sets with an SDR. Let x be an element of A1 . Prove
that there is an SDR containing x, but show by example that it may not be possible to find
an SDR in which x represents A1 .
(2) Suppose A = (A1 , A2 , . . . , An ) is a family of sets that “more than satisfies” the marriage
condition in the sense that:
|Ai1 ∪ Ai2 ∪ · · · ∪ Aik | ≥ k + 1 ∀ k = 1, 2, . . . , n, 1 ≤ i1 < · · · < ik ≤ n.
Let x ∈ A1 . Prove that A has an SDR in which x represents A1 .
(3) Let n > 1 and let A = (A1 , A2 , . . . , An ) be the family of subsets of {1, 2, . . . , n}, where
Ai = {1, 2, . . . , n} \ {i} for i = 1, 2, . . . , n. Prove that A has an SDR and that the number
of SDRs is the n-th derangement number Dn .
(4) A corporation has seven available positions Y1 , Y2 , . . . , Y7 and there are ten applicants X1 , . . . , X10 .
The set of positions each applicant is qualified for is given, respectively, by
{Y1 , Y2 , Y6 }, {Y2 , Y6 , Y7 }, {Y3 , Y4 }, {Y1 , Y5 }, {Y6 , Y7 }, {Y3 }, {Y2 , Y3 }, {Y1 , Y3 }, {Y1 }, {Y 5}.
Determine the largest number of positions that can be filled by the qualified applicants and
justify your answer.
(6) (optional) In this problem we drop the assumption that G is finite, in the theorem about
group theory in the previous section.
(a) Prove the following group theory lemma:
Lemma. Let H be a subgroup of a group G such that [G : H] = m is finite. Prove that
there is a normal subgroup N of G with N contained in H and such that the quotient
group G/N is finite. (Hint: consider the kernel of the homomorphism G → Sm afforded
by the left action of G on G/H.)
(b) Let N be as in part a) and let Ḡ denote the finite group G/N . Let H̄ = H/N . Note
that [Ḡ : H̄] = m. (Prove this if it is not clear). Since we have proved the theorem for
finite G we obtain elements x1 , x2 , . . . , xm of G such that
Ḡ = ∪m m
i=1 xi H̄ = ∪i=1 H̄xi .
Use this to show that:
G = ∪m m
i=1 xi H = ∪i=1 Hxi .
62 KRISHNA KAIPA
35. Quiz-4
(1) (6 points) Consider the equation XC(X)2 = C(X)−1 for the generating function n≥0 Cn X n
P
of the Catalan numbers. Let A(X) = C(X) − 1. Convert the above equation to a functional
equation for A(X) of a form to which Lagrange inversion can be applied. Using Lagrange
1 2n
inversion obtain the formula Cn = n+1 n
.
Ans: We have X = A(X)/(1+A(X))2 which shows that A(X) is the compositional inverse
of f (X) = X/(1 + X)2 . By Lagrange inversion, for n ≥ 1, we have
Cn = n1 Res(f −k ) = n1 Res(X −n (1 + X)2n ) = n1 [X n−1 ](1 + X)2n = n1 n−1
2n 1 2n
= n+1 n
.
(2) (7 points) Let S1 , . . . , Sn be n sets that have an SDR. Suppose that a1 , . . . , at are an SDR for
S1 , . . . , St where t < n. Prove that S1 , . . . , Sn have an SDR including the elements a1 , . . . , at ,
but not necessarily as representatives of S1 , . . . , St . Give an example of sets S1 , . . . , Sn and
elements a1 , . . . , at that constitute an SDR for S1 , . . . , St but which cannot be representa-
tives of S1 , . . . , St in any SDR of S1 , . . . , Sn .
Case 1: If µ < t/2. In this case replacing xµ+1 , . . . , xt by aµ+1 , . . . , at respectively, we get
an SDR
x1 , . . . , xµ , aµ+1 , . . . , at , xt+1 , . . . , xn
which contains {aµ+1 , . . . , at }. This SDR has at least t − µ > µ elements from {a1 , . . . , at }.
Case 2: µ ≥ t/2: Suppose there is an i ∈ {1, . . . , t − µ} such that xµ+i ∈ / {a1 , . . . , aµ }
(this is always possible if µ > t/2) then replacing xµ+i by aµ+i we get a new SDR with at
least µ + 1 elements from {a1 , . . . , at }.
It remains to consider the case when µ = t/2 and {xt/2+1 , . . . , xt } = {a1 , . . . , at/2 }. Here
we note that {x1 , . . . , xt/2 } and {a1 , . . . , at/2 } are disjoint. Replacing xi by ai and xt/2+i by
at/2+i for 1 ≤ i ≤ t/2, we get an SDR containing all of a1 , . . . , at .
Let Trn denote the polynomial of degree at most n obtained by truncating a power series
up-to the X n -th term. In other words Trn C(X) = (c0 + c1 X + · · · + cn X n ). Now, two
elements A(X), B(X) ∈ R[[X]] are equal if and only if Trn A = Trn B for all non-negative
integers n. Thus we must show (for each n):
∞
X Y
Trn (Q0 ) = Trn (1 − X k )0 (1 − X i )
k=1 i∈N\{k}
(2) a) Show that the number of partitions of n with each part at most 2 is bn/2c + 1.
b)* Show that the number of partitions of n with each part at most 3 is the nearest integer
to (n + 3)2 /12 .
(3) Determine a recurrence relation for the number an of ternary strings (made up of 0’s, 1’s,
and 2’s) of length n that do not contain two consecutive 0’s or two consecutive 1’s. Then
find a formula for an .
(5) Find the exponential generating function for the number of symmetric n × n permutation
matrices.
MTH 318: COMBINATORICS 65
(2) (a) (4 pts) Give a formula (proof not required) for the generating function C(X) = ∞ n
P
n=0 Cn X
of the Catalan numbers (Recall C0 = C1 = 1 and C2 = 2)
(b) (4 pts) Using part a) or otherwise, express the following expression as a binomial coef-
ficient (with proof)
n
X 1 2j 2n − 2j
j=0
j+1 j n−j
(3) Let hn denote the number of ways of putting a certain structure (let us call it h-structure)
on a set of size n ≥ 1. The exponential generating function for h-structures is h(X) =
P ∞ n
n=1 hn X /n!. For example if h is the trivial structure (putting no structure) on a set of
size n (so that hn = 1) then h(X) = eX − 1.
(a) (5 pts) Let g and h be two structures. An f -structure on a set S of size n is obtained
by
• partitioning S into any number of non-empty blocks. The blocks are not labeled.
• putting an h-structure on each block.
• putting a g-structure on the set of blocks.
Obtain an expression for f (X) in terms of g(X) and h(X).
(b) (5 pts) Recall that the Bell number Bn is Pthe number of equivalence relations on a set
of size n. Obtain a formula for B(X) = ∞ B
n=1 n X n
/n!, preferably using part a).
(c) (5 pts) Recall that the Stirling number of the first kind cn,k is the number of ways of
arranging n distinct people into k unlabeled circles. Obtain a formula for Ck (X) =
n
P
n≥1 cn,k X /n!, preferably using part a).
(d) (5 pts) A rooted forest on n labeled vertices {v1 , . . . , vn } is a disjoint union of any num-
ber of rooted labeled trees such that union of the vertex set of all the trees is {v1 , . . . , vn }.
Recall that a rooted tree is just a tree with one of its vertices singled out. Let τn the
number of rooted labeled trees on n vertices, and let fn be the number of rooted forests
on n labeled vertices. For
P∞example f1 = 1, f2 = 3, and τnP = nn−1 . Express, preferably
using part a), F (X) = n=1 fn X n /n! in terms of τ (X) = ∞ n
n=1 τn X /n!. Find a simple
∞ ∞
relation between the sequence {fn }n=1 and the sequence {τn }n=2 , and use it to obtain
the functional equation for τ (X).
Solution to Question 2)
a) We have
X √
1 2n 1− 1−4X
C(X) = n+1 n
Xn = 2X
.
n≥0
66 KRISHNA KAIPA
b) We have X
2n
X n = (XC(X))0 = (1 − 4X)−1/2 .
n
n≥0
Thus n
X
1 2j 2n−2j
j+1 j n−j
j=0
n
is the coefficient of X in
√
(1−4X)−1/2 −1
X
1− 1−4X √ 1 −1/2 2n−1
n−1
(−4)n X n−1 /2 =
P
2X
· 1−4X
= 2X
= n n≥1 n−1
X .
n≥1
2n+1
Therefore, the answer is n
.
Solution to Question 3)
a) We claim f (X) = g(h(X)). Indeed:
X X 1 n
fn = gk hi1 hi2 . . . hik
k≥1
k! i1 i2 . . . ik
{(i1 ,i2 ,...,ik )∈Nk :i1 +···+ik =n}
This gives
fn X n hi1 X i1 hi2 X i2 hik X ik k
X X Y Xg
gk k h(X)
f (X) = n!
= k! i1 ! i2 !
... ik !
= k!
= g(h(X))
n≥1 k≥1 (i1 ,i2 ,...,ik )∈Nk k≥1
x −1
b) Here f (X) = B(X) and h(X) = g(X) = eX − 1. Thus B(X) = ee − 1.
c) Here f (X) = Ck (X) and gn = δk,n which gives g(X) = X k /k!. PAlso hn = (n − 1)! as it is
the number of circular permutation of n objects, which gives h(X) = n≥1 X n /n = − log(1 − X).
Thus
Ck (X) = (− log(1 − X))k /k!
d) For F (X) we must take hn = τn and gn = 1. Thus F (X) = eτ (X) − 1.
Next, we note that for n ≥ 2, we have τn /n (the number of unrooted labeled trees on n vertices
{v1 , . . . , vn }) equals fn−1 : to see this we note that given such a tree, if we remove vn and all edges
emanating from it, we get a rooted forest on {v1 , . . . , vn−1 }. Thus
X nf X n
τ (X) = X + n−1
n!
= X + XF (X) = Xeτ (X) .
n≥2
38. Epilogue
There are some topics which should have been covered to some extant during the course, but
which we did not have time for. Here we list some of these topics/techniques.
Introduction to Ramsey Theory. This topic will be covered in the Graph Theory course. A
basic example of this theory is the following observation. In a party with at least 6 people, there
will either be a group of 3 people who know each other, or a group of 3 people who are strangers
to each others. Given positive integers m and n, the Ramsey number, R(m, n) is the minimum
number of people that should be in a party so that either there is a group of m people who know
each other pairwise, or a group of n people who are pairwise strangers. The technique known as
the probabilistic method gained prominence after it was used by Erdős (1947) to obtain the lower
bound R(m, m) ≥ 2m/2 .
m+n−2
An upper bound for the Ramsey numbers is R(m, n) ≤ m−1
. A nice way to prove this is the
technique of double induction below
Technique of Double Induction.
Theorem. If a statement P (m, n) for (m, n) ∈ N × N is true for (m, n) ∈ {1} × N and for
(m, n) ∈ N × {1}, and if P (m, n) follows from P (m − 1, n) and P (m, n − 1), then P (m, n) holds
for all (m, n) ∈ N × N.
Proof. This is just a variant of ordinary induction, by inducting on k = m + n. Let R(k) be the
assertion that P (m, n) is true whenever m + n = k. The base case is k = 2. Assume R(k − 1)
holds. For any (m, n) with m + n = k, we note that (m − 1, n) and (m, n − 1) are true by inductive
hypothesis. We now use the fact P (m − 1, n) and P (m, n − 1) ⇒ P (m, n) to deduce that P (m, n)
is true. Thus R(k) holds.
The marching band Problem. Exercise 3.4.26 of [Brualdi]
Suppose that the mn people of a marching band are standing in a rectangular formation of m rows
and n columns in such a way that in each row each person is taller than the one to his or her right.
Suppose that the leader rearranges the people in each column in decreasing order of height from
front to back. Show that the rows are still arranged in decreasing order of height from left to right.