
Generating Functions Notes for Math 447 March 31, 2011 1 Ordinary generating functions 1.1 One variable 1.1.1 Generalities An ordinary generating function is a convenient way of working with a sequence of numbers ak defined for k ≥ 0. It is a power series of the form X∞ k f(x) = akx . (1) k=0 The utility of this notion is explained by the product property. Consider a collection of functions f (j)(x) for j in some index set B. For notational simplicity we take B to be the natural numbers from 1 to n. Suppose also that X∞ (j) (j) k f (x) = ak x . (2) k=0 Let X∞ (1) (2) (n) k f(x) = f (x)f (x) ··· f (x) = akx . (3) k=0 be the product of the ordinary generating functions. Then the coefficient ak corresponding to the product is X a = a(1)a(2)k ··· a(n). (4) k k1 2 kn k1+k2+...+kn=k This is a sum over all sequences k1, . , kn of natural numbers with k1 + k2 + ... + kn = k of combinatorial coefficients satisfying a product rule. In fact, it is a sum over multi-indices. So a complicated operation involving a huge sum over multi-indices corresponds to a simple operation on the ordinary generating function: multiplication. One use for ordinary generating functions is to count multi-indices on a set B satisfying certain restrictions. Say that one wants to know how many ways there 1 are to select up to 2 apples, 3 or 4 oranges, and an even number of bananas to get k fruits. Here B is the set of three fruits. The ordinary generating function is 1 − x3 1 f(x) = (1+x+x2)(x3 +x4)(1+x2 +x4 +x6 +x8 +···) = x3(1+x) . 1 − x 1 − x2 (5) The factors correspond to the different kinds of fruits; the terms within the factors give the inventory of available numbers of each kind of fruit. 1.1.2 Multiset coefficients An important special case is when there are no restrictions on the multi-indices. In that case, the ordinary generating function for the number of multi-indices on an n point set of size k is µµ ¶¶ X∞ n M (x) = xk = (1 + x + x2 + x3 + ···)n = (1 − x)−n. (6) n k k=0 1.1.3 Binomial coefficients Another important special case is when the restriction is that the values of the multi-index must be 0 or 1. Such multi-indices correspond to subsets of B. In that case, the ordinary generating function for the number of subsets of an n point set of size k is µ ¶ X∞ n B (x) = xk = (1 + x)n. (7) n k k=0 Sometimes a problem that does not seem to be a multi-index problem can be reformulated to be of the correct form. Consider, for instance, the problem ¡n¢ of finding the generating function for binomial coefficients k for fixed k as a function of n. The trick is to think of each set as being listed in order, from 1 to n. Take a set B with 2k + 1 points. There is a bijection between multi-indices on B and subsets with k elements. The multi-index corresponding to a subset counts the number of elements between each of the elements of the subset and also counts each element. So the ordinary generating function is µ ¶ X∞ n B (y) = yn k k n=0 = (1 + y + y2 + y3 + ···)y ··· (1 + y + y2 + y3 + ···)y(1 + y + y2 + y3 + ···) yn = . (8) (1 − y)n+1 2 1.1.4 Integer partitions The problem of counting integer partitions may also be studied by this method. Each integer partition corresponds to a type vector, which is a multi-index on the set of strictly positive natural numbers. Say that the type-vector is p1, p1, p3 . , pj,..., eventually zero. This determines another multi-index of the form 1p1, 2p2, 3p3, . , jpj,... whose values are multiples of j. The coefficient p(k) of xk is the number of such multi-indices that have sum k. So the ordinary generating function for integer partitions is X∞ P (x) = p(k)xk k=0 = (1 + x + x2 + x3 + ···)(1 + x2 + x4 + x6 + ···)(1 + x3 + x6 + x9 + ···) ··· = (1 − x)−1(1 − x2)−1(1 − x3)−1 ··· . (9) Let p(k, [n]) be the number of integer partitions of k into parts each of some size j with j ≤ n. The ordinary generating function is X∞ k P[n](x) = p(k, [n])x k=0 = (1 + x + x2 + x3 + ···)(1 + x2 + x4 + x6 + ···) ··· (1 + xn + x2n + x3n + ···) = (1 − x)−1(1 − x2)−1(1 − x3)−1 ··· (1 − xn)−1. (10) How about the seemingly more complicated problem of counting integer partitions of k into n parts? It may be proved by conjugation that the number p(k, ≤ n) of partitions into at most n parts is given by p(k, ≤ n) = p(k, [n]). Therefore the ordinary generating functions are equal: P≤n(x) = P[n](x). The ordinary generating function for integer partitions of k into n parts is then obtained by p(k, n) = p(k, ≤ n) − p(k, ≤ n − 1), giving · ¸ 1 P (x) = P (x) − P (x) = P (x) − 1 n ≤n ≤n−1 ≤n−1 1 − xn xn = P (x) = xnP (x). (11) ≤n−1 1 − xn ≤n Notice that this immediately implies that p(k, n) = p(k − n, ≤ n). 1.1.5 Words and sentences Here are applications of ordinary generating functions that go beyond multi- indices. Consider an alphabet with m letters. The number of words of length k is mk. This is of course just the number of functions from a k element set to an m element set. The ordinary generating function is X∞ X∞ (1 − mx)−1 = (mx)k = mkxk. (12) k=0 k=0 3 Now consider sentences of n words having a total of k letters from an alpha- bet of m letters. A sentence is a sequence of words, so the ordinary generating function is µµ ¶¶ µ ¶ X∞ n X∞ k + n − 1 (1 − mx)−n = (mx)k = mkxk. (13) k n − 1 k=0 k=0 This has a simple interpretation. There are mk sequences of letters. These can be divided up into words by placing n − 1 barriers between sequences, thus designating words. 1.1.6 Set partitions There is an interesting ordinary generating function for set partitions of a set with k elements into n blocks. The number of such set partitions is the Stirling number of the second kind S(k, n), so this is another way of getting at Stirling numbers of the second kind. The trick is to take the k element set that is being partitioned in order, from 1 to k. In each block of the set partition, consider the smallest element. This determines an ordering of the blocks. Consider an alphabet with n letters arranged in order. Then the set partition determines a sentence. The jth word in the sentence consists of the jth letter in the alphabet, followed by the other letters that occur in that block. The jth word only uses the first j letters of the n letters in the alphabet. The ordinary generating function for such sentences is X∞ k Sn(x) = S(k, n)x k=0 = x(1 − x)−1x(1 − 2x)−1x(1 − 3x)−1 ··· x(1 − nx)−1 = xn(1 − x)−1(1 − 2x)−1(1 − 3x)−1 ··· (1 − nx)−1. (14) The ordinary generating function for set partition numbers depends on an artificial ordering of the set. For such problems involving sets another tool is more natural: the exponential generating function. 1.2 Two variable 1.2.1 Binomial coefficients ¡n¢ There is something awkward about having two generating functions for k . Using two variables gives a nicer way to think of the situation. Thus consider µ ¶ X∞ X∞ n X∞ 1 B(x, y) = xkyn = (1 + x)nyn = . (15) k 1 − (1 + x)y n=0 k=0 n=0 This is a beautiful packaging of the facts about binomial coefficients. One has an experiment with many stages. At each stage one gets a 0 or 1 according to 4 whether there is a failure or a success at that stage. This is indicated by the 1 + x factor. Furthermore, in either case one counts this stage with a y factor. So at each stage there is a (1 + x)y term. The infinite sequence of stages is then given by taking the geometric series 1/(1 − z) and replacing z by (1 + x)y. One byproduct of this analysis is the other series for the binomial coefficients. One writes µ ¶ X∞ X∞ n 1 1 X∞ yk B(x, y) = ynxk = = xk. (16) k 1 − y 1 − y x (1 − y)k+1 k=0 n=0 1−y k=0 We recover the result µ ¶ X∞ n yk B (y) = yn = . (17) k k (1 − y)k+1 n=0 1.2.2 Multiset coefficients ¡¡n¢¢ One can make a similar calculation for the multiset coefficients k . Thus consider µµ ¶¶ X∞ X∞ n X∞ 1 M(x, y) = xkyn = (1 − x)−nyn = . (18) k 1 − 1 y n=0 k=0 n=0 1−x At each stage one gets a natural number. This is indicated by the 1/(1 − x) factor. Furthermore, one counts this stage with a y factor. So at each stage there is a y/(1−x) term.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages12 Page
-
File Size-