<<

faculty of science MATH 895-4 Fall 2010 department of Course Schedule LECTURE 2 Generating functions Generating functions Week Date Sections Part/ References Topic/Sections Notes/Speaker from FS2009

Contents1 Sept 7 I.1, I.2, I.3 Combinatorial Symbolic methods Structures 2 14 I.4, I.5, I.6 FS: Part A.1, A.2 Unlabelled structures 1 Comtet74 1 3 21 II.1, II.2, II.3 Labelled structures I 1.1 Generating functionsHandout #1 ...... 1 4 28 II.4, II.5, II.6 (self study) Labelled structures II

2 Manipulating formalCombinatorial power seriesCombinatorial 2 5 Oct 5 III.1, III.2 Asst #1 Due 2.1 Definitions .parameters ...... Parameters ...... 2 FS A.III 6 2.212 SumIV.1, and IV.2 Product(self-study) ...... Multivariable . . . . .GFs ...... 3 2.3 Multiplicative inverse A(x)−1 ...... 3 7 19 IV.3, IV.4 Complex Analysis 2.4 CompositionAnalytic . . . Methods ...... 3 FS: Part B: IV, V, VI 8 26 Appendix B4 Singularity Analysis 2.5 DifferentiationIV.5 V.1 ...... 4 Stanley 99: Ch. 6 9 Nov 2 Asst #2 Due 2.6 Two special :Handout #1exp, log ...... Asymptotic methods 4 9 VI.1 (self-study) Sophie 310 The basic toolbox for coefficient extraction 4 12 A.3/ C Introduction to Prob. Mariolys

4 A sampling18 IX.1 of counting sequencesLimit Laws and and generating Comb Marni functions 6 11 4.120 AdvancedIX.2 IdeasRandom . .Structures ...... Discrete . . . Limit . . Laws . . . .Sophie ...... 6 and Limit Laws FS: Part C Combinatorial 23 IX.3 Mariolys (rotating 12 instances of discrete 1 Enumerationpresentations) 25 IX.4 Continuous Limit Laws Marni

Quasi-Powers and Perhaps13 30 theIX.5 most fundamental question about a combinatorialSophie class, is “how many?”. The enumeration problem can be extremely useful forGaussian solving limit other laws problems, and our approach will use generating functions14 Dec 10 since they are so extremelyPresentations powerful. We willAsst only #3 Due just scratch the surface of their potential. Our initial approach will build up a small toolbox of combinatorial constructions • union • cartesian product • • set and

Dr. Marni• cycle MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY Version of: 11-Dec-09 • pointing and substitution which translate to simple (and not so simple) operations on the generating functions.

1.1 Generating functions We now jump head first into generating functions. Wilf’s book generatingfunctionology is a great first text if you want more details and examples.

Definition. The ordinary generating (OGF) of a sequence (An) is the formal ∞ X n A(z) = Anz . n=0 We extend this to say that the ogf of a class A is the generating function of its counting sequence An = cardinality(An). Equivalently, we can write the OGF as X A(z) = z|α|. α∈A In this context we say that the variable z marks the size of the underlying objects.

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED PAGE 1/6 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 2 Generating functions

Week Date Sections Part/ References Topic/Sections Notes/Speaker Exercise. Provefrom FS2009 that these two forms for A(z) are equivalent.

1 ForSept example, 7 I.1, I.2, I.3 considerCombinatorial the class of graphsSymbolic methodsH given here Structures 2 14 I.4, I.5, I.6 FS: Part A.1, A.2 Unlabelled structures Comtet74 3 21 II.1, II.2, II.3 Labelled structures I Handout #1 4 28 II.4, II.5, II.6 (self study) Labelled structures II

