Elementary Introduction to Differential Derivation + Taylor Expansion + Generating Function

Preface

As the necessary knowledge for solving polynomial problems in number theory, each of these things will not be explained too deeply, but they are related to each other.

The following part explains the excerpt from "Generation Function.pdf" of Giant DY.

(Because the author has a special liking for rich text editors, the following derivation formulas may be shown in pictures that cannot be copied)

Differential Derivation

Differentiation is a part of calculus. It should be talked about together with integration, but integration is more dependent on differentiation, and differentiation is relatively independent. It can be understood even if it is separated from calculus.

Derivation and differentiation are actually the same thing, and the process of differentiation is the process of derivation.

To derive a function, in layman's terms, is to find the function corresponding to the tangent slope of each point of the original function. For example, for a displacement-time image, we know that the greater the speed, the faster the displacement increases, and the tangent slope at a certain moment is equal to that moment. The instantaneous speed of, so the speed-time relationship is obtained after the displacement-time relationship is derived.

We call the derivative function f(x)of the function after the function has f(x)been derivated, denoted as (f(x))'OR f'(x). In particular, the function we f(x)find the function n times after the pilot called the f(x)n-order derivative, and can be written as f^{(n)}(x) (be careful not to write f^n(x), this is the f(x)power of n), so f(x)the derivative can be written as two (f(x))'', f''(x)can also be referred to f^{(2)}(x).
Some functions can be derivable, while others are not (such as weird polylines).

There are some practical things (formulas) that need to be memorized about derivation, and it is recommended to memorize:

After studying the derivative you will find some interesting things, such as sine and cosine of each other, such as and ^ xthe constant guide, for example \frac{1}{1-x}, and \frac{x}{1-x}the same derivative function, etc.

For a more detailed and rigorous explanation of differential derivation, you can read "Walking Calculus" (someone should have written a translation blog on csdn).

Taylor Expand

Taylor expansion, my understanding is to write a non-polynomial function (such as exponential logarithm, trigonometric function) into a polynomial form.

How to make the two equal? The derivative function is used here, and the standard formula is:

If f(x)it can be guided within n steps:

T_n(x)Called f(x)the Taylor polynomial at point x0 (with Peano-type remainder) , T_n(x)the coefficients are called Taylor coefficients .

Here x0 is a random value within the domain of definition, R(x) is the error of this n-th expansion, called Lagrangian remainder (a Peano-type remainder, just understand it, use Not much), if x0 and n are obtained properly, this error is generally very small.

The larger the n, the more accurate the expansion, so the Lagrangian remainder can be eliminated when n=∞:

