Catalan number
The Catalan numbers are a sequence of natural numbers that occur in various counting problems, often involving recursively defined objects. They are named after Eugène Catalan, though they were previously discovered in the 1730s by Minggatu.
The -th Catalan number can be expressed directly in terms of the central binomial coefficients by
The first Catalan numbers for are
Properties
An alternative expression for iswhich is equivalent to the expression given above because. This expression shows that is an integer, which is not immediately obvious from the first formula given. This expression forms the basis for a [|proof of the correctness of the formula].
Another alternative expression is
which can be directly interpreted in terms of the cycle lemma; see below.
The Catalan numbers satisfy the recurrence relations
and
Asymptotically, the Catalan numbers grow as
in the sense that the quotient of the -th Catalan number and the expression on the right tends towards 1 as approaches infinity.
This can be proved by using the asymptotic growth of the central binomial coefficients, by Stirling's approximation for, or via generating functions.
The only Catalan numbers that are odd are those for which ; all others are even. The only prime Catalan numbers are and. More generally, the multiplicity with which a prime divides can be determined by first expressing in base. For, the multiplicity is the number of 1 bits, minus 1. For an odd prime, count all digits greater than ; also count digits equal to unless final; and count digits equal to if not final and the next digit is counted. The only known odd Catalan numbers that do not have last digit 5 are,,,, and. The odd Catalan numbers, for, do not have last digit 5 if has a base 5 representation containing 0, 1 and 2 only, except in the least significant place, which could also be a 3.
The Catalan numbers have the integral representations
which immediately yields.
This has a simple probabilistic interpretation. Consider a random walk on the integer line, starting at 0. Let −1 be a "trap" state, such that if the walker arrives at −1, it will remain there. The walker can arrive at the trap state at times 1, 3, 5, 7..., and the number of ways the walker can arrive at the trap state at time is. Since the 1D random walk is recurrent, the probability that the walker eventually arrives at −1 is.
Applications in combinatorics
There are many counting problems in combinatorics whose solution is given by the Catalan numbers. The book Enumerative Combinatorics: Volume 2 by combinatorialist Richard P. Stanley contains a set of exercises which describe 66 different interpretations of the Catalan numbers. Following are some examples, with illustrations of the cases and.- is the number of Dyck words of length. A Dyck word is a string consisting of X's and Y's such that no initial segment of the string has more Y's than X's. For example, the following are the Dyck words up to length 6:
- Re-interpreting the symbol X as an opening parenthesis and Y as a closing parenthesis, counts the number of expressions containing pairs of parentheses which are correctly matched. For instance, for these are
- is the number of different ways factors can be completely parenthesized, i.e. the number of ways of associating applications of a binary operator. For, for example, we have the following five different complete parenthesizations of four factors:
- Successive applications of a binary operator can be represented in terms of a full binary tree, by labeling each leaf. It follows that is the number of full binary trees with leaves, or, equivalently, with a total of internal nodes:
- is the number of non-isomorphic ordered trees with vertices. See encoding ordered trees as binary trees. For example, is the number of possible parse trees for a sentence, in natural language processing.
- is the number of monotonic lattice paths along the edges of a grid with square cells, which do not pass above the diagonal. A monotonic path is one which starts in the lower left corner, finishes in the upper right corner, and consists entirely of edges pointing rightwards or upwards. Counting such paths is equivalent to counting Dyck words: X stands for "move right" and Y stands for "move up".
- A convex polygon with sides can be cut into triangles by connecting vertices with non-crossing line segments. The number of triangles formed is and the number of different ways that this can be achieved is. The following hexagons illustrate the case :
- is the number of stack-sortable permutations of. A permutation is called stack-sortable if, where is defined recursively as follows: write where is the largest element in and and are shorter sequences, and set, with being the identity for one-element sequences.
- is the number of permutations of that avoid the permutation pattern 123 ; that is, the number of permutations with no three-term increasing subsequence. For, these permutations are 132, 213, 231, 312 and 321. For, they are 1432, 2143, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312 and 4321.
- is the number of noncrossing partitions of the set. A fortiori, never exceeds the -th Bell number. is also the number of noncrossing partitions of the set in which every block is of size 2.
- is the number of ways to tile a stairstep shape of height with rectangles. Cutting across the anti-diagonal and looking at only the edges gives full binary trees. The following figure illustrates the case :
- is the number of ways to form a "mountain range" with upstrokes and downstrokes that all stay above a horizontal line. The mountain range interpretation is that the mountains will never go below the horizon.
| * | 1 way | |
| /\ | 1 way | |
| /\ /\/\,/\ | 2 ways | |
| /\ /\/\/\/\/\ /\/\/\,/\/\,/\/\,/\,/\ | 5 ways |
- is the number of standard Young tableaux whose diagram is a 2-by- rectangle. In other words, it is the number of ways the numbers can be arranged in a 2-by- rectangle so that each row and each column is increasing. As such, the formula can be derived as a special case of the hook-length formula.
123 124 125 134 135
456 356 346 256 246
- is the number of length sequences that start with, and can increase by either or, or decrease by any number. For these are. From a Dyck path, start a counter at. An X increases the counter by and a Y decreases it by. Record the values at only the X's. Compared to the similar representation of the Bell numbers, only is missing.
Proof of the formula
solves the combinatorial problems listed above. The first proof below uses a generating function. The other proofs are examples of bijective proofs; they involve literally counting a collection of some kind of object to arrive at the correct formula.
First proof
We first observe that all of the combinatorial problems listed above satisfy Segner's recurrence relationFor example, every Dyck word of length ≥ 2 can be written in a unique way in the form
with Dyck words and.
The generating function for the Catalan numbers is defined by
The recurrence relation given above can then be summarized in generating function form by the relation
in other words, this equation follows from the recurrence relation by expanding both sides into power series. On the one hand, the recurrence relation uniquely determines the Catalan numbers; on the other hand, interpreting as a quadratic equation of and using the quadratic formula, the generating function relation can be algebraically solved to yield two solution possibilities
From the two possibilities, the second must be chosen because only the second gives
The square root term can be expanded as a power series using the binomial series
Thus,
Second proof
Call a bad path one that starts at, ends at, is monotonic, and contains a point above the line. We count the number of bad paths by establishing a bijection with paths that start at, end at, and are monotonic.For a given bad path, construct a reflected path as follows. Let be the first point on the bad path intersecting the line. The bad path from to is the beginning of the reflected path. The part of the bad path from to reflected across the line is the rest of the reflected path. See the illustration for an example. The black line is the points shared between the two paths, the dotted red line is the rest of the bad path, the solid red line is the rest of the reflected path.
This is a bijection because every monotonic path from to is constructable from a bad path, and every reflected path is uniquely invertible by finding the unique point, which must exist because every such path must intersect.
The number of steps in the reflected path is. The number of upward steps is because the path is monotonic and starts at and ends at.
The number of reflected paths can be counted in the usual way, by counting how many way upward steps may be distributed among total steps, which is
and the number of Catalan paths is obtained by removing the number of bad paths from the total number of monotonic paths of the original grid,
This proof can be restated in terms of Dyck words. We start with a sequence of X's and Y's and interchange all X's and Y's after the first Y that violates the Dyck condition.
Third proof
This bijective proof provides a natural explanation for the term appearing in the denominator of the formula for . A generalized version of this proof can be found in a paper of Rukavicka Josef.Image:Catalan number exceedance example.png|frame|right|Figure 2. A path with exceedance 5.
Given a monotonic path, the exceedance of the path is defined to be the number of vertical edges above the diagonal. For example, in Figure 2, the edges above the diagonal are marked in red, so the exceedance of this path is 5.
Given a monotonic path whose exceedance is not zero, we apply the following algorithm to construct a new path whose exceedance is less than the one we started with.
- Starting from the bottom left, follow the path until it first travels above the diagonal.
- Continue to follow the path until it touches the diagonal again. Denote by the first such edge that is reached.
- Swap the portion of the path occurring before with the portion occurring after.
Image:Catalan number swapping example.png|frame|center|Figure 3. The green and red portions are being exchanged.
The exceedance has dropped from to. In fact, the algorithm causes the exceedance to decrease by for any path that we feed it, because the first vertical step starting on the diagonal is the only vertical edge that changes from being above the diagonal to being below it when we apply the algorithm - all the other vertical edges stay on the same side of the diagonal.
Image:Catalan number algorithm table.png|frame|right|Figure 4. All monotonic paths in a 3×3 grid, illustrating the exceedance-decreasing algorithm.
It can be seen that this process is reversible: given any path whose exceedance is less than, there is exactly one path which yields when the algorithm is applied to it. Indeed, the edge, which originally was the first horizontal step ending on the diagonal, has become the last horizontal step starting on the diagonal. Alternatively, reverse the original algorithm to look for the first edge that passes below the diagonal.
This implies that the number of paths of exceedance is equal to the number of paths of exceedance, which is equal to the number of paths of exceedance, and so on, down to zero. In other words, we have split up the set of all monotonic paths into equally sized classes, corresponding to the possible exceedances between 0 and. Since there are monotonic paths, we obtain the desired formula
Figure 4 illustrates the situation for . Each of the 20 possible monotonic paths appears somewhere in the table. The first column shows all paths of exceedance three, which lie entirely above the diagonal. The columns to the right show the result of successive applications of the algorithm, with the exceedance decreasing one unit at a time. There are five rows, that is , and the last column displays all paths no higher than the diagonal.
Using Dyck words, start with a sequence from. Let be the first that brings an initial subsequence to equality, and configure the sequence as. The new sequence is.