Combinatorial Combinatorial 5 Oct 5 III.1, III.2 Asst #1 Due parameters Parameters If we define size to beFS the A.III number of vertices, then the generating function is simply 6 12 IV.1, IV.2 (self-study) Multivariable GFs H(z) = z4 + z2 + z3 + z4 + z1 + z4 + z3 = z + z2 + 2z3 + 3z4. 7 19 IV.3, IV.4 Analytic Methods Complex Analysis FS: Part B: IV, V, VI 8 26 Appendix B4 Singularity Analysis On the otherIV.5 hand, V.1 if we define size to be the number of edges, then the ogf is Stanley 99: Ch. 6 9 Nov 2 Asst #2 Due Handout #1 Asymptotic methods 4 1 3 6 0 3 2 2 3 4 6 9 VI.1 H(z)(self-study) = z + z + z + z + z + z + Sophiez = 1 + z + z + 2z + z + z . 10 In both12 theseA.3/ casesC we are treating theIntroduction generating to Prob. functionMariolys as some sort of projection in which we replace18 eachIX.1 vertex (edge) by a singleLimit atomic Laws and “ zComb” andMarni forget all detailed information about the object 11 and then20 justIX.2 gather theRandom monomials Structures togetherDiscrete Limit to Laws get theSophie ogf. Thus our examplesand become Limit Laws FS: Part C Combinatorial 23 IX.3 Mariolys (rotating instances of discrete 12 ∞ presentations) X 1 25 IX.4 Binary words:Continuous LimitW Laws(z) =Marni 2nzn = 1 − 2z Quasi-Powers and n=0 13 30 IX.5 Sophie Gaussian limit laws ∞ X n 14 Dec 10 PresentationsPermutations: P (z) =Asst #3 nDue!z n=0 The first of these is a simple geometric sum. The second function does not have any simple expression in terms of standard functions. Indeed it does not converge (as an analytic object) for any z complex z other than 0. However, we can still manipulate it as a purely formal algebraic object. We only care about convergence in that we require that that the coefficient of any finite power of z is finite. This brings us to even more notation:

Definition. Let [zn]f(z) denote the coefficient of zn in the power of f(z)

Dr. Marni MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY Version of: 11-Dec-09 ∞ ! n n X n [z ]f(z) = [z ] fnz = fn n=0

2 Manipulating

2.1 Definitions

2 Let a0, a1, a2,... be a sequence of real numbers. We call the (possibly infinite) sum a0 + a1x + a2x + k ··· + akx + ... a formal power series. Here x is a variable, but we do not apriori care if the sum makes sense for any value of x aside from 0. Despite this, we can consider it a function of x and write n it as A(x). We say that ak is the coefficient of x in A(x), and we make use of the shorthand

k [x ]A(x) = ak.

2 The sum is said to be formal because we cannot collapse any of the terms. So, if a0 + a1x + a2x = 2 b0 + b1x + b2x , then it must be that a0 = b0, a1 = b1 and a2 = b2. There is a single power series equal to 1: 1 = 1 + 0x + 0x2 + ... , and a single one equal to 0: 0 + 0x + 0x2 + ... . The formal power series turns out to be a very convenient way to store a sequence. We will see that we can store infinite with a very small amount of memory using what we know about functions formal power series which arise as expansions around 0.

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 2/6 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 2 Generating functions

Week Date Sections Part/ References Topic/Sections Notes/Speaker 2.2 Sumfrom and FS2009 Product

