Math 172 Spring 2010 Haiman Notes on ordinary generating functions

Similar documents
Math 155 (Lecture 3)

1 Generating functions for balls in boxes

Math 475, Problem Set #12: Answers

Infinite Sequences and Series

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =

Chapter 6. Advanced Counting Techniques

Solutions to Final Exam

CIS Spring 2018 (instructor Val Tannen)

Let us consider the following problem to warm up towards a more general statement.

Counting Well-Formed Parenthesizations Easily

It is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.

MT5821 Advanced Combinatorics

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

REVIEW FOR CHAPTER 1

Complex Numbers Solutions

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Worksheet on Generating Functions

Course : Algebraic Combinatorics

Combinatorics and Newton s theorem

Generating Functions II

Linear Regression Demystified

Discrete Mathematics Recurrences

MT5821 Advanced Combinatorics

Once we have a sequence of numbers, the next thing to do is to sum them up. Given a sequence (a n ) n=1

MT5821 Advanced Combinatorics

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Math 61CM - Solutions to homework 3

(k) x n. n! tk = x a. (i) x p p! ti ) ( q 0. i 0. k A (i) n p

4.3 Growth Rates of Solutions to Recurrences

Lecture 12: November 13, 2018

CALCULATION OF FIBONACCI VECTORS

MATH 31B: MIDTERM 2 REVIEW

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

GENERATING FUNCTIONS AND RANDOM WALKS

The Random Walk For Dummies

arxiv: v1 [math.co] 23 Mar 2016

6.3 Testing Series With Positive Terms

CS / MCS 401 Homework 3 grader solutions

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

( ) GENERATING FUNCTIONS

Sequences I. Chapter Introduction

Combinatorics. Stephan Wagner

MA131 - Analysis 1. Workbook 2 Sequences I

Enumerative & Asymptotic Combinatorics

Course : Algebraic Combinatorics

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

Zeros of Polynomials

Lecture notes for Enumerative Combinatorics

7 Sequences of real numbers

Series: Infinite Sums

Math 2784 (or 2794W) University of Connecticut

Math 113 Exam 3 Practice

4 The Sperner property.

(ii) Two-permutations of {a, b, c}. Answer. (B) P (3, 3) = 3! (C) 3! = 6, and there are 6 items in (A). ... Answer.

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

P1 Chapter 8 :: Binomial Expansion

Bertrand s Postulate

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Problem Set 2 Solutions

Week 5-6: The Binomial Coefficients

A Combinatorial Proof of a Theorem of Katsuura

An Introduction to Randomized Algorithms

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

Generating Functions. 1 Operations on generating functions

Lecture 3: Catalan Numbers

MATH 304: MIDTERM EXAM SOLUTIONS

Properties and Tests of Zeros of Polynomial Functions

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

Lesson 10: Limits and Continuity

C. Complex Numbers. x 6x + 2 = 0. This equation was known to have three real roots, given by simple combinations of the expressions

The Growth of Functions. Theoretical Supplement

INEQUALITIES BJORN POONEN

Application to Random Graphs

TEACHER CERTIFICATION STUDY GUIDE

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary

PROPERTIES OF THE POSITIVE INTEGERS

CALCULUS BASIC SUMMER REVIEW

Injections, Surjections, and the Pigeonhole Principle

MA131 - Analysis 1. Workbook 7 Series I

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

PUTNAM TRAINING INEQUALITIES

Legendre-Stirling Permutations

A GENERALIZATION OF THE SYMMETRY BETWEEN COMPLETE AND ELEMENTARY SYMMETRIC FUNCTIONS. Mircea Merca

11. FINITE FIELDS. Example 1: The following tables define addition and multiplication for a field of order 4.

Lecture Notes for CS 313H, Fall 2011

Seunghee Ye Ma 8: Week 5 Oct 28

The Method of Least Squares. To understand least squares fitting of data.

x a x a Lecture 2 Series (See Chapter 1 in Boas)

18.01 Calculus Jason Starr Fall 2005

MATH 21 SECTION NOTES

SNAP Centre Workshop. Basic Algebraic Manipulation

Summer High School 2009 Aaron Bertram

Chapter 6 Principles of Data Reduction

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics

+ au n+1 + bu n = 0.)

SEQUENCES AND SERIES

David Vella, Skidmore College.

Transcription:

Math 72 Sprig 200 Haima Notes o ordiary geeratig fuctios How do we cout with geeratig fuctios? May eumeratio problems which are ot so easy to hadle by elemetary meas ca be solved usig geeratig fuctios I these otes I ll describe the geeral set-up i which ordiary geeratig fuctios apply Expoetial geeratig fuctios are useful i a somewhat differet set-up, which we will discuss later Our basic problem will be to cout objects of a give size, or weight, The specific meaig of the weight will vary with the cotext, but here are some typical possibilities: might be the legth of a word, or the size of a subset or multisubset of a give set, or we might be coutig compositios of, or partitios of We ca also have situatios i which there is more tha oe relevat weight For example i coutig partitios λ = (λ,, λ k ), we may wat to keep track of both the size of the partitio = w(λ) = λ + λ 2 + + λ k, ad the umber of parts l(λ) = k, to arrive at the umber p(, k) of partitios of with k parts What ofte happes is that if we do t fix the weight i advace, but rather try to cout objects of all weights simultaeously, it allows us extra freedom to make idepedet choices ad thereby simplify the problem But we have to do this i a way that keeps track of the weights, so we ca solve our origial problem We will also have to deal with the fact that the set of all objects of all possible weights is typically ifiite Both of these difficulties ca be hadled by geeralizig our usual idea of the umber of elemets of a fiite set to a weight eumerator for elemets of a possibly ifiite set with weights Defiitio Let S be a set equipped with a fuctio w : S N, called the weight fuctio Assume that for each, the subset {s S : w(s) = } is fiite, ad let s = {s S : w(s) = } be its umber of elemets (the whole set S is allowed to be ifiite) The weight eumerator for S is the geeratig fuctio S(x) = x w(s) s x = s S Note that if S is fiite, the S() is just the umber of elemets of S I geeral, S(x) should be thought of as a kid of weighted cout of the elemets of S, where a elemet of weight couts as x istead of The sum priciple for weight eumerators is just like that for elemetary coutig, ad follows immediately from the defiitio: Sum Priciple If S is the uio S = A B of two disjoit subsets A B =, the S(x) = A(x) + B(x), where S(x), A(x), B(x) deote the weight eumerators for S, A ad B respectively (takig the weight fuctios o A ad B to be the restrictios of the give oe o S) There is also a aalog for weight eumerators of the product priciple from elemetary coutig For this, however, we have to be careful about how weights o the elemets of the product are related to those o the compoets: the weights are required to be additive Product Priciple If S is a Cartesia product S = A A k of weighted sets, ad if the weights satisfy w(s) = w(a ) + + w(a k ) for s = (a,, a k ), the S(x) = A (x)a 2 (x) A k (x) where S(x), A i (x) deote the weight eumerators for S ad the sets A i

To see why the product priciple works, observe that for two sets S = A B, we have S(x) = x w((a,b)) = x w(a)+w(b) = x w(b) = A(x)B(x) (a,b) S (a,b) S (a,b) S x w(a) x w(b) = a A x w(a) b B The geeral case of a product of k sets follows from the two-set case by iductio o k If our set S is equipped with more tha oe weight fuctio, we will have a correspodig weight eumerator which is a geeratig fuctio i more tha oe variable, for example, if we have two weight fuctios w ad z, we would have a weight eumerator S(x, y) = x w(s) y z(s) = s,k x y k, s S k=0 where s,k is the umber of elemets s S such that w(s) = ad z(s) = k 2 Words, compositios I may istaces, typified by the examples i this sectio, we ca assemble a object from smaller pieces by first decidig o the umber of pieces to use, say j, ad the choosig the j pieces idepedetly, i a defiite order This leads to situatios i which we use the product priciple for each j, ad the sum over all j, leadig to a geometric series ivolvig a previously kow geeratig fuctio As a first example, let us determie the umber g of words w of legth i the symbols {0, } which do ot cotai cosecutive s Before cosiderig the geeratig fuctio, we might observe that g satisfies the same recurrece as the Fiboacci umbers To see this, ote that the word w must either start with a 0 or a If it starts with a 0, the rest of the word ca be ay word of legth without cosecutive s, givig g choices Provided that 2, if our word starts with, the it must i fact start with 0 This ca be followed by aythig, givig g 2 choices Hece g = g + g 2, ( 2) Sice we also clearly have g 0 = ad g = 2, we ca deduce that g is equal to the Fiboacci umber F + We could i tur obtai the geeratig fuctio by usig the recurrece, as explaied i your textbook Istead we ll take a differet approach As a little thought will covice you, ay word without cosecutive s ca be built up i a uique way by cocateatig a sequece of subwords of the forms 0 or 0, followed by a optioal at the ed Assigig each word a weight equal to its legth, their weight eumerator is G(x) = g x Let us try to evaluate this directly Suppose our word is built from j subwords 0 or 0 We ca choose each of these idepedetly ad multiply together the weight eumerators for each of the j choices The weights are additive, sice the total legth of the word we build up will be the sum of the legths of the subwords we build it from Now for each choice of a subword 0 or 0, we have a correspodig weight eumerator (x+x 2 ), so we get (x + x 2 ) j as the geeratig fuctio eumeratig all cocatetatios of j of these subwords Summig this over all j, we get (x + x 2 ) j = (x + x 2 ) j=0

