Lecture Notes “Enumerative Combinatorics”

April 26, 2002

1 Lecture 1

The goal of this course is to learn how to count! I am sure you think you know already. If you do, see if you can tackle the following problems:

1. Using 6 variables x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, x_{6} how many monomials of degree 110 are there? For example x_{1}^{50}x_{2}^{25}x_{3}^{20}x_{4}^{5}x_{5}^{3}x_{6}^{7}.

2. In the USA we have counts of 1,5,10,25,50,100 cents. How many ways are there to give change of $ 2.75?

3. If you have 10 non-commuting variables how many ways are there to put parentheses to indicate order of multiplication?

Our first goal is to give tools that would allow you to answer such practical questions; very much like calculus is a general tool to answer questions about functions. Our second goal is, when possible, answer questions like those above for any instance, e.g. we have n variables and we count monomials of degree d in terms of d and n. We seek compact representations of the counting functions for those cases or easy-to-evaluate formula. We should remark here that we do not deal with the equally important problem of estimating but instead we focus only on computing the exact cardinality of finite sets.

There are two general principles or philosophies for counting. The first is the bijection approach which seeks to compute cardinalities of sets by establishing a bijection between a set of known cardinality and the set whose cardinality is unknown (just a using your fingers to count). The second approach, the analytic-algebraic approach to enumeration, aims to find a description of the counting function from the knowledge of a recurrence relation or a generating function. Let us solve the first problem using two approaches:

A monomial x_{1}^{α_{1}}x_{2}^{α_{2}} … x_{n}^{α_{n}} of degree d has α_{1} + … + α_{n} = d. We set up a bijection between such monomials and a vector of length (n − 1) + d full with dots and bars. The recipe is x_{1}^{α_{1}}x_{2}^{α_{2}} … x_{n}^{α_{n}} gets mapped to the vector that has α_{1} dots, then a bar, α_{2} dots, then a bar, α_{3} dots, then a bar, etc. ending with bar, the n − 1-th bar, followed by α_{n} dots. For example, using 4 variables x_{1}^{3}x_{2}^{4}x_{3}x_{4}^{2} gives us (., ., ., |, ., ., ., .|, ., |, ., .). Similarly, the monomial x_{3}^{7} gives (|, |, ., ., ., ., ., ., ., |). It is not difficult to convince yourself such dot/bar vectors are in bijection to the monomials. In fact, all the important information is given by the positions of the bars, because the rest we know are filled with dots. There are (n − 1) + d symbols or positions, we need to choose n − 1 of them then the answer is \binom{d+n−1}{n−1} which is the same as \binom{d+n−1}{d}. Thus for six variables, there are 153476148 monomials of degree 110. We simply apply the well-known formula \binom{m}{k} = \frac{m!}{(m−k)!k!} (prove it is true!).

2 Lecture 2

Now analytically, we observe that all possible monomials in six variables appear as terms of the infinite series

(1 + x_{1} + x_{1}^{2} + x_{1}^{3} + …)(1 + x_{2} + x_{2}^{2} + x_{2}^{3} + …)(1 + x_{3} + x_{3}^{2} + x_{3}^{3} + …)(1 + x_{4} + x_{4}^{2} + x_{4}^{3} + …)(1 + x_{5} + x_{5}^{2} + x_{5}^{3} + …)(1 + x_{6} + x_{6}^{2} + x_{6}^{3} + …)

which is the same as Π_{i=1}^{n} \frac{1}{(1−x_{i})}. Note that if we substitute x_{i} = t then the coefficient of t^{d} will count all the monomials of degree d because each one contributes one time to the sum. Thus all we need to know is the Taylor series expansion of the series \frac{1}{(1−t)^{6}} around t = 0, namely 1 + 6t + 21t^{2} + 56t^{3} + …, and look at the coefficient t^{110}. We corroborate the answer using MAPLE.

[deloera@localhost deloera]$ maple
    |\^/|     Maple V Release 5.1 (University of California, Davis)
._|\|   |/|_. Copyright (c) 1981-1998 by Waterloo Maple Inc. All rights
 \  MAPLE  /  reserved. Maple and Maple V are registered trademarks of
 <________>  Waterloo Maple Inc.
      |       Type ? for help.
> f:=1/(1-t)^6;
                                         1
                                 f := --------
                                             6
                                      (1 - t)
> taylor(f,t=0,113);
              2       3        4        5        6        7         8