A formal1 Sept 7 powerI.1, I.2, seriesI.3 Combinatorial is a mathematical Symbolic object methods which behaves essentially like an infinite polynomial. Structures 2 14 I.4, I.5, I.6 Unlabelled structures P n P We can define additionFS: and Part multiplicationA.1, A.2 of power series. Let A(x) = n≥0 anx and B(x) = n≥0 a = n Comtet74 bnx3 . Then21 II.1, II.2, II.3 Labelled structures I Handout #1 X n 4 28 II.4, II.5, II.6 (self study) A(Labelledx) + B structures(x) := II (an + bn) x n≥0 Combinatorial Combinatorial 5 Oct 5 III.1, III.2 Asst #1 Due parameters Parameters X X n FS A.III A(x) · B(x) := akbn−kx . 6 12 IV.1, IV.2 (self-study) Multivariable GFsn≥0 0≤k≤n n 7 Remark,19 IV.3, we IV.4 have completelyAnalytic Methods specifiedComplex the Analysis coefficient of x for each n, and so the sum and product are well defined. TheyFS: can Partbe B: IV, computed V, VI in finite time given A(x) and B(x). 8 26 Appendix B4 Singularity Analysis IV.5 V.1 Stanley 99: Ch. 6 9 Nov 2 Asst #2 Due Handout #1 Asymptotic−1 methods 2.39 MultiplicativeVI.1 (self-study) inverse A(x) Sophie 10 12 A.3/ C Introduction to Prob. Mariolys P n The multiplicative inverse of a formal power series A(x) is the formal power series C(x) = n≥0 cnx that satisfies18 IX.1 Limit Laws and Comb Marni 11 A(x) · C(x) = 1. 20 IX.2 Random Structures Discrete Limit Laws Sophie and Limit Laws Thus, FS: Part C Combinatorial 23 IX.3 Mariolys (rotating X X n 2 12 instancesakcn −of kdiscretex = 1 + 0x + 0x + .... presentations) 25 IX.4 n≥0 k≥Continuousn Limit Laws Marni

Recall that two formal power seriesQuasi-Powers are equal and if and only all of their coefficients are the same. This 13 30 IX.5 Sophie leads to the system of equations: Gaussian limit laws 14 Dec 10 Presentations Asst #3 Due a0c0 = 1 (1)

a1c0 + a0c1 = 0 (2)

a2c0 + a1c1 + a0c2 = 0 (3) . . (4)

This is a triangular system, and hence we can compute ck once we know of c0, . . . , ck−1. We see from (1) that c0 = 1/a0, and provided that a0 6= 0, this is well-defined.

Dr.Example: Marni MISHNA, The Department inverse of Mathematics, of A( SIMONx) = 1FRASER− x. UNIVERSITYThe above system simplifies to: Version of: 11-Dec-09

c0 = 1

−c0 + c1 = 0

−c1 + c2 = 0 . .

−ck + ck+1 = 0 . .

This has the unique solution: cn = 1 for all n. We should recognize this as the : −1 X (1 − x) = xn = 1 + x + x2 + x3 + .... n≥0

2.4 Composition We define composition of formal power series as follows:

X n A(B(x)) := an · B(x) . n≥0

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 3/6 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 2 Generating functions

Week Date Sections Part/ References Topic/Sections Notes/Speaker 2.5 Differentiationfrom FS2009

