Anda di halaman 1dari 4

Generating Functions in Combinatorics By Amir Goren Let's start with a little problem: How many different options do we have

to choose n balls from colors red, yellow and blue, regardless of the order, to get even number of red balls, odd number of yellow balls, and number of blue balls is 3 or less? It seems like a complicated problem that should be converted to an easier one. Let's try to solve the problem (with all the conditions it places) with red balls only. So the question we have to face now is how many options do we have to choose n red balls with given conditions of the problem, which means even number. Since this number depends on n, we define: Rn = number of ways to choose n red balls with the conditions of the problem (even number of n red balls regardless of the order). This is much easier problem. Since we don't distinguish between same-colored balls, if n is even, we have only one way to choose even number of n red balls, and if n is odd we don't have any way to choose even number of n red balls. We receive: (1) Rn = (n=0, 1, 2, )

That was easy. Let's examine the yellow balls. By same definition: Yn = number of ways to choose n yellow balls with the conditions of the problem (odd number of n yellow balls regardless of the order). Again, different yellow balls are the same for us, we get: (2) Yn = (n=0, 1, 2, )

Now we are ready to solve the problem for the red and yellow balls together. We define: RYn = number of ways to choose n red and yellow balls with the conditions of the problem (number of red balls is even and number of yellow balls is odd). How can we choose n red and yellow balls with these conditions? Well, these n balls split into red balls and yellow balls. We might have: 0 red balls and n yellow balls, or 1 red ball, and (n-1) yellow balls, or 2 red balls, and (n-2) yellow balls, or . .. n red balls, and 0 yellow balls.

That means, for every k between 0 and n, we might have k red balls and (n-k) yellow balls. If we give k all the values between 0 and n, we cover all the different possibilities, and every two different values of k represent other options of choosing. So we can choose n red and yellow balls by passing on all the values (k=0, 1, 2, , n) and choose k red balls and (n-k) yellow balls. How many options will it make? For every value of k, first we choose k red balls (following the conditions). By the definitions we had before, we have Rk options to do that. Then we just need to choose (n-k) yellow balls, and we have Yn-k options for that. By the combinatorical multiplication principle, we receive that the total number of options is Rk Yn-k passing on all possible values for k gives us: (3) RYn = Hurray! We solved the problem! Well, not exactly. Indeed, we well-defined the number RYn for every natural number n, but calculating it for big values of n may be exhausting. We would like to have an explicit formula for RYn for that, we have to look at formula (3) little more carefully. This formula reminds you something? Let's talk about polynomials a while. A polynomial (of variable x) is an expression of the form a0 + a1x + a2x2 + + amxm, where am is not 0. m is called the degree of the polynomial, and signed by deg(polynomial). Suppose we have another polynomial from the same degree, for example b0 + b1x + b2x2 + + bmxm, and we would like to multiply these two polynomials. What will the multiplication be? By distributiveness of multiplication above the addition, it's easy to be convinced that the multiplication is: a0b0 + (a0b1 + a1b0)x + (a0b2 + a1b1 + a2b0)x2+ In other words, if we define cn as the coefficient of xn at the multiplication (suppose n then: (4) cn = which is identical to formula (3)! m),

This is the motivation for defining the standard generating function. Definition: The standard generating function of real-numbers series a0, a1, a2, is the formal power series: = a0 + a1x + a2x2 + a3x3 +

It's important to understand that formal power series has nothing to do about convergence. We are allowed to talk about formal power series of any series we can dream of, even if its radius of convergence is 0. For example, the power series = 1 + x + 2x2 + 6x3 + 24x4 + 120x5 + Is a perfectly legal power series, although it convergences only at x=0. That's exactly what makes this power series only "formal". While talking about formal power series, we don't care about convergence, and there is no use to place numbers instead of x. This is not a function, just a good way to present the series. Why is it a good way? Here is why: On the set of formal power series (which is usually signed by R[[x]]) we define 2 binary actions: first, the trivial addition: (5) +

Multiplication is defined by "endless parentheses opening", inspired by the polynomials multiplication we have seen earlier: (6) Where the coefficients cn defined by: (7) cn = a0bn + a1bn-1 + + anb0

Every cn is well-defined by adding finite number of numbers, and in total, the series is welldefined. This set of formal power series, with these two actions, creates an interesting algebraic structure called Ring and is worth discussion even outside the context of combinatorics. Now, equipped with all we have learnt about formal power series, let's go back to our problem. We sign R(x), Y(x), and RY(x) the standard generating functions which are appropriate to Rn, Yn, and RYn from formulas (1) and (2), we receive: (8) R(x) = 1 + 0 x + 1 x2 + 0 x3 + = 1 + x2 + x4 + (9) Y(x) = 0 + 1 x + 0 x2 + 1 x3 + = x + x3 + x5 + From formula (3) we receive, by the definition of formal power series multiplication: (10) RY(x) = R(x) Y(x) Alright, wonderful! We translated the original problem into problem of multiplying formal power series. How does it help us? Here calculus enters to the picture. Although formal power series don't have to convergence in any way, it might be comfortable if they do. In our case, both of them converge at |x|<1. The sums are: (11) R(x) = 1 + x2 + x4 + =

(12) Y(x) = x + x3 + x5 + = x (1 + x2 + x4 + ) = Notice that the transition between the generating function and its sum is reversible: as we calculated the sum out of the series, we can restore the series only by its sum, by developing it to a power series, as done a lot at calculus. In other words, the expression encodes all the information about the series Rn; once we know it, we can forget about the original series and work with the generating function only. Nice thing about convergence of formal power series is that if two formal power series convergence, we can work with their sums instead of the series, including multiplication. That means that instead of doing the endless action of finding all the coefficients at the multiplication, we can just multiply their sum as we are used to multiply functions, and then restore the formal power series from the result. It looks very natural, but is not trivial at all. In fact, that is the thing that makes generating function so powerful. While multiplying two series as we defined the multiplication is a difficult, endless action, multiplying functions is a quite simple action that we are used to do since we were at high school. So let's multiply. We receive, by (10): RY(x) = R(x) Y(x) = (13) RY(x) = And now the entire problem is finding the series that RY(x) encodes. But note that: 2 RY(x) = = = (1 + x2 + x4 + ) = 2x + 4x3 + 6x5 +

(14) RY(x) = x + 2x3 + 3x5 + = And therefore: RYn = This is the number of options to choose n red and yellow balls in the conditions of the original problem. To finish solving it, we have to find the generating function of the blue balls, multiply it by RY(x) and restore the series. Enjoy!

Anda mungkin juga menyukai