1 + 6 t + 21 t  + 56 t  + 126 t  + 252 t  + 462 t  + 792 t  + 1287 t  + ...
     .
     .
     .
                107              108              109              110
    134153712 t    + 140364532 t    + 146803272 t    + 153476148 t    + ...

Incidentally MAPLE can be very useful it contains a package called combinat that has essential combinatorial operations. Using essentially the same idea we can solve the second problem about counting the ways to change $ 2.75 using american coins. Note that for such an specific problem finding a bijective proof is not as natural as for the previous question. We can represent each coin combination as a monomial. For example 275 cents is the same as 2 ∗ 100 + 3 ∗ 25 (two 1 dollar coins, plus 3 quarter coins) can be represented as x_{dollar}^{2∗100}x_{quarters}^{3∗25}. All combinations of the quarters are represented in the infinite series (1+x_{quarters}^{25} +x_{quarters}^{2∗25} +x_{quarters}^{3∗25} +…). Thus all possible combinations of pennies, nickels, dimes, quarters, half-dollar, dollars that give 275 cents are presents as monomials of the product

(1 + x_{pennies}^{1} + x_{pennies}^{2∗1} + x_{pennies}^{3∗1} + …)(1 + x_{nickels}^{5} + x_{nickels}^{2∗5} + x_{nickels}^{3∗5} + …)(1+x_{dimes}^{10}+x_{dimes}^{2∗10}+x_{dimes}^{3∗10}+…)(1+x_{quarters}^{25}+x_{quarters}^{2∗25}+x_{quarters}^{3∗25}+…)(1+ x_{halfdollars}^{50} +x_{halfdollars}^{2∗50} +x_{halfdollars}^{3∗50} +…)(1+x_{dollars}^{100} +x_{dollars}^{2∗100} +x_{dollars}^{3∗100} +…)

If we wish to know how many give exactly 275 we simply need to substitute again an auxiliary variable x_{somecoin} = t, and then we find the coefficient of t^{275}. The nice thing is that these are again geometric series for which we know simple formulas!

\frac{1}{(1 − t)(1 − t^{5})(1 − t^{10})(1 − t^{25})(1 − t^{50})(1 − t^{100})}

The answer is, using MAPLE, 258170 ways to give such change. What is the smallest amount. As a curiosity, $ 3.66 is the first amount that has over a million ways to be broken into american change!

We wish to solve now the last remaining problem of the introduction. Its solution requires a “hybrid approach”, where first we use a bijection to a new combinatorial set, then from the new set we can guess a nice recurrence relation and analytically determine the formula we are seeking. We try to think geometrically! We verify that there is a bijection from the set of all possible ways of giving parentheses to n non-commuting variables and the set of triangulations of a convex n + 1-gon. The bijection give from each parenthesization the inner diagonals of the n + 1-gon that give a unique triangulation. Use the letter a_{1} to label the edge 1, 2, a_{2} labels the edge 2, 3, and in general a_{i} labels i, i + 1. Now if there is a grouping (a_{i}, a_{i+1}) that means that the interior diagonal i, i + 2 is present, similarly, if we have an ensemble (a_{i}(a_{i+1}a_{i+2})) or ((a_{i}a_{i+1})a_{i+2}) we have a diagonal i, i + 3. In general if we have an parenthesis grouping together the portion of symbols a_{i}, …, a_{i+k} we have then a diagonal from i to i + k + 1. Figure ?? shows an example of the bijection (exercise: verify this is indeed a bijection!).

Figure 1: A triangulation corresponding to a parenthesization

Theorem 2.1 The number of triangulations of a convex n-gon is \frac{1}{n−1} \binom{2n−4}{n−2}, the Catalan numbers.

Proof:

Consider an n-gon P with a distinguished edge the base {1, n}. In a triangulation of P the base is a side of one of the triangles, say {1, k, n}, and this triangular region divides P into two disjoint convex polygonal regions S_{1}with k vertices and S_{2} with n − k + 1 vertices for some k = 2, ...n − 1. See Figure 2. The rest of the triangulation of P is complete with some triangulation of the polygons S_{1}, S_{2}. Now, S_{1} can be triangulated into R(k) ways and S_{2} into R(n − k + 1) ways. Hence for a given choice of vertex k containing the edge {1, n}, there are R(k + 1)R(n − k) ways of triangulating P thus we have

Figure 2: Setting up the recursion formula