We1 canSept develop 7 I.1, I.2, aI.3 completeCombinatorial theory of derivativesSymbolic methods and integrals of formal power series using the power Structures 2 d14 k I.4, I.5,k− I.61 Unlabelled structures rule dx x = kx , andFS: essentiallyPart A.1, A.2 generalizing the derivative of a polynomial. Remark, this does not Comtet74 involve3 21 a limitII.1, II.2, and II.3 so the usual propertiesLabelled (sumstructures rule, I product rule, chain rule) should be proved from Handout #1 the definition of formal power series. 4 28 II.4, II.5, II.6 (self study) Labelled structures II d CombinatorialP Combinatorialn 5 • Definition:Oct 5 III.1, III.2dx A(x) = n≥0(n + 1)an+1x ; Asst #1 Due parameters Parameters d FS A.III d  d  6 • Product12 IV.1, rule: IV.2 dx ;((self-study)A(x)B(x)) = dxMultivariableA(x) B GFs(x) + A(x) dx B(x) ; 7 • Chain19 IV.3, rule IV.4 for powers:Analytic Methodsd (A(x))nComplex= n( AAnalysis(x))n−1 d A(x). FS: Part B:dx IV, V, VI dx 8 26 Appendix B4 Singularity Analysis IV.5 V.1 Exercise. Prove the aboveStanley 99: product Ch. 6 and chain rules. 9 Nov 2 Asst #2 Due Handout #1 Asymptotic methods 9 VI.1 (self-study) Sophie 2.610 Two special series: exp, log 12 A.3/ C Introduction to Prob. Mariolys P n The formal18 powerIX.1 series n≥0 x /n! isLimit reminiscent Laws and Comb ofMarni the Taylor series for the exponential, and hence we11 define 20 IX.2 Random Structures Discrete Limit Laws XSophie and Limit Laws exp(x) := xn/n!. FS: Part C Combinatorial 23 IX.3 Mariolys (rotating n≥0 12 instances of discrete presentations) In fact,25 it satisfiesIX.4 all of the usual propertiesContinuous Limit of Lawsexp,Marni but again, since it is defined as the sum, these properties should be proved from the basicQuasi-Powers formal and power series properties: 13 30 IX.5 Sophie Gaussian limit laws • d exp(x) = exp(x); 14 dxDec 10 Presentations Asst #3 Due • exp(F (x) + G(x)) = exp(F (x)) · exp(G(x)); • exp(F (x))−1 = exp(−F (x)). Similarly, we can define a series X xn log(1 − x)−1 := . n n≥1 Exercise. Prove the following properties which we can derive from formal power series definitions: Dr. Marni MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY Version of:d 11-Dec-09 −1 −1 1. dx log(1 − x) = (1 − x) ; 2. log(exp(A(x))) = A(x);

3. exp(log(A(x))) = A(x), if a0=1;

4. log(A(x) + B(x)) = log(A(x)) + log(B(x)), if a0 = b0 = 1.

3 The basic toolbox for coefficient extraction

P∞ n n There are several key theorems to aid with coefficient extraction. If A(z) = n=0 anz , then [z ]A(z) := an. Power rule [zn]A(pz) = pn[zn]A(z)

Reduction rule [zn]zmA(z) = [zn−m]A(z)

Sum rule [zn](A(z) + B(z)) = [zn]A(z) + [zn]B(z)

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 4/6 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 2 Generating functions

Week Date Sections Part/ References Topic/Sections Notes/Speaker Product rulefrom FS2009 n n X k  n−k  1 Sept 7 I.1, I.2, I.3 Combinatorial[ z ]A(z)Symbolic× B( methodsz) = [z ]A(z) × [z ]B(z) Structures k=0 2 14 I.4, I.5, I.6 FS: Part A.1, A.2 Unlabelled structures Comtet74 3 21 II.1, II.2, II.3 Labelled structures I Binomial theorem LetHandoutn and #1 k be positive integers. (self study) 4 28 II.4, II.5, II.6 Labelled structures II   n r r r! Combinatorial Combinatorial 5 Oct 5 III.1, III.2 [z ](1 + z) = Asst #1= Due . parameters Parameters n (r − n)!n! FS A.III 6 12 IV.1, IV.2 (self-study) Multivariable GFs Extended binomial theorem Let k be a positive integer, and r be a real number. Then define 7 19 IV.3, IV.4 Analytic Methods Complex Analysis FS: Part B: IV, V, VI r r(r − 1)(r − 2) ... (r − k + 1) 8 26 Appendix B4 Singularity Analysis IV.5 V.1 := . Stanley 99: Ch. 6 9 Nov 2 k Asst k#2! Due Handout #1 Asymptotic methods Then9 VI.1 (self-study) Sophie 10 r 12 A.3/ C Introduction[z tok ](1Prob. + z)Mariolysr = . k 18 IX.1 Limit Laws and Comb Marni 11 A Useful20 BinomialIX.2 FormulaRandom Structures Discrete Limit Laws Sophie and Limit Laws FS: Part C Combinatorial 23 IX.3   Mariolys (rotating −r (−r)(−r − 1) ... (−r − k + 1) 12 =instances of discrete presentations)k k! 25 IX.4 Continuous Limit Laws Marni r + k − 1 r + k − 1 Quasi-Powersk and k 13 30 IX.5 = (−1) Sophie = (−1) . Gaussian limit lawsr − 1 k