f(x)=f(x_0)+\frac{f'(x_0)}{1!}(x-x_0)+\frac{f''(x_0)}{2!}(x-x_0)^2...=\sum_{i=0}^\infty \frac{f^{(i)}(x_0)}{i!}(x-x_0)^i

(The premise is f(x)that the derivative can be obtained indefinitely)

In particular, when x0=0, there is McLaughlin’s formula :

f(x)=f(0)+f'(0)x+\frac{f''(0)}{2!}x^2+...+\frac{f^{(n)}(0)}{n!}x^n+R(x^n)orf(x)=\sum_{i=0}^\infty \frac{f^{(i)}(0)}{i!}x^i

So far, we have established a connection between polynomial functions and non-polynomial functions.

There are some commonly used simple examples, it is recommended to write them together with the derivative function:

  • e^x=\sum_{i=0}^\infty \frac{x^i}{i!}, This is a good explanation, and ^ xafter seeking the derivation, just and ^ xbring in McLaughlin's formula. Replace the x -x can also be obtained: e^{-x}=\sum_{i=0}^\infty (-1)^i\frac{x^i}{i!}.
  • sin(x)=\sum_{i=0}^\infty (-1)^i\frac{x^{2i+1}}{(2i+1)!}Because (sin (x)) '= cos (x), (cos (x))' = - sin (x), the sin (x) 1-order, second order, third-order, fourth-order derivative, respectively cos(x), , -sin (x), -cos(x)and sin (x)then circulated, with入麦克劳林formula so, even term Taylor coefficients to zero.
  • cos(x)=\sum_{i=0}^\infty (-1)^i\frac{x^{2i}}{(2i)!}, And sin (x) Similarly, cos (x) the first derivative is 1 to 4 -sin (x), , -cos(x), sin (x)withcos(x)入麦克劳林formulas, coefficients, and sin (x) is offset a bit odd coefficients is zero.
  • \ln(x+1)=\sum_{i=1}^\infty(-1)^{i+1}\frac{x^i}{i}, Because (\ln(x+1))'=\frac{1}{x+1}=(x+1)^{-1}, then continue to derivate the equation on the right side, and \ ln (x+1)the n-th order derivative is obtained \frac{(-1)^{n+1}(n-1)!}{(x+1)^n}, so the above equation is obtained by introducing the McLaughlin formula. Why not write \ ln (x)it? Because the x0 taken by the Taylor polynomial must be easy to find in the function of each derivative, the \ ln (x)middle is 1, but if x0 takes 1, it will be included in the polynomial (x-1)^i, which is inconvenient to see. If you replace x in the formula with -x, you can change all the coefficients to -1, and get:\ln(1-x)=-\sum_{i=1}^\infty \frac{x^i}{i}, \sum_{i=1}^\infty\frac{x^i}{i}=-\ln(1-x)=\ln(\frac{1}{1-x})
  • \frac{1}{x+1}=\sum_{i=0}^\infty (-x)^i, According to \frac{1}{x+1}the n-th order derivative as known from the above process \frac{(-1)^{n}(n)!}{(x+1)^{n+1}}, the factorial can be eliminated after introducing the McLaughlin formula.
  • (x+1)^a=\sum_{i=0}^\infty \frac{x^i}{i!}\prod_{j=0}^{i-1}(a-j), This is obvious; \prod_{j=0}^{i-1}(a-j)in fact, it is the i-th descending power of a. When i>a, this expression is obviously 0, which automatically helps us eliminate the situation that the derivative function is 0 after the derivative a+1 times. So the original formula can also be a long way: (x+1)^a=\sum_{i=0}^a \frac{x^i}{i!}\prod_{j=0}^{i-1}(a-j).

For a more detailed and rigorous explanation of Taylor, you can look at the detailed analysis of other people's blog Taylor formula (there shouldn't be any copyright issues with the direct link, infringement ).

Generating function

The generating function is also called the generating function. It is a magic weapon used in many combination permutation problems. It's a pity that I just learned it and I don't know how to use it to solve problems at all.

Ordinary generating function

For an infinite sequence \begin{Bmatrix}a_0,a_1,a_2,...\end{Bmatrix}, which define the normal generation function in the form of power series: \sum_{k=0}^\infty a_k\cdot x^k.

Why is it called a formal power series? It is different from ordinary power series. The addition of the word "form" means that it is just a formal polynomial about x. In all relevant derivations, the default expression is meaningful, that is, the value of x is ignored.

After understanding the definition, let’s take a look at some common examples that will be used later (it is recommended to memorize it):

  • Sequence \begin{Bmatrix}\frac{1}{0!},\frac{1}{1!},\frac{1}{2!},...,\frac{1}{k!},...\end{Bmatrix}common generating and ^ xfunction: . This is \sum_{i=0}^\infty x^ia very clever, because the function is defined according to the mother to get to \sum_{i=0}^\infty \frac{x^i}{i!}, just and ^ xthe Taylor expansion.
  • Sequence \begin{Bmatrix}1,1,1,...,1,...\end{Bmatrix}common generating \frac{1}{1-x}function: . Mother function \sum_{i=0}^\infty x^i, which is an infinite number of geometric items column summation, when x\in (-1,1)when there is summation formula \sum_{i=0}^\infty x^i=\frac{1}{1-x}, because the mother is a form of power series function, so regardless of the value of x, such as direct past.
  • Sequence \begin{Bmatrix}1,2,4,...,2^k,...\end{Bmatrix}common generating \frac{1}{1-2x}function: . The generating function is a \sum_{i=0}^\infty 2^ix^i=\sum_{i=0}^\infty (2x)^i=\frac{1}{1-2x}set of summation formulas for geometric series.
  • Sequence \begin{Bmatrix}1,0,1,0,...,1,0,...\end{Bmatrix}common generating \frac{1}{1-x^2}function: . The generating function is \sum_{i=0}^\infty x^{2i}=\sum_{i=0}^\infty (x^2)^i=\frac{1}{1-x^2}. From this generalization, the general generating function of a sequence of any number of 0s between two 1s can be made by the summation formula of geometric series.
  • Sequence \begin{Bmatrix}0,1,0,1,...,0,1,...\end{Bmatrix}common generating \frac{x}{1-x^2}function: . The generating function is \sum_{i=0}^\infty x^{2i+1}=x\sum_{i=0}^\infty (x^2)^i=\frac{x}{1-x^2}.
  • Sequence \begin{Bmatrix}1,2,3,...,k,...\end{Bmatrix}common generating \frac{1}{(1-x)^2}function: . This is also very clever, generating function is \sum_{i=0}^\infty (i+1)x^ifound is just \sum_{i=0}^\infty x^{i+1}the derivative function, due to the constant term of the derivative will be eliminated, so is \sum_{i=0}^\infty x^ithe derivative of the function, \sum_{i=0}^\infty x^i=\frac{1}{1-x}put \frac{1}{1-x}the derivation is \frac{1}{(1-x)^2}.