R(n) = R(2)R(n − 1) + R(3)R(n − 2) + R(4)R(n − 3) + … + R(n − 1)R(2)

.

Now we need to solve this recurrence relation. We set R(2) = 1 and let a_{n−1} = R(n). Now we use the method of formal power series: We have a series F (x) = ∑_{n=1}^{∞} a_{n}x^{n}. Now multiplying F by itself we get

F^{2}(x) = (a_{1})^{2}x^{2}+(a_{1}a_{2}+a_{2}a_{1})x^{3}+…+(a_{1}a_{n−1}+a_{2}a_{n−3}+…+a_{n−1}a_{1})x^{n−1}+...

but by our recurrence relation a_{n−1} = a_{1}a_{n−1} + a_{2}a_{n−3} + … + a_{n−1}a_{1} so we have F^{2} = F − a_{1}x = F − x so the power series is the solution of the quadratic equation F^{2} − F + x = 0. It has two solutions

F (x) = (1 + \sqrt{1 − 4x})/2 or (1 − \sqrt{1 − 4x})/2,

but we know that F (0) = 0 so the right solution is the second one.

3 Lecture 3

Finally we need to prove that the formula for R(n) is the right one from the knowledge of its generating function: Recall Newton’s binomial theorem we have

(1 + z)^{1/2} = ∑_{k=0}^{∞} \binom{1/2}{k}z^{k}

where the binomial

\binom{1/2}{k} = \frac{[1/2(1/2 − 1)(1/2 − 2) … (1/2 − k + 1)]}{k!} = \frac{(−1)^{k−1}}{k2^{2k−1}} \binom{2k − 2}{k − 1}

.

Applying this to z = −4x we get the desired result (do not forget to shift again by 1, because a_{n} = R(n + 1)).

We have seen last time that every way of putting parentheses to n noncommuting variables can be represented as a triangulation of a convex (n + 1)- gon. Thus we were also counting the parenthesizations by the Catalan numbers above, in fact the Catalan numbers form a common sequence that appears counting diverse objects and, it is useful to use the triangulations of the n-gon to set up a bijection. Here is another example.

A rooted binary tree is a tree (in the sense of Graph Theory see for instance the book of Bollobas “GraphTheory”) with three relations among the nodes: parent, left child, and right child; and a special node called the root that has no parent. Binary trees are important combinatorial structures due to applications in data structures and design of algorithms (see for example the classic book of Donald Knuth “ The Art of Computer Programming” for an illuminating study).

From a binary tree with n nodes it is easy to obtain a triangulation of an (n + 2)-gon whose vertices are labeled and vice versa. Here is the bijection: a symmetric order traversal of the tree visits all the nodes in a recursive way. If a node is a node with at least one child, then we traverse its left subtree in symmetric order, visit the node itself and then traverse its right subtree in symmetric order. If a node has no children then simply visit it and return to the previous stage. Now choose a distinguished edge (the reference edge) of the (n + 2)-gon.

Label the remaining n vertices of the polygon in a counterclockwise way using the labels of the n nodes of the tree as they appear in the symmetric order transversal. See Figure 4. Now we will produce a triangulation of the (n + 2)- gon. We will use n triangles indexed by the n nodes of the tree. Glue triangles together along their edges according to the parent-child relation. Attach the triangle for the root to the reference edge and the vertex that received the label Figure 3: A binary tree, its symmetric ordering and its associated triangulation.

of the root of the tree. Now recursively attach each triangle to (1) the appropiate edge of its parent triangle, i.e left or right depending on the case, and (2) the vertex labeled by its node. Again look at Figure 4 for an example. Clearly, from any triangulation of the (n + 2)-gon (with labeled vertices) one can recover a labeled binary tree. There are many combinatorial objects that have the same cardinality. Before we present them we need some preliminaries:

An ordered tree is a rooted tree whose principal subtrees (those obtained by removing the root) are ordered trees and have been assigned some order among themselves.

A k-tuple of positive integers λ = (λ_{1}, λ_{2}, …, λ_{k}) is an integer partition of n if λ_{1} + λ_{2} + … + λ_{k} = n and λ_{1} ≥ λ_{2} ≥ … ≥ λ_{k} ≥ 1. The number of parts of λ is k. Another alternative notation is to show the multiplicity a part i has. For example, the partition (4, 2, 2, 2, 1, 1) can be represented as 4^{1}2^{3}1^{2}. A useful visual way picture of a partition is an array of squares or cells, left justified and in decreasing order. This is called the Ferrers diagram or Young diagram. The conjugate partition of λ is the partition obtained from λ by interchanging the rows and the columns of the Ferrerss diagram of λ. For example λ = (4, 2, 2, 2, 1, 1) and its conjugate λ′ = (6, 4, 1, 1) is given in the following picture.