14 Dec 10 Presentations Asst #3 Due Example (Catalan numbers)√ . 1− 1−4z The generating function 2z is a “famous” generating function. The coefficients are called Catalan numbers, and we will revisit them shortly as a fundamental counting sequence. √ 1 − 1 − 4z 1 [zn] = − (−4)n[zn](1 + z)1/2 2z 2 1 1/2 = − (−4)n 2 n −(−4)n 1/2(1/2 − 1)(1/2 − 2) ... (1/2 − n + 1) Dr. Marni MISHNA, Department of Mathematics, SIMON= FRASER UNIVERSITY Version of: 11-Dec-09 2 n! −(−4)n 1 · 1 · 3 · 5 ... (2n − 3) = (1/2)n(−1)n−1 2 n! 1 · 1 · 3 · 5 ... (2n − 3) (n − 1)! = 2n−1 · n! (n − 1)! | {z } =1 2n−1(n−1)! z }| { 1 · 1 · 3 · 5 ··· (2n − 3) · (2 · n) · (2 · (n − 1)) · (2 · 1) = n!(n − 1)! (2n − 2)! = (n − 1)!(n − 1)!n 2n − 1 1 = n − 1 n

We will encounter this generating function more than once in this class. This generating function, as we shall see, is ubiquitous in . Exercise. Go to the web page: http://oeis.org/ This is the Online Encyclopedia of Integer sequences. The first few terms of this sequence are 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862. Enter them into the search engine and find some combinatorial interpretations of these numbers.

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 5/6 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 2 Generating functions

Week Date Sections Part/ References Topic/Sections Notes/Speaker 4 A samplingfrom FS2009 of counting sequences and generating functions

1 Sept 7 I.1, I.2, I.3 Combinatorial Symbolic methods StructuresA An A(z) 2 14 I.4, I.5, I.6 Unlabelled structures FS: PartPermutations A.1, A.2 n! P n!zn Comtet74 3 21 II.1, II.2, II.3 Labelled structures I n n HandoutAll #1 simple, labelled graphs 2(2) P 2(2)zn (self study) 4 28 II.4, II.5, II.6 Binary wordsLabelled structures II 2n 1 1−√2z Combinatorial Combinatorial 2n 1 1− 1−4x 5 Oct 5 III.1, III.2 Balanced parentheses Asst #1 Due parameters Parameters n n+1 2 FS A.III 6 12 IV.1, IV.2 (self-study) Multivariable GFs 4.1 Advanced Ideas 7 19 IV.3, IV.4 Analytic Methods Complex Analysis • .FS: Part B: IV,The V, VI values for which A(x) is not defined can give us much information 8 26 Appendix B4 Singularity Analysis IV.5 V.1 1 P n n about the asymptoticStanley 99: growth Ch. 6 of the coefficient. Consider A(x) = = 2 x . The coefficient 9 Nov 2 Asst #2 Due 1−2x n Handout #1 Asymptotic methods an grows like 2 . Remark that A(x) is not defined at x = 1/2. In fact, very often we can formalize 9 VI.1 (self-study) Sophie 10 a connection between the smallest singularity of the formal power series ρ (roughly, the smallest n value12 forA.3/ C which A(x) is not defined)Introduction and to the Prob. growthMariolys of an: an ≈ 1/ρ . Again, complex analysis is fundamental18 IX.1 in this remarkableLimit theory. Laws and Comb Marni 11 20 IX.2 Random Structures Discrete Limit Laws Sophie and Limit Laws FS: Part C Combinatorial 23 IX.3 Mariolys (rotating 12 instances of discrete presentations) 25 IX.4 Continuous Limit Laws Marni

Quasi-Powers and 13 30 IX.5 Sophie Gaussian limit laws

14 Dec 10 Presentations Asst #3 Due

Dr. Marni MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY Version of: 11-Dec-09

MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 6/6