The Catalan Numbers and their Applications
description
Transcript of The Catalan Numbers and their Applications
THE CATALAN NUMBERS AND THEIR APPLICATIONS
1, 2, 5, 14, 42, 132, …Christen MirandoWestern New England University
IN THIS PRESENTATION… History of the Catalan Numbers Examples/Applications
Euler’s triangulation of convex polygonsCatalan’s parenthesization problemMountain ranges on a graphHankel matrixRelationship to computer sciencePascal’s Triangle
FormulasRecursiveExplicitGenerating Function
THE FIBONACCI SEQUENCE0, 1, 1, 2, 3, 5, 8, 13…
… is a set of numbers with which most people are familiar. These numbers appear in several areas of mathematics, in nature and in many other places. One set of numbers people may not be as familiar with is the set of Catalan numbers. This set of numbers, like the Fibonacci numbers, has many unexpected occurrences and beautiful relationships in mathematics.
n Cn
0 11 12 23 54 145 426 1327 4298 1,4309 4,86210 16,79611 58,78612 208,012
THE FIRST FEW CATALAN NUMBERS
HISTORY OF THE CATALAN NUMBERS Eugene Charles Catalan (1814-1894) was a Belgian mathematician
who “discovered” the Catalan Numbers in 1838 while studying well-formed sequences of parentheses. Although this set of numbers is named after him, he was not the first to discover
it.
Leonhard Euler (1707-1783) discovered this set of numbers while studying triangulations of convex polygons. Published a recursive formula in 1761. Worked with Hungarian mathematician, Johann von Segner (1704-1777) , to
develop a second order recurrence relation.
Gabriel Lame (1795-1870), was a French mathematician who used Euler’s recursive formula to find a explicit formula in 1838.
Although Euler and Catalan are given credit for this sequence, there is speculation that a Chinese mathematician Antu Ming (1692-1763) discovered them in the 1730’s through geometric models.
EULER’S TRIANGULATION OF A CONVEX N-GON
Let Tn be the number of ways a convex n-gon can be divided into n-2 triangles by drawing n-3 nonintersecting diagonals where n ≥ 3.
When n = 4, Tn = 2
When n = 5, Tn = 5
When n = 6, Tn = 14
EULER’S RECURSIVE FORMULAEuler let Tn be the number of triangulations of a convex n-gon
Tn = 2610…(4n – 10) n ≥ 3
(n – 1)!
T3 = 2 = 1, T4 = 26 = 2, and T5 = 2610 = 5
2! 3! 4!
These look like the Catalan numbers, except the subscript of Tn is shifted two places to the right, so Cn = Tn+2. Substituting n + 2 into Tn yields:
Cn = 2610…(4n – 2)
(n + 1)!
Cn = 4n – 2 2610…(4n – 6)
n + 1 n!
Cn = 4n – 2 Tn+1 n + 1
= 4n – 2 Cn – 1
n + 1
Suppose we are given n pairs of left and right parentheses. Find the number of correctly parenthesized sequences, Pn, that can be formed.
Correct: () () Incorrect: ())(
() When n = 1, Pn = 1
()(), (()) When n = 2, Pn = 2
()()(), (())(), ()(()), (()()), ((())) When n = 3, Pn = 5
(((()))), ((()())), ((())()), (()(())), When n = 4, Pn = 14(()()()), (())(()), ()()()(), ()(())(), ()()(()), ()(()()), ()((())), (())()(),(()())(), ((()))()
CATALAN’S PARENTHESIZATION PROBLEM
SINCE |PN| = |TN| = CN, A BIJECTION MUST EXIST
BETWEEN TN AND PN
In 1961, H.G. Forder found a solution to this problem. He let each diagonal spanning adjacent sides be labeled with the parenthesized concatenation of the labels of the sides.
c
b d
a e
c
b d (ab)
a e
c
b d (ab) (de)
a e
c
b ((ab)c) d (ab) (de)
a e
c
b ((ab)c) d (ab) (de)
a e
((ab)c)(de))Since n = 6, there are 14 different ways to triangulate a hexagon
CLASSIC PROBLEM – MOUNTAIN RANGES Find the number of mountain ranges that can be drawn with n upstrokes and
n downstrokes. That is, find the number of different paths, Mn, we can choose from the origin to the lattice point (2n, 0).
Can touch the x-axis but cannot cross it. From the point (x, y) we can climb up to the point (x+1, y +1) or climb down
to the point (x+1, y −1).
n = 0, Mn = 1
n = 1, Mn = 1
n = 2, Mn = 2
n = 3, Mn = 5
For n = 4, there are 14 possible mountain ranges.
HANKEL MATRIXis a nxn matrix whose (i, j) entry is the Catalan number Ci+j-2.
These matrices always have determinant 1.
(1,1) (1,2)(2,1) (2,2)
C(1+1-2) C(1+2-2)
C(2+1-2) C(2+2-2)
C0 C1
C1 C2
1 11 2
(1)(2) – (1)(1) = 2 – 1 = 1
Now for a 3x3 matrix:
(1,1) (1,2) (1,3)(2,1) (2,2) (2,3)(3,1) (3,2) (3,3)
C(1+1-2) C(1+2-2) C(1+3-2)
C(2+1-2) C(2+2-2) C(2+3-2)
C(3+1-2) C(3+2-2) C(3+3-2)
C0 C1 C2
C1 C2 C3
C2 C3 C4
1 1 21 2 5
2 5 14
Det = [(2)(14) – (5)(5)] – [(1)(14) – (2)(5)] + 2[(1)(5) – (2)(2)]= [28 – 25 – 14 + 10 + 10 - 8]
= 1
APPLICATION TO COMPUTER SCIENCE Stacks, Pushing, Popping
Using a stack, determine the number of different ways of the ordered list of integers, 1, 2, 3, ..., n can be pushed onto an empty stack and then popped resulting in an empty stack.
For n = 1, there is only one way to push/pop data.For n = 2, there are two ways to push/pop data.
Output: 12
1 2empty stack push 1pop 1 push 2 pop 2
Output: 21 21 1 1
empty stack push 1push 2 pop 2 pop 1
When n = 3, there are 6 permutations, but only 5 satisfy the stack structure.
1 2 3 empty stack
push 1 pop 1 push 2 pop 2 push 3 pop 3 output: 123
31 2 2 2
empty stack
push 1 pop 1 push 2 push 3 pop 3 pop 2 output: 132
21 1 1 3
empty stack
push 1 push 2 pop 2 pop 1 push 3 pop 3 output: 213
3
2 2 2
1 1 1 1 1
empty stack
push 1 push 2 push 3 pop 3 pop 2 pop 1 output: 231
3
2 2 2
1 1 1 1 1
empty stack
push 1 push 2 push 3 pop 3 pop 2 pop 1 output: 321
3
2 2 2
1 1 1 1
empty stack
push 1 push 2 push 3 pop 3
Notice that the permutation, 312, cannot be made. It would have to start with the steps shown below, but there is no way to pop 1 before popping 2.
EXPLICIT FORMULA FROM EULER’S RECURSIVE FORMULA
Cn = 4n – 2 Cn – 1
n + 1
= (4n – 2)(4n – 6) Cn – 2
(n + 1)n
= (4n – 2)(4n – 6)(4n-10) Cn – 3
(n + 1)n(n – 1)
This continues on until the last term is C0
= (4n – 2)(4n – 6)(4n-10)…62 C0
(n + 1)n(n – 1)… 32
2 is factored out from each term in the numerator , and the denominator becomes (n + 1)! Also, remember C0 = 1
= (2n – 1)(2n – 3)(2n – 5)… 31 2n
(n+1)!
In order to make the numerator (2n)!, terms are inserted in red
= (2n)(2n – 1)(2n - 2)(2n – 3)(2n - 4)(2n – 5)… 321 2n
(2n)(2n -2)(2n - 4) … (2) (n+1)!
Note, what is inserted in red, (2n)(2n – 2)(2n-4)…2 = 2n n! by factoring out a 2 from all n terms. We can substitute this in the denominator.
= (2n)! 2n
2n n! (n+1)!
= (2n)!
n! (n+1)!
= (2n)! (n + 1)! n!
Note: = (2n)! (n + 1) n! n!
2n = (2n)! n n! (2n – n)! = 1 2n
(n + 1) n = (2n)!
n! n!
This is the explicit formula from Euler’s recursive
formula.
PASCAL'S TRIANGLE AND THE CATALAN NUMBERS
Explicit formula for the Catalan numbers; Cn = 1 2n
n + 1 n
Example C4: 1 8 = 1 (70) = 14 (4+1) 4 5
row 0 1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
ANOTHER EXAMPLE, CN = 1 2N N N -1
2n is the term directly to the right/left of the CBC . n -1
Now, we divide this term by row number n.
1 row 0
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
Example C4: 1 8 = 1 (56) = 14 4 3 4
GENERATING FUNCTION FOR THE CATALAN NUMBERS
We have given a recursive and an explicit formula for finding the nth Catalan number, Cn. We will now find the generating function for the Catalan
numbers. Segner’s Recursive Formula:
Cn = (C0, C1, C2,…, Cn-1) (Cn-1 ,Cn-1,…,C0 )
= C0Cn-1 + C1Cn-2 +…+ Cn-1C0
Let C(x) = C0 + C1x + C2x2 + C2x2 + … + Cnxn
[C(x)]2 = (C0 + C1x + C2x2 + C2x2 + … + Cnxn) (C0 + C1 + C2x2 + C2x2 + … + Cnxn)
= (C0C0) + (C0C1 + C1C0) x + (C0C2 + C1C1 + C2C0) x2 +…..
= (11) + (11 + 11) x + (12 + 11 + 21) x2 +…..
= 1 + 2x + 5 x2 +…..
= C1x0 + C2x1 + C3x2 +…. + Cn+1xn
C(x) 2 = C1 + C2x + C3x2 +…. + Cn+1xn
C(x) 2 = C1x + C2x2 + C3x3 …. + Cnxn
xC(x) 2 = (C0 + C1x + C2x2 + C3x3 …. + Cnxn) – C0
xC(x) 2 = C(x) – C0
x
xC(x) 2 = C(x) – C0
xC(x) 2 - C(x) + 1 = 0
Using the quadratic formula, a = x, b = -1, c = 1
C(x) = 1 +/- (-1)2 – 4(x)(1) 2x
C(x) = 1 - 1 – 4(x) 2x
… THE SOLUTION IS THE CATALAN NUMBERS!
Number of binary trees with n vertices Number of full binary trees with n vertices Number of n multisets {a1, a2, …, an} of elements ai such that a1 + a2 + … + an = 0
Number of ways n semicircles can be arranged such that no two intersect Number of permutations for the set {1, 2, …, 2n} where f is an involution that
has no fixed points and satisfies the noncrossing condition Number of ways to arrange 2n soldiers in two rows in ascending height order Number of tilings of the staircase shape that can be made with n rectangles Number of paths a rook can take from the upper left-hand corner to the lower
right-hand corner on an nxn chessboard without crossing the main diagonal Number of ideals in a ring is Cn+1
Number of nilpotent ideals in a ring ….. Many more!
IF ANY OF THESE PROBLEMS APPEAR:
ANY QUESTIONS?
REFERENCES Guy, R.K. Letters to the Editor. Mathematics Magazine 61 (Oct. 1988): 269. Larcombe, P. “The 18th Century Chinese Discovery of the Catalan Numbers.”
Mathematical Spectrum 32 (1999-2000): 5-6. Jarvis, F. “Catalan Numbers.” Mathematical Spectrum 36 (2003-2004): 9-12. Koshy, Thomas. “The Ubiquitous Catalan Numbers.” Mathematics Teacher 100.3
(2006): 184-88. Gardner, M. “Mathematical Games.” Scientific American 234 (June 1976): 120-125. Grimaldi, Ralph P. Fibonacci and Catalan Numbers: An Introduction. Hoboken, NJ:
John Wiley & Sons, 2012. Print. Koshy, Thomas. Catalan Numbers with Applications. Oxford: Oxford UP, 2009.
Print. Brualdi, Richard A. Introductory Combinatorics. New York: North-Holland, 1977.
Print.