The generative function is to construct such a polynomial function g (x), so that the n coefficient of X is F (n ). For example, the sequence {0, 1, 2, 3, 4, 5... n} generation function: $ f (x) = 0 + x + 2x ^ 2 + 3x ^ 3 + 4x ^ 4 +... + NX ^ N $
The most amazing thing about generating a function is that some generated functions can be reduced to a very simple function. That is to say, not every generated function is represented by a long string of polynomials. For example, if F (n) = 1 (n belongs to a natural number of course), its generated function should be $ g (x) = 1 + x ^ 2 + x ^ 3 + x ^ 4 + \ ldots $ (each item is one, even if n = 0, the $ x ^ 0 $ coefficient is 1, so there is a constant ). Let's take a closer look. This is the sum of an infinite number of proportional series. If-1 <x <1, g (x) is equal to 1. When studying the generation of functions, we all assume that the number of series converges. Because the X of the generation function has no practical significance, we can take any value. So we can say that the generation function of F (n) = 1 is g (x) = 1 ).
An example shows that some practical combination problems can be expressed in a simple function like this.
Consider this question: how many methods are there to select n mm from the second shift with only 4mm. Anyone who has learned simple arrangement and combination knows that the answer is C (4, N ). That is to say. Starting from n = 0, the answer to the question is 1, 4, 6, 4, 1, 0, 0 ,... (select more than four persons from 4mm. Of course, the number of solutions is 0 ). Then its generation function g (x) should be $ g (x) = 1 + 4x + 6x ^ 2 + 4x ^ 3 + x ^ 4 $. This is not ...... Does the binary expand? Therefore, $ g (x) = (1 + x) ^ 4 $.
You may know that $(1 + x) ^ K = C (K, 0) x ^ 0 + C (k, 1) x ^ 1 + \ ldots + C (K, k) x ^ K $; but you may not know that even if K is a negative number or a decimal number, there is a similar conclusion: $(1 + x) ^ K = C (K, 0) x ^ 0 + C (k, 1) x ^ 1 +... + C (K, k) x ^ K + C (K, k + 1) x ^ (k + 1) + C (K, K + 2) x ^ (K + 2) + \ ldots $ (always add to infinity ). Among them, the generalized composite number C (K, I) is equal to K (k-1) (K-2 )... (K-I + 1)/I !, For example, C (4, 6) = 4*3*2*1*0 * (-1)/6! = 0, and then C (-1.4, 2) = (-1.4) * (-2.4)/2! = 1.68. The following is called the Newton's binary theorem. When K is an integer, all the molecules in C (K, I) when I> K must "Cross" 0. Therefore, C (K, k + 1) follows ), C (K, K + 2) and so on are all 0, which is the same as the conclusions of our classic binary theorem. The difference is that the exponent K in Newton's binary theorem can be any real number.
Let's take another example to illustrate some more complex generation functions. How many non-negative integer solutions does n = X1 + X2 + X3 +... + XK have? This is a classic example of arrangement and combination. Add 1 to each number of solutions in each group, and then change to the number of positive integer solutions of N + k = X1 + X2 + X3 +... + XK.
The teaching material may appear such a difficult name is called "partition method": N + k stuff into a row, in N + k-1 space insert K-1 a "partition ". The answer we always know is C (n + k-1, k-1 ). It is equal to C (n + k-1, n ). The function for generating N is $ g (x) = 1/() ^ K $. How does this generation function come from? In fact, it is ()-K to the power. Show $ () ^ {-k} $ according to the Newton's binary, we get the coefficient of $ x ^ N $ which is exactly C (n + k-1, n ), because $ C (-k, n) * (-x) ^ n = [(-1) ^ N * C (n + k-1, n)] * [(-1) ^ N * x ^ N] = C (n + k-1, n) x ^ N $. It doesn't matter if the system is dizzy. In the following article, we can use another method to export the same formula. As a matter of fact, we have a simpler way to explain a pure combination of mathematics. Because of the geometric series $1 + x ^ 2 + x ^ 3 + x ^ 4 +... = 1/(≥) $, then $(1 + x ^ 2 + x ^ 3 + x ^ 4 + ...) ^ K $ is equal to $1/() ^ K $. Think about what it means to multiply K ($1 + x ^ 2 + x ^ 3 + x ^ 4 + \ ldots $. $(1 + x ^ 2 + x ^ 3 + x ^ 4 + \ ldots) ^ in the k $ expansion, the coefficient of N items is our answer, this coefficient is obtained from the combination of the first K indexes that are exactly equal to n.
Now let's refer to the most typical example in composite mathematics:
We want to get some fruit from apples, bananas, oranges and pears. We require that Apple only have an even number. The number of bananas should be a multiple of 5, and the number of oranges should be four at most, you can take only one pear. Ask the number of fruit solutions that meet this requirement.
We can also calculate the generation function of this problem by multiplying K ($1 + x ^ 2 + x ^ 3 + x ^ 4 + \ ldots $.
$ G (x) = (1 + x ^ 2 + x ^ 4 + ...) (1 + x ^ 5 + x ^ 10 + ..) (1 + x ^ 2 + x ^ 3 + x ^ 4) (1 + x )\\
= [1/(^ 2)] * [1/(^ 5)] * [(^ 5)/()] * (1 + x) (the first two are geometric series with a ratio of 2 and 5 respectively )\\
= 1/() ^ 2 \\
= () ^ {-2} = C () + C () x ^ 2 + C) x ^ 3 + \ ldots (see the expansion of 1/() ^ K just now )\\
= 1 + 2x + 3x ^ 2 + 4x ^ 3 + 5x ^ 4 +... $
Therefore, there are n + 1 methods to get n fruits. We use the generative function to obtain the answer by means of algebra!
We use two methods to obtain the formula $1/() ^ n = 1 + C (n, 1) x ^ 1 + C (n +) x ^ 2 + C (n + 2, 3) x ^ 3 +... + C (n + k-1, k) x ^ K + \ ldots $. This formula is very useful. It is a weapon for restoring a generated function to a series. It is also a nuclear weapon.
Next we will demonstrate how to use the generated function to obtain the generic formula of the Fibonacci series.
The Fibonacci series is such a recursive Series: F (n) = f (n-1) + f (n-2 ). Now we need to find its generation function g (x ).
$ G (x) = x + x ^ 2 + 2x ^ 3 + 3x ^ 4 + 5x ^ 5 + 8x ^ 6 + 13X ^ 7 \ ldots $
Multiply the two sides of the equation by X at the same time, and we get:
$ X * g (x) = x ^ 2 + x ^ 3 + 2x ^ 4 + 3x ^ 5 + 5x ^ 6 + 8x ^ 7 + \ ldots $
As we have said before, this is equivalent to moving one digit to the right of all coefficients on the right of the equation.
Now let's add the two formulas, and we get:
$ G (x) + x * g (x) = x + 2x ^ 2 + 3x ^ 3 + 5x ^ 4 + 8x ^ 5 + \ ldots $
Compare the last expression with the first one. If the coefficient of the first formula moves one digit to the left, and then the excess "1" is removed, it becomes the last formula. Due to the nature of recursive functions, we obtain the magic: G (x) + x * g (x) = g (x)/X-1. That is, $ g (x) * x ^ 2 + g (x) * X-g (x) =-x $. Put the G (x) on the left, we have: $ g (x) (x ^ 2 + x-1) =-x $. Therefore, we get $ g (x) = x/(1-x-x ^ 2) $.
Now we have restored $ X/(1-x-x ^ 2) $ to a general formula. This is not the form of $1/() ^ N $. We need to convert it into this form.
We found that $ 1-x-x ^ 2 = [1-(1-\ SQRT {5}) X/2] * [1-(1 + \ SQRT {5 }) x/2] $, $ (1-\ SQRT {5})/2 $ and $(1 + \ SQRT {5 }) /2 $ is $ x ^ 2-x-1 = 0 $.
So $ X/(1-x-x ^ 2) = \ frac {C_1} {1-(1-\ SQRT {5 }) x/2} + \ frac {C_2} {1-(1 + \ SQRT {5}) X/2} $
$ = \ Frac {C_1*[1-(1 + √ 5) X/2] + C_2 * [1-(1-√ 5) x/2]} {[1-(1-\ SQRT {5}) X/2] * [1-(1 + \ SQRT {5 }) x/2]} $
$ = \ Frac {C_1*[1-(1 + √ 5) X/2] + C_2 * [1-(1-√ 5) x/2]} {1-x-x ^ 2} $
That is to say, $ C_1 * [1-(1 + √ 5) X/2] + C_2 * [1-(1-√ 5) X/2] = x $.
X = 0, $ C_1 + C_2 = 0 $; X = 1, $ \ frac {1-\ SQRT {5 }}{ 2} C_1 + \ frac {1 + \ SQRT {5 }}{ 2} c_2 = 1 $. You can obtain $ c_1 =-1/\ SQRT {5}, C_2 = 1/\ SQRT {5} $.
Therefore, $ X/(1-x-x ^ 2) =\ frac {-1/\ SQRT {5 }}{ 1-(1-\ SQRT {5 }) x/2} + \ frac {1/\ SQRT {5 }}{ 1-(1 + \ SQRT {5}) X/2} $
Primary function problems [go]