application

Ordinary generating functions are often used to solve the problem of unlabeled combination counting.

For example, the number of i number schemes selected in set A is, the number of i number schemes a_iin set B is b_i, and the total number of i schemes in A and B is selected as c_i, which is obviously satisfied c_i=\sum_{j=0}^ia^jb^{i-j}. It seems to be the convolution form of polynomial multiplication, so \begin{Bmatrix}c_0,c_1,c_2,...,c_k,...\end{Bmatrix}The ordinary generating function of the sequence is F(c)exactly equal to F(a)\cdot F(b).

#1

There is a classic example:

There are four infinite fruits. The first type is required to take out an even number, the second type to take out a multiple of 5, the third type to take at most 4, and the fourth type to take at most 1, and it is required to take out exactly n The number of plans for each fruit.

Obviously you can see the answer directly, but we apply what we have learned and multiply it with 4 generating functions:, \frac{1}{1-x^2}\cdot \frac{1}{1-x^5}\cdot (\sum_{i=0}^4x^i)\cdot (1+x)=\frac{1}{1-x^2}\cdot \frac{1}{1-x^5}\cdot \frac{1-x^5}{1-x}\cdot (1+x)=\frac{1}{(1-x)^2}and it \frac{1}{(1-x)^2}happens to be \begin{Bmatrix}1,2,3,...,k,...\end{Bmatrix}the ordinary generating function of the sequence , so the answer is n+1.

#2

Find a_0 = a_1 = 1,a_n = a_{n-1} + a_{n-2}the ordinary generating function of Fibonacci sequence (n ≥ 2):

Using the characteristic root method, the general term formula of the Fibonacci sequence can be obtained.

Exponential generating function

For an infinite sequence \begin{Bmatrix}a_0,a_1,a_2,...\end{Bmatrix}, which is defined exponential function generated in the form of power series: \sum_{k=0}^\infty a_k\cdot \frac{x^k}{k!}.

application

Compared with ordinary generating functions, exponential generating functions are more practical. The ordinary generating function is usually used to solve the unlabeled counting problem, and the exponential generating function is usually used to solve the labeled counting problem, that is, the permutation counting.

As a simple example of the same, for example, set the number of permutations of the number A i is selected a_i, set the number of permutations of the number of B i is selected b_i, the selected number of permutations of the number i, CCP A and B c_i, apparently satisfied c_i=\sum_{j=0}^i\binom{i}{j}a_jb_{i-j}=\sum_{j=0}^i\frac{i!}{j!(i-j)!}a_jb_{i-j}=\sum_{j=0}^ii!\frac{a_j}{j!}\frac{b_{i-j}}{(i-j)!}, \sum_{i=0}^\infty c_i\frac{x^i}{i!}=\sum_{i=0}^\infty x^i\sum_{j=0}^i\frac{a^j}{j!}\frac{b^{i-j}}{(i-j)!}=\sum_{i=0}^\infty \sum_{j=0}^ia_j\frac{x^j}{j!}\cdot b_{i-j}\frac{x^{i-j}}{(i-j)!}and therefore \begin{Bmatrix}c_0,c_1,c_2,...,c_k,...\end{Bmatrix}The exponential generating function of the sequence is \hat{F}(c)exactly equal to \hat{F}(a)\cdot \hat{F}(b).

