CCS Discrete Math I Professor: Padraic Bartlett Lecture 3: Catala Numbers Week 3 UCSB 2014 I this week, we start studyig specific examples of commoly-occurrig sequeces of umbers (as opposed to the more geeral coutig techiques we discussed for the past few weeks. Our first example of such a sequece are the Catala umbers: 1 Catala Numbers 1.1 Ascii Moutai Rages Questio. Suppose you have a umber of forward-slashes / ad backward-slashes \. A Ascii moutai rage is ay sequece made of these 2 slash marks, with forward slashes iterpreted as a icrease i altitude ad backward-slashes iterpreted as a decrease i altitude, so that We ed at the same height that we start. We ever dip below the height that we start at. Here are some Ascii moutai rages: /\ /\ /\ / \/\ /\ / \ / \ /\/ \ / \ /\ / \/\ / \ / \ /\/\/\/ \ / \/ \/\ Here are some sequeces that are ot moutai rages: /\/\/\/ /\ / /\ /\ / \ /\ / /\ /\/\/ \ / \ /\/\ /\/ \ / \ \/ \/ \/ \ Let M deote the total umber of moutai rages of legth 2. What is M, for ay? Aswer. We start by first collectig some data, to help us make a guess. I a sese, there is exactly oe possible moutai rage made out of 0 slash marks, i the same way that there is oe way to pick 0 thigs out of a set: so we say that M 0 1. More ituitively, there is exactly oe moutai rage made out of 2 slash marks; this is because our first move must be to place a / so that we icrease i altitude, which we must follow with a \ to go back dow to our startig height. There are two possible moutai rages made out of 4 slash marks: /\ 1
/\ /\/\ / \ There are five possible moutai rages made out of 6 slash marks: /\ /\ /\ / \ /\/\ /\/\/\ / \/\ /\/ \ / \ / \ With some time, you ca figure out that M 4 14 ad M 5 42, givig us the followig table: 0 1 2 3 4 5 M 1 1 2 5 14 42 It s hard to see a patter i the above data! So, istead, let s try to thik about how we actually make these moutais. Notice that with ay moutai,we must have the followig: We must start our moutai with a forward slash. Let s color it gree: /. We must at some poit i time retur back to our origial height via a backslash. Let s color the first such backslash that returs to our origial height red: \. Now, make the followig observatios: /\ / \ /\ / \/ \ /\/\ / \ / \ / \/ \ Betwee our gree forward-slash ad our red backslash, we have a moutai that starts at height 1 ad ever dips below height 1. After our red backslash, we have a moutai that starts ad eds at height 0. I other words, we have writte our origial moutai rage as the combiatio of two smaller moutais, oe of which we put o top of the /, \ marks ad the other of which we put to the right of the \ mark. Furthermore, This decompositio is uique: that is, give ay origial moutai rage, our process above is t ambiguous i how it breaks our moutai ito two smaller moutais! This process is reversible: give our two smaller moutais, we ca combie them by udoig our process to get back to our origial moutai rage! Cosequetly, if we wat to cout the total umber of large moutais, it suffices to cout all of the pairs of smaller moutais that ca create those larger moutais. I other words, we have a recursive relatioship! Specifically, because we ca break ay 2-legth moutai 2
dow ito some 2k-legth moutai o top of the /, \ marks, alog with a 2( 1 k- legth moutai after those marks, we have the followig recursive relatioship: 1 M M 0 M 1 + M 1 M 2 +... M k M 1 k. This looks familiar! I fact, we ve oticed a relatioship like this before: last week, whe we studied geeratig fuctios, we saw that ( ( ( a x b x a k b k x for ay two formal power series a x, b x. I particular, this tells us that if we set F (x M x, we get ( ( ( F (x F (x M x M x M k M k k0 k0 k0 x Our recursive relatioship tells us that k0 M km k M +1 ; therefore, we have ( (F (x 2 M k M k x M +1 x x(f (x 2 k0 M +1 x +1 x(f (x 2 1 + F (x x(f (x 2 F (x + 1 0. M x M 0 + M x 1 So: we have a expressio for F (x! I particular, we have a quadratic-polyomialtype expressio for F (x: therefore, we kow that F (x has to algebraically satisfy this expressio! However, we kow the form of ay solutio to a quadratic of the form a? 2 + b? + c: it s give by the quadratic formula? b± b 2 4ac 2a. I particular, we have that F (x 1 ± 1 4x for our specific formal power series F (x. Now: remember whe we defied formal power series, ad I said that we d ever plug thigs ito them? I kida lied. We will almost ever plug thigs ito geeratig fuctios, ad wheever we do we will be careful to make sure that the ifiite sum we ve created actually coverges to somethig sesible ad that we re makig sese. But! Now is totally oe of the times where it makes sese to do this! Cosider what we ve got here: 3
O oe had, if we take ay formal power series o matter what it is! we ca always plug i x 0 to it ad get somethig well-defied. Specifically, if our formal power series is some A(x a x, settig x 0 is just sayig that every term other tha the a 0 term gets multiplied by 0 0; i other words, A(0 a 0! So o matter what our formal power series is, we kow that pluggig i 0 to it should give us its costat term. O the other had, for the problem we re curretly cosiderig, we kow that F (x 1± 1 4x. This is a little irritatig, i that we have this ± term: we re gettig two possible aswers for F (x, whe we really wat oe (after all, there is oly oe correct value for M, the umber of 2-legth moutai rages! So: what happes whe we plug i x 0 to 1± 1 4x? Well: if we have the +-brach, we get somethig of the form 2 0 at x 0; this is hopeless, as it will either equal 1 M 0 F (0 or could it eve equal 1 i the limit, as the top goes to 2 while the bottom goes to 0! Coversely, if we take the brach, we get somethig of the form 0 0 at x 0, which is... ot great, but better! I specific, if we take limits + use L Hopital, we ca see that 1 ( d 1 4x dx 1 1 4x 1 2 lim lim x 0 x 0 d dx ( lim (1 4x 1/2 4 1, x 0 2 which is right! So, we actually kow which of the two braches is right to cosider here: we must have F (x 1 1 4x. Cool! So. If this was a stadard geeratig-fuctios problem, we d fid some way to expad the right-had side as a power series, ad use this expasio to determie what the M s are! To do this, we re goig to eed ew tools, however: we have this 1 4x term, which we do t have tools for. Let s build them! 1.2 Detour: Newto s Geeralized Biomial Theorem Last week, we proved that for ay N, (x + y k0 ( x k y k. k We wat to uderstad (1 4x 1/2. A seemigly very dumb thig we could write to try to aswer this problem is the followig: 1/2 ( 1/2 (1 4x 1/2 1 k ( 4x (1/2 k. k k0 4
Surprisigly, this is actually correct! Let s make some defiitios, so we ca prove this: Defiitio. Take ay real umber r ot i the atural umbers, ad ay atural umber k. We defie the geeralized biomial coefficiet ( r k as follows: ( r k (r(r 1(r 2... (r (k 1. k! Notice that if r was a atural umber k, this is literally the same thig as the ormal biomial coefficiet! By covetio, if k 0, we set this expressio equal to 1. This lets us make the k terms make sese. To get the rest of the expressio, let s pull out some results from calculus: Defiitio. Take ay fuctio f(x. The Taylor series aroud 0 correspodig to f(x is the power series f ( (0 x,! where f ( (0 deotes the -th derivative of f(x evaluated at x 0. So. Suppose that we cosider the Taylor series for (x + y r, for ay o-atural real value r. To do this, we ll eed to fid the derivatives of this fuctio with respect to x. It is ot too hard to see that d dx ((x + yr r(x + y r 1 d dx (x + y r(x + yr 1 1 r(x + y r 1 d 2 dx 2 ((x + yr d ( r(x + y r 1 r(r 1(x + y r 2 d (x + y r(r 1(x + yr 2 dx dx d 3 dx 3 ((x + yr d ( r(r 1(x + y r 2 r(r 1(r 2(x + y r 3 dx. d dx ((x + yr d ( r(r 1... (r ( 2(x + y r 2 r(r 1... (r ( 1(x + y r. dx (The last step here is justified by iductio; we leave formal details to the reader! Do this iff you do t see why it s true. If you plug i x 0, you get that d dx ((x + yr r(r 1... (r ( 1(x + y r x0 r(r 1... (r ( 1y r, x0 5
ad therefore that the Taylor series correspodig to (x + y r is just f ( (0 x! r(r 1... (r ( 1 y r x.! The coefficiets here are precisely our geeralized biomial coefficiets! Therefore, we ve show that the Taylor series for (x + y r is actually ( r y r x, ad specifically that the Taylor series for (1 4x 1/2 is ( r ( 4x. From here, we eed a few quick results from calculus: we simply state them, ad leave their derivatio (because they ivolve more i-depth Taylor series maipulatios tha we wat to do here for the reader! Our Taylor series for (1 4x 1/2 coverges ad is equal to (1 4x 1/2 for values of x i ( 1/4, 1/4. Two power series are equal if ad oly if all of their coefficiets are equal! Therefore, we have M x F (x 1 1 4x 1 ( 4x. 1.3 Back to Moutais So we ca solve for the M coefficiets! We do this here. First, let s clea up our expressio above, by just doig some algebraic maipulatios. Nothig crazy happes here; try to read lie-by-lie ad make sure you follow our steps! 6
M x 1 ( 4x 1 ( 1/2 0 ( 4x 0 1 ( 4x 1 1 1 1 +1 2 + 1 ( 4x ( 4x +1 ( 4x ( 4x (1/2((1/2 1... ((1/2 (( + 1 1 2 ( 4x ( + 1! (+1 terms {}}{ 1 2 2 1 2 3 2 5 2... 1 2 2 ( 1 4 x ( + 1! (+1 terms {}}{ 1 2 2 1 2 3 2 5 2... 2 1 ( 1 2 ( 1 4 x ( + 1! 1 3 5 7... (2 1 ( 1 1 2 ( 1 4 x ( + 1! 1 3 5 7... (2 1 2 x ( + 1! Ok, let s breathe for a secod. The right-had side is certaily less awful tha before, but it s still ot as simple as possible. I particular, the 1 3 5 7... (2 1 expressio is t ecessarily as simple as we d like! We ca fix this, with the followig clever trick; I call this out mostly because it s a maipulatio I ve see come up about oce every four-five moths, ad it s useful to have somewhere i your mid! Notice that 2! 2 (1 2... 2 4 6... 2. 7
Therefore, we have ad thus that 1 3 5 7... (2 1 (2! 2!, M x 1 3 5 7... (2 1 2 x ( + 1! (2! 2!( + 1! 2 x 1 (2! + 1 2!! 2 x ( 1 2 x + 1 That is... a far icer expressio. Also: it works! I theory, we should have M 1 for all, ad check it out: M 0 1 ( 2 0 1, 0 + 1 0 M 1 1 ( 2 1 1 2! 1 + 1 1 2 1!1! 1, M 2 1 ( 2 2 1 4! 2 + 1 2 3 2!2! 2, M 3 1 ( 2 3 1 6! 3 + 1 3 4 3!3! 5, M 4 1 ( 2 4 1 8! 4 + 1 4 5 4!4! 14, M 5 1 ( 2 5 1 10! 5 + 1 4 6 5!5! 42. +1( 2 Amazig! Math: it s ridiculous. 1.4 Alterate Derivatios Whe you get a aswer as simple as M 1 +1( 2, it suggests that there may be a ice combiatorial iterpretatio of this formula as it relates to moutais that is, some way i which we ca pick thigs out of 2 thigs, ad after scalig by 1/( + 1 to deal with overcoutig get our aswer! Pleasatly, this is true: there is a way to derive our closed-form forumla for M without geeratig fuctios! We preset this here, after the 8
geeratig fuctio solutio, because (while this is a much shorter solutio it is arguably oe that requires more cleveress: ulike the above, which was a (crazy applicatio of tools we kow, this oe ivolves either kowig the aswer M +1( 1 2 ahead of time or comig up with some surprisig isights ito moutai rages (or both! We do this here. First, let s chage our problem somewhat: cosider ay sequece made out of + 1 forward-slashes / ad backslashes \. Here, we re ot worryig about these sequeces formig proper moutai rages: i.e. we ca dip below our startig altitude. Moreover, we kow that after oe of these sequeces, we will be precisely oe uit higher tha we started, as we wet up + 1 times ad dow times. Imagie drawig these slashes o the iteger lattice Z 2, so that each forward slash coects some (a, b to (a + 1, b + 1, ad each backwards slash coects some (a, b to (a + 1, b 1. 1.5 Catala Numbers i Other Cotexts Not to kock the above derivatios, but they re actually ot what most mathematicias thik are the cool thigs here! Istead, cosider the recurrece relatio we studied to get these umbers: 1 C 0 C 1 1, C C k C ( 1 k The crazy thig about this recurrece is that there are literally hudreds of mathematical objects ad cocepts that reduce to this patter! O the homework you have six of these recurreces to study; we give oe more particularly beautiful example here. Let C deote the total umber of ways to take a + 2-sided regular covex polygo ca be cut ito triagles by drawig straight lies betwee vertices. There are fourtee ways to do this for 4, as draw below: k0 (Picture stole from Wikipedia I claim that this sequece satisfies the recurrece relatio described above. Our base cases, as typical, are automatic; C 0 is kid-of trivially 1, as there s exactly oe way (do othig to cut the o-existet 2-sided regular polygo ito triagles, while C 1 1 because there s exactly oe way (do othig! to cut a triagle ito... triagles. To get our recurrece relatio: Take ay regular + 2-go. How are we goig to break this ito smaller polygos? Well: if we ve divided our polygos ito triagles, this motivates us to thik about cuttig alog a triagle to get smaller polygos! 9
Specifically, take our polygo, ad pick out the triagle that uses the top edge: because we ve broke our polygo ito triagles, we kow that exactly oe such triagle exists! Split our polygo ito two polygos alog this triagle: because we create two ew edges from the chord-lies of this triagle, ad delete oe edge by gettig rid of the top edge, we must have C k C -1-k Split our polygo ito two polygos alog this triagle: because we create two ew edges from the chord-lies of this triagle, ad delete oe edge by gettig rid of the top edge, we must have + 2 + 2 1 + 3 edges, split over two polygos. So we have oe k + 2-go ad oe 1 k + 2-go! I other words, we have the recurrece as claimed. 1 C 0 C 1 1, C C k C ( 1 k k0 10