Figure 4: A Ferrer Diagram and its conjugate.

Lemma 3.1 The number of partitions of n with k parts is equal to the number of partitions of n whose largest part is k

Given a partition λ of n, a standard tableau T is an arrangement of the numbers [n] = {1, 2, …, n} in the cells of the Ferrers diagram of λ which increases across rows and down columns. Standard tableaux will be very important for us later on.

Theorem 3.2 The following sets of objects have the same cardinality, given in terms of the Catalan numbers.

1. binary trees on n vertices;

2. ordered trees on n + 1 vertices;

3. Parenthesizations of n non-commuting variables;

4. Standard tableaux in a 2 × n rectangular Ferrers diagram.

We prove two of the bijections.

Proof (1)=(2) We give a bijection from binary trees to ordered trees. Let B be a binary tree let f(B) be an ordered tree given as follows: The vertices of f(B) are the same as vertices of B plus one more vertex, labeled 0 as its root. The root of B is the first child of the root of f(B). Vertex v is a left child of vertex w in B if and only if v is the first child of w in f(B). Finally, vertex v is a left child of w in B if and only if v is the brother to the right of w in f(B).

(2)=(3) and (3)=(4) are left as exercises.

4 Lecture: The Robinson-Schensted-Knuth correspondence

We saw last time an example of the bumping process. We produced a bumping sequence:

x = x_{1} < x_{2}, …, x_{s} < x_{s+1} = ∞

as well as a sequence of column indices

r_{1} ≥ r_{2} ≥ … ≥ r_{s} = t

At every moment P_{ir_{i}} has been changed from x_{i+1} to x_{i}. We also use some auxiliary counters i, j. We imagine the input tableau P is surrounded by ∞’s and zeros:

INSERTION ALGORITHM:

Input: A tableau P and a positive integer x not in P. Output: A new tableau ˆ(P), that contains x, the shape of P, and has a

single new cell in position s, t where before there was an ∞.

1. Set x_{1} := x, i := 1, j := smallest j such that P_{1j} = ∞

2. IF x_{i} < P_{i(j−1)} decrease j by one, repeat this step.

ELSE x_{i+1} := P_{ij} and set r_{1} := j, P_{ij} := x_{i}

3. IF x_{i} ≠ ∞ then i := i + 1, RETURN to step 2. ELSE set s := i, t := j, terminate.

Note that at every step the properties we look for are preserved. Only at the last moment we add the new cell. What makes this useful is that it is completely reversible! DELETION ALGORITHM:

Input: A tableau P̂, that contains a cell s, t. Output: A tableau P which is almost same as P̂, except the cell (s, t) is now

removed, and certain x not in P.

1. Set j := t, i := s, x_{s+1} = ∞

2. IF P_{i(j+1)} < x_{i+1}, then j := j + 1 and repeat this step.

ELSE x_{i} := P_{ij}, r_{i} := j, and P_{ij} := x_{i+1}

3. IF i > 1, i := i − 1 return to step 2 ELSE set x := x_{1}, end of algorithm.

KEY OBSERVATION: The inversion and deletion algorithms are perfect inverses of each other.

MIDTERM 1

Each problem 9 points (except bonus problem). Please write responses as if you were writing your lecture to accept the Fields Medal! I will grade for clarity and details. Due back in my office Monday morning.

1. What is the number of ways of going up n stairs, if we may take one or two steps at a time?

2. Suppose you choose a permutation in S_{n} uniformly at random. What is the expected number of cycles? ¡br¿

3. Figure out how many standard Young tableaux are there which can be formed with {1, 2, ...15}.

4. Stanley’s book Chapter 1: 14d,e

5. Without doing calculations prove the recursion relation about the q-binomial coefficients we saw in class.

6. (BONUS question 20 points): How can one check whether a set of permutations p_{1}, p_{2}, ..p_{k} generates the whole group S_{n}? Is there a general effective method like in the case when the p_{i}’s are all transpositions? Check the literature for this problem, find out what is known and explain it to me.