Some examples:

  • the number of permutations of n elements p_n=n!exponential generating function: .
  • c_n=(n-1)!The exponential generating function of the number of ring arrangements of n elements (n ≥ 1):, \hat{C}(x)=\sum_{n=1}^\infty\frac{(n-1)!}{n!}x^n=\sum_{n=1}^\infty \frac{x^n}{n}=-\ln(1-x)=\ln(\frac{1}{1-x})you will find \hat{P}(x)=e^{\hat{C}(x)}that this is not a coincidence. You can understand from the perspective of permutation (taken from Yongshen OneInDark's blog ):
  • \forall i\in[1,n],p_i \neq iThe exponential generating function of the staggered number of n elements (satisfied permutation number): Consider the exclusion formula of staggered number , so there is \hat{D}(x)=\sum_{i=0}^\infty \frac{x^i}{i!}\sum_{j=0}^i\binom{i}{j}(-1)^j(i-j)! \\=\sum_{i=0}^\infty \sum_{j=0}^i\frac{(-1)^j}{j!}x^j\frac{(i-j)!}{(i-j)!}x^{i-j} \\=(\sum_{i=0}^\infty (-1)^i\frac{x^i}{i!})\cdot (\sum_{i=0}^\infty i!\frac{x^i}{i!}), the first tuft is equal to and ^ {- x}the exponential generating function of the permutation number , so \hat{D}(x)=\frac{e^{-x}}{1-x}.

There are still many examples, I will not start, the most important thing is to gain experience by doing problems.

Dry goods

#1

#2

  • e^x=\sum_{i=0}^\infty \frac{x^i}{i!}e^{-x}=\sum_{i=0}^\infty (-1)^i\frac{x^i}{i!}
  • sin(x)=\sum_{i=0}^\infty (-1)^i\frac{x^{2i+1}}{(2i+1)!}
  • cos(x)=\sum_{i=0}^\infty (-1)^i\frac{x^{2i}}{(2i)!}
  • \ln(x+1)=\sum_{i=1}^\infty(-1)^{i+1}\frac{x^i}{i}\ln(1-x)=-\sum_{i=1}^\infty \frac{x^i}{i}\sum_{i=1}^\infty\frac{x^i}{i}=-\ln(1-x)=\ln(\frac{1}{1-x})
  • \frac{1}{x+1}=\sum_{i=0}^\infty (-x)^i
  • (x+1)^a=\sum_{i=0}^\infty \frac{x^i}{i!}\prod_{j=0}^{i-1}(a-j)=\sum_{i=0}^a \frac{x^i}{i!}\prod_{j=0}^{i-1}(a-j)

#3

  • \begin{Bmatrix}\frac{1}{0!},\frac{1}{1!},\frac{1}{2!},...,\frac{1}{k!},...\end{Bmatrix}The ordinary generating function of the sequence :and ^ x
  • \begin{Bmatrix}1,1,1,...,1,...\end{Bmatrix}The ordinary generating function of the sequence :\frac{1}{1-x}
  • \begin{Bmatrix}1,2,4,...,2^k,...\end{Bmatrix}The ordinary generating function of the sequence :\frac{1}{1-2x}
  • \begin{Bmatrix}1,0,1,0,...,1,0,...\end{Bmatrix}The ordinary generating function of the sequence :\frac{1}{1-x^2}
  • \begin{Bmatrix}0,1,0,1,...,0,1,...\end{Bmatrix}The ordinary generating function of the sequence :\frac{x}{1-x^2}
  • \begin{Bmatrix}1,2,3,...,k,...\end{Bmatrix}The ordinary generating function of the sequence :\frac{1}{(1-x)^2}
  • a_0 = a_1 = 1,a_n = a_{n-1} + a_{n-2}Common generating function of Fibonacci sequence (n ≥ 2):\frac{1}{1-x-x^2}

#4

  • Exponential generating function of the number of permutations of n elements:\hat{P}(x)=\frac{1}{1-x}
  • the arrangement index n number of ring elements generating function: \hat{C}(x)=\ln(\frac{1}{1-x}),\hat{P}(x)=e^{\hat{C}(x)}
  • Exponential generating function of the number of staggered n elements:\hat{D}(x)=\frac{e^{-x}}{1-x}

Guess you like

Origin blog.csdn.net/weixin_43960287/article/details/113842054