Geneating Function In a geneal combinatoial poblem, we have a univee S of object, and we want to count the numbe of object with a cetain popety. Fo example, if S i the et of all gaph, we might want to count how many gaph in S have n vetice. O if S i the et of all equence of poitive intege of length, we might want to count how many of thee equence add up to n. A geneal appoach to thee poblem i to ue geneating function (alo called geneating eie). We let w define the popety of object in S that we e inteeted in: we efe to w a a weight function, and it aign to each element of S a non-negative intege. Fo example, if we want to count compoition of n into pat, then S i the et of all equence of poitive intege of length, and the weight w of a equence (x, x,..., x ) S i w(x, x,..., x ) = x x... x. Then the numbe of element of S of weight n i exactly the numbe of compoition of n into pat. Let S be a et of object with weight function w, and let a n be the numbe of element of S of weight n. The geneating function fo S with epect to weight function w i given by Φ S (x) := a n x n. The idea i that if we can figue out a fomula fo the geneating function Φ S (x), then the numbe of element of S of weight n (which i jut a n ) can be found by looing at the coefficient of x n in Φ S (x). Let do ome example whee we now a n, and we want to wo out Φ S (x). Then we ll evee thing, and loo at poblem whee we don t now a n, but we can wo it out by looing at Φ S (x). Example. Let S = {0,,,...} and w(i) = i fo i = 0,,,.... So the object ae jut numbe, and the weight of a numbe i that numbe. Now to find Φ S (x), we fit wo out a n. Since a n i the numbe of object of weight n, and the only object of weight n i n itelf, we ee that a n = fo all n 0. Theefoe Φ S (x) = a n x n = x 0 x x... = x x.... n=0 You hould ecognie thi a the familia geometic eie with um /( x), o we conclude Φ S (x) = x. Example. Let S = {0,,,..., } and w(i) = i fo i =,,...,. Thi i the ame a the lat example, except a n = only fo n. So n=0 Φ S (x) = x x... x
which you hould ecognie a a finite geometic eie, with um (x )/(x ), o Φ S (x) = x x. Example. Let S = {(a, b) : a, b 0} and w(a, b) = a b. Thi i a bit moe ticy; to find a n, we need the numbe of (a, b) uch that a b = n. Well if we chooe a {0,,,..., n}, and thee ae n way to do that, b i fixed to be equal to n a. So a n = n, which mean Φ S (x) = x x 4x.... To um up the ight hand ide, we ue the fact that the left hand ide i the deivative of x x.... So Φ S (x) = d ( x x... ) = d ( ) = dx dx x ( x). Example. The binomial theoem i eally a theoem about geneating function. Fo y = it ay n ( ) n ( x) n = x. =0 Now let S be the et of all ubet of {,,..., n}, and the weight of a et be it ize. Then a = ( n ) thi i the numbe of element of S (et in {,,..., n}) which have weight (which have ize ). So ( ) ( ) ( ) n n n Φ S (x) = x 0 x... x n = ( x) n 0 n by the binomial theoem. Thee ae many moe inteeting example of geneating function, but ou eal aim i to ty to find a n fo poblem whee it i not immediately eay to do o. A mentioned, we ll do thi by fit woing out Φ S (x), and then tying to ee what in font of x n. We ll concentate on woing out a n when S i the et of all equence of length with etiction on the entie of S, and the weight of a equence i the um of it entie. Then a n i exactly the numbe of equence of length which add up to n. Theoem Let S be the et of all equence (x, x,..., x ) uch that x i S i, whee S i i a et of non-negative intege fo i =,,...,, and uppoe a n i the numbe of equence in S which add up to n. Then a n i the coefficient of x n in Φ S (x) = Φ S (x)φ S (x) Φ S (x) whee Φ Si (x) = S i x.
Although thi theoem i not difficult to pove, we will not do it hee. We ll conclude with a numbe of example. Example. Detemine the numbe of compoition of n into pat whee each pat i o. Fit we find Φ S (x) uing the theoem, whee S i the et of equence of length all of whoe entie ae o. In the theoem, S i = {, } fo i =,,...,, ince the ith enty of each equence i in the et {, }. Then fo i =,,...,. By the theoem, Φ Si (x) = x x Φ S (x) = (x x ) = x ( x). So we have found the geneating function fo S. Next we have to wo out a n (the coefficient of x n in Φ S (x)). Well Φ S (x) = x ( x) = x x by the binomial theoem applied to ( x). Thi i the ame a x. To get the coefficient of x n, we put = n, which mean a n =. n Example. Detemine the numbe of compoition of n into pat whee each pat i 0, o. Fit we find Φ S (x) uing the theoem, whee S i the et of equence of length all of whoe entie ae 0, o. In the theoem, S i = {0,, } fo i =,,...,, ince the ith enty of each equence i in the et {0,, }. Then fo i =,,...,. By the theoem, Φ Si (x) = x x Φ S (x) = ( x x ). So we have found the geneating function fo S. Next we have to wo out a n (the coefficient of x n in Φ S (x)). Well let z = x x, o that Φ S (x) = ( z) = z
by the binomial theoem. Thi till doen t help u ee whee x n i ince z = x x. But we can again apply the binomial theoem: z = x ( x) = x Subtituting thi in the oiginal um we get Φ S (x) = x =0 ( ) x = =0 ( ) x. =0 ( )( ) x. We have to put = n to get x n in the um. The coefficient of x n i then ( )( ) n which loo vey complicated, but nevethele it i the anwe. The anwe can be checed fo mall value of n. Fo example, if n = 4 and =, the ix equence adding up to n ae (,, ) (,, ) (,, ) (0,, ) (, 0, ) (,, 0). Let ee if the anwe we got befoe i 6. ( )( ) = 4 0 )( ) 0 4 )( ) )( ) )( ) = 0 0 = 6. The Extended Binomial Theoem. We can define ( a ) when a i a ational numbe a follow: ( ) a a(a )(a )... (a ) =.! Thi i the ame definition a when a i an intege. Then the binomial theoem can be extended to apply to (x y) a : Theoem Extended Binomial Theoem Let a be a ational numbe. Then ( ) a (x y) a = x y a. =0 4
Thi allow u to do moe with geneating function: Example. Detemine the numbe of compoition of n into pat whee each pat i even (including zeo). Fit we find Φ S (x) uing the theoem, whee S i the et of equence of length all of whoe entie ae even. In the theoem, S i = {0,, 4, 6,...} fo i =,,...,, ince the ith enty of each equence i in the et {0,, 4,...}. Then Φ Si (x) = x x 4 x 6... fo i =,,...,. So we now by the theoem Φ S (x) = ( x x 4...) and we have found the geneating function fo S. But it loo athe mey. Fotunately the baceted pat i a geometic eie which ha um /( x ), o Φ S (x) = ( x ). Next we have to wo out a n (the coefficient of x n in Φ S (x)). Well by the extended binomial theoem Φ S (x) = ( x ) = ( ) ( ) x. We have to put = n/ to get x n in the um, and we can t do that if n i odd. So if n i odd, then a n = 0. If n i even, then put = n/ o that ( ) a n =. n/ Let chec mall value of n and : if n = 4 and =, then the equence ae (, ), (0, 4), (4, 0) o thee ae thee of them. Thi agee with ( ) = ( )( )! =. You can ue the extended binomial theoem to pove that thee ae ( n ) compoition of n into pat (o each pat i an element of {,,...}); we poved thi theoem ealie uing a combinatoial tic. 5