as the geeratig fuctio for all words (icludig the empty word) built by cocateatig ay sequece of ay umber of subwords 0 or 0 Fially, we ca choose to add a at the ed or ot, either cotributig othig or oe extra to the weight, so we should multiply the above geeratig fuctio by + x, obtaiig G(x) = + x x x 2 Note, by the way, that xg(x) + = /( x x 2 ) The coefficiet of x i xg(x) + is g = F for, ad is = F 0 for = 0, so the Fiboacci umber geeratig fuctio is give by F (x) = F x = x x 2, i agreemet with the formula you would obtai by usig the recurrece (see Boa, Chapter 8, Ex 4) What we have doe i this example is a istace of a more geeral method, which we may formalize as a separate eumeratio priciple for geeratig fuctios Sequece priciple Let A be a set with weighted elemets ad geeratig fuctio A(x) Assume there are o elemets of weight zero, so A(0) = 0 The the geeratig fuctio for ordered sequeces α, α 2,, α j of of elemets of A (of ay legth, icludig the empty sequece), with weight defied to be the sum of the weights of the elemets α i, is give by A(x) Some cautio is due, whe usig the sequece priciple, to be sure the set A has o elemets of weight zero This is essetial for two reasos First of all, the expressio /( A(x)) makes o sese as a formal series if A has o-zero costat term Secodly, it makes o sese to eumerate all sequeces if there is a elemet α of weight zero i A, sice we could pad ay sequece with a ulimited umber of copies of α without chagig its weight, givig ifiitely may sequeces of the same weight (These two difficulties are related to each other) Here are some more examples Example Let us fid the geeratig fuctio for all words from the alphabet [k] = {,, k} I this case A is just [k], ad each of its k elemets has weight, so A(x) = kx Hece the geeratig fuctio for all words is kx = k x, which shows that there are k words with letters from [k] Of course we kew this already This example was just a warm-up Example A compositio of is a expressio = λ + λ 2 + + λ k of as a sum of positive itegers I a compositio of, as a opposed to a partitio of, the order of the parts matters Thus 2 + 3 + 2 ad 3 + 2 + 2, for istace, cout as two differet compositios of 7 Let m(, k) deote the umber of compositios of with k parts We will fid the geeratig fuctio M(, k) =,k m(, k)x y k, ad use it to solve for m(, k) I this case, we will use the sequece priciple for a two-variable geeratig fuctio, which works just like the oe-variable case Note that we are ot fixig or k i advace, so a compositio is just a arbitrary sequece of positive itegers The set A here is therefore the set of all positive itegers We have assiged each compositio two weights Oe is its legth, which is the expoet of y, while the other is

its size, which is the expoet of x i our geeratig fuctio Each iteger i i the compositio cotributes oe to the legth ad i to the size, so is couted by the moomial x i y i the geeratig fuctio for A Summig over all i this gives A(x, y) = yx/( x), ad hece M(x, y) = To solve for m(, k) it is coveiet to rewrite this as yx/( x) = x x xy M(x, y) = + xy x( + y) = + xy x j ( + y) j j=0 = + xy j x j i ( ) j y i i Extractig the coefficiet of x y k, we see that this moomial occurs oly i the term with j =, i = k, so ( ) m(, k) = k Stricly ( speakig, this derivatio is ot correct for = 0, although the aswer is correct, sice ) ( k = 0 for k > 0, ad ) 0 = Compositos of with k parts are really the same thig as -elemet multisets from [k] that use every elemet at least oce From our table of distributio problems, their umber is the same as the umber of ( k)-elemet multisets from [k], or ( k+( k) ) ( k = ) ( k = k ), i agreemet with the aswer above Exercise: modify the above example to allow compositios of i which some of the parts ca be zero Note that as log as we use a two-variable geeratig fuctio, coutig the compositios by legth as well as size, this does ot put a elemet of weight zero i A The iteger zero has weight for the legth, ad is couted by the moomial y, so the modified A(x, y) will still have o costat term 3 Catala umbers We defie the Catala umber C to be the umber of words formed from left ad right paretheses, with all paretheses balaced We may tabulate the first few Catala umbers by listig all the possibilities Let C 0 () 2 2 ()(), (()) 3 5 ()()(), (())(), ()(()), (()()), ((())) C(x) = C x be the geeratig fuctio for Catala umbers We will use the sequece priciple to evaluate it Observe that each balaced parethesis word, or Catala word, ca be uiquely expressed as a sequece of outermost groups ( w )( w 2 ) ( w k ),

where the words w i iside each outer pair of paretheses are themselves Catala words Therefore, let us apply the sequece priciple takig A to be the set of words of the form ( w ) with w a Catala word Note that the weight of ( w ) is oe more tha that of w, sice the weight is the umber of left paretheses, or equivaletly, the umber of right paretheses I particular, there are o elemets of weight zero i A, eve though w ca be the empty word We get each elemet of A by choosig a Catala word, ad surroudig it with a extra pair of paretheses We ca thik of this extra pair as a forced choice, with geeratig fuctio x because it adds oe to the weight Thus by a trivial applicatio of the product priciple, we have the geeratig fuctio However, by the sequece priciple, we also have A(x) = xc(x) C(x) = A(x) Substiutig xc(x) for A(x) ad clearig the deomiator yields the quadratic equatio xc(x) 2 C(x) + = 0 for the Catala umber geeratig fuctio Hece C(x) = 4x 2x A iterestig poit is how we kow whether to take + 4x or 4x here To see that the sig must be right, ote that 2xC(x) must equal the umerator i the above fractio, so this umerator must have zero costat term as a formal series Sice + 4x does ot vaish at x = 0, it is the wrog umerator Now we ca use the exteded biomial theorem to solve for the Catala umbers C themselves We have ( ) /2 2xC(x) = ( 4x) /2 = ( 4) x To extract C, compare coefficiets of x + o both sides, obtaiig the rather messy formula ( ) ( ) C = ( 4)+ /2 /2 = ( ) 2 2 2 + + Writig out the biomial coefficiet ( /2 +) = (/2)( /2)( 3/2) ( (2 )/2)/( + )!, multiplyig both umerator ad deomiator by!, ad simplifyig, we evetually get C = + There is aother iterpretatio of Catala umbers i terms of lattice paths, as follows The coditio for a parethesis word to be balaced is that every iitial segmet of it have at least as may left paretheses as right paretheses If we traslate the word ito a lattice path that takes oe step orth for each left parethesis ad oe step east for each right parethesis, the we get all paths from (0, 0) to (, ) that ever go below the diagoal lie x = y Hece the Catala umber C is equal to the umber of these special lattice paths (kow as Dyck paths) There are may other iterestig combiatorial objects whose umber turs out to be C ( 2 )

4 Ordered rooted trees A tree is a coected graph without cycles If we fix the set of vertices of our tree to be, say, [] = {,, }, the we call the tree a labelled tree, the elemets of the vertex set beig the labels It is a famous theorem of Cayley that there are 2 differet labelled trees o vertices A rooted tree is a tree i which oe of the vertices is distiguished ad called the root It is covetioal to draw a rooted tree with the root at the bottom ad the path from the root to each vertex goig up, like this Sice there are choices for the root, there are differet rooted labelled trees o vertices The vertex directly below a vertex v i a rooted tree is the paret of v (the root has o paret) The vertices directly above v, if ay, are its childre Besides labelled trees, we ca also cout various sorts of ulabelled trees Techically, a ulabelled tree is a equivalece classes of labelled trees, two trees beig equivalet if they differ oly by a permutatio of the labels I this sectio we will oly cosider ordered, rooted, ulabelled trees By ordered, we mea that i additio to the tree itself, there is give a liear orderig of the childre of each vertex I practice, the orderig is idicated implicitly by drawig the tree so that the childre of each vertex are ordered left-to-right This meas, for istace, that the drawig above represets a differet ordered tree tha the tree However, these two drawigs would represet the same uordered, ulabelled tree We ca use geeratig fuctios to cout ordered rooted trees Let t deote the umber of these trees with vertices, icludig the root, ad let T (x) = t x be their geeratig fuctio To build ay tree, we ca first place the root, ad the choose the (ordered) sequece of braches based o each child of the root Each brach is itself a ordered rooted tree, ad there ca be ay umber of them The geeratig fuctio for the collectio of braches is the /( T (x)) by the sequece priciple We must multiply this by a factor of x to accout for the additioal vertex at the root, givig x T (x) = T (x)

As with the Catala umber geeratig fuctio, this leads to a quadratic equatio for T (x): whose solutio is T (x) 2 T (x) + x = 0, T (x) = 4x 2 Note that T (x) = xc(x) Hece, comparig coefficiets of x, we see that t = C for > 0, while t 0 = 0, sice by defiitio a rooted tree is ot empty Icidetally, for ordered trees, it is easy to switch betwee the labelled ad ulabelled versios of the problem The orderig of the tree effectively ames every vertex, so that o a labelled ordered rooted tree, every permutatio of the labels gives a differet tree Hece the umber of ordered, rooted labelled trees o vertices is simply!t =!C