2019 Summer Jinhua training Day5 generating function

Autistic training Day5

Generating function

Usually generation function

No brain put into the polynomial sequence:
\ [\ {a_i \} \ rightarrow A (X) = \ sum_ a_nx} ^ {n-n-\]

Formal Power Series

Generating function is a form of power series. We do not care about the function of specific values, concerned only with coefficients of the polynomial. When needed can \ (x \) as an arbitrary value.

example

Seeking \ (\ {n ^ 2 \ } \) generating functions.

This ...... just know \ (\ {{n + k -1 \ choose k-1} \} \) of the generating function is \ (\ frac 1 {(1 + x) ^ k} \) gone.

example

Simple generating function problems, do not speak.

Exponential generating function

Exponential function is used to generate permutations of the item about to engage.

\(\{a_n\}\rightarrow \sum_n a_n\frac{x^n}{n!}\)

principle? There \ (K \) for planting, each having \ (a_ {1..k} \) a, then the number of the arrangement is \ (\ frac {n!} {\ Prod a_i!} \) .

Retaining only the even-numbered generating function: \ (\ E ^ {X FRAC + E ^ {-} X {2}} \) ; retain only the odd-numbered: \ (\ E ^ {XE FRAC ^ {-} X {2}} \) .

Circular convolution

Cyclic convolution polynomial, i.e. to take out \ (n-\) modulo.

As we all know, FFT is circular convolution. But do FFT time staged a sufficiently large \ (n \) so as not to overflow.

A two-dimensional circular convolution: Let matrix \ (n \ times m \) , then
\ [DFT (A) _ { i, j} = \ sum_ {k = 0} ^ {n-1} \ sum_ { l = 0} ^ {m-
1} A_ {k, l} \ omega_n ^ {ik} \ omega_m ^ {jl} \] satisfies the
\ [DFT (A * B) = DFT (A) * DFT (B) \]
(nonsense, of course, the point values can be multiplied)

Seeking: put each row DFT, then each column DFT.

FWT

FWT is \ (k \) dimensional circular convolution (XOR).

When considering die 2, \ (\ Omega = -1 \) , then the point value into the belt, is found just FWT equation. Then IDFT time is the same.

So conclusion: FWT only do not necessarily circular convolution module 2, you can do many more things.

(I came to understand how today understand this truth ...... earlier this year, the province will be able to sign the election a success ......)

Cyclic convolution any length

(Hereinafter, \ (\ Omega \) refer to \ (\ omega_n \) ) \
[\} * the begin {align = left & B_i = \ sum_ {J} = 0. 1-n-^ {} \} A_j Omega ij of {^ \ \ & = \ sum_ {j = 0} ^ {n-1} \ omega ^ {\ frac {i ^ 2 + j ^ 2 - (ij) ^ 2} 2} A_j \\ & = \ omega ^ {i ^ 2/2} \ sum_ {j = 0 } ^ {n-1} (A_j \ omega ^ {j ^ 2/2}) \ omega ^ {- (ij) ^ 2/2} \ end {align *} \ ]
found something quite like this convolution, but the sector is not right.
\ [C_i = \ sum_ {j
= 0} ^ {i} (A_j \ omega ^ {j ^ 2/2}) \ omega ^ {- (ijn) ^ 2/2} \] and found \ (B_i \ omega {^ - I ^ 2/2} = I + n-C_ {} \) , gone.

Note that if you want to take the mold, then the circular convolution can do that \ (\ omega_n \) exists in the sense die.

Because of \ (\ Omega \) has a magical properties, so the \ (\ omega ^ {- 1 } \) with point values into find again divided by a factor n is obtained.

A title

Peck said before, but forgot.

Define a \ (n \ times (n- 1) \) is the type of matrix MAT, \ (mat_ {I, J} \) represented as a tuple \ ((i, j) \ ) is the number of programs . Multiplication mat is defined as a two-dimensional circular convolution.

Transfer elements within the matrix apparently composed by a mat, then take them directly complexity is \ (n ^ 4 \) , and the FFT to find out the point values and then take on the optimization becomes \ (the n-^ 2 \) .

Why FFT can be optimized? Because the module is great, so there is a need of a unit root.

A TC Hard

A \ (n-\) Polynomial \ (P (X) \) , satisfies \ ([X ^ I] P (X) = [X ^ {Ni}] P (X) \) , known \ (P (x) ^ 2 \) in the mold \ (x ^ {n + 1 } \) a circular convolution in the sense of seeking \ (P (X) \) .

You can put \ (P (X) ^ 2 \) the DFT about afford point value. However, in the complex domain root will be open both too much trouble.

Then the practice of violence is a direct enumeration is which, then judge, apparently had not.

Note that we have a nature, may then prove \ (\ omega ^ i \) a point value and the \ (\ omega ^ {ni} \) point values are the same.

So before can enumerate \ (n / 2 \) a, then determination.

A title

First, the title altered, replaced by just walking \ (n \) times, each can choose to go or stop, so the answer is the same.

Then consider the matrix or rapid power, but this store is an array. Multiplying array is still circular convolution.

This is not a problem then.

Newton iteration

Known \ (G (X) \) , seeking \ (F. (X) \) , so \ (G (F. (X)) = 0 \) .

Consider multiplier, provided \ (G (f_t (X)) = 0 \ X PMOD {T} ^ 2 ^ {} \) , seeking \ (F_ {T} +. 1 (X) \) .

The \ (G \) in (F_t (x) \) \ expand, thereby giving
\ [\ begin {align *} G (F_ {t + 1} (x)) = & G (F_t (x)) + \\ & (F_ {t + 1 } (x) -F_t (x)) G '(f_t (x)) + \\ & (F_ {t + 1} (x) -F_t (x)) ^ 2G' '(f_t (x)) /
2 + \\ & \ cdots \ end {align *} \] Note to mold \ (^ X ^ {2} {T}. 1 + \) , so
\ [0 = G ( f_t (x)) + (F_
{t + 1} (x) -F_t (x)) G '(f_t (x)) \] so
\ [F_ {t + 1} (x) = f_t (x) - \ frac {G (f_t (x ))} {G '(f_t (x))} \]

Polynomial division

The coefficient reverse it, then magically found turned into inversion, finished it.

Multi-polynomial evaluation

Order \ (A_0 (x) = \ prod \ limits_ {i = 1} ^ m (x-x_i), A_1 (x) = \ prod \ limits_ {i = m + 1} ^ n (x-x_i) \ ) , then the left can \ (A_0 (x) \) modulo, the right to \ (A_1 (x) \) modulo then becomes a child deal with the problem.

Complexity \ (T (n-) = 2T (n-/ 2) + O (n-\ log n-) = O (n-\ log ^ n-2) \) .

Multi-point polynomial interpolation

\[ F(x)=\sum_{i=0}^n F(x_i)\prod_{j\ne i}\frac{x-x_j}{x_i-x_j} \]

\(y_i=\frac{F(x_i)}{\prod \limits_{j\ne i} (x_j-x_i)}​\)

Then there
\ [F (x) = \
sum_ {i = 0} ^ n y_i \ prod_ {j \ ne i} (x-x_j) \] partition, split in the middle, into two morphological found similar stuff, gone.

However, there is a problem is not resolved: \ (y_i \) how demand?

Order \ (G (X) = \ Prod \ limits_ {I = 0} ^ n-(x_i-X) \) , then we require is \ ([G (x) / (x_i-x)] _ {x_i} \) . This is something that obtained with Hospital Rule \ (x_i \) limit is \ (G '(x_i) \) .

Obtaining \ (G '(x) \ ) after the multi-evaluated again be gone.

Complexity \ (O (n-\ log ^ n-2) \) .

(This kind of thing basically impossible to write the examination room will know it ...... okay ......)

example

Seeking \ (n-\) is the number of spin-off.

Pentagonal number, we will.

Of course, in more normal modulus when pushed hard by generating function and exp it is possible.

\ ([\ LN (. 1-X)] '= - \ FRAC. 1. 1-X} = {- \ sum_i X ^ I \) , while both sides of the integral of
\ [\ ln (1-x ) = - \ sum_ {i = 1} ^ {\ infty} \ frac {x ^ i} {i} \]

A title

Given \ (a_i \) , find a set of \ (x_i \) , satisfies \ (0 \ le k \ le n-1 \) when \ (\ sum_ {i = 1 } ^ n x_ia_i ^ k = k ^ b \) .

Note \ (x_i \) can be negative, you can not be an integer.

998244353 modulo result. Ensure that the solution is unique.

First of all, we can see that if we can come out and done the equations.

Using Cramer rule, to give \ (x_i = \ FRAC {D_i} {D} \) , where \ (D = \ DET (A) \) , \ (D_i \) represents the section \ (I \) column replaced \ (b \) determinant later.

Noting \ (A \) and \ (A_i \) are the Van der Monde matrix, determinant is \ (\ Prod \ limits_ {J <I} (a_i-a_j) \) . Found that the abnormal form of the familiar, and multi-point above polynomial interpolation exactly the same, so you can apply the above approach, so he finished.

A title

Known
\ [f (x) = \
prod (1 + a_ix) \\ g (x) = \ prod (1 + b_ix) \\ \] seeking \ (h (x) = \ prod \ prod (1 + a_ib_jx ) \) before K \ (\) key.

For \ (f (x) \) seeking \ (\ LN \) , to give
\ [\ ln f (x) = \ sum_j (-1) ^ {j + 1} \ frac {x ^ j} {j} \ a_i ^ J sum_i \]
\ (G (X) \) Similarly.

So we find the \ (a, b \) is \ (k \) power and.
\ [\ Ln h (x)
= \ sum_k (-1) ^ {k + 1} \ frac {x ^ k} {k} \ sum_ {i} a_i ^ k \ sum_j b_j ^ k \] and then click exp gone.

Knockout

\ (m = 0 \) when generating function \ (X \) .

\ (m \ ge 1 \) when we consider these people must be present and each group by the person next layer up, the current can then be divided into several groups enumerated, to give \ (F_m (x) = \ sum_ {k = 2} ^ {\ infty} F_ {m-1} (x) ^ k = \ frac {F_ {m-1} (x) ^ 2} {1-F_ {m-1} (x)} \) .

Title of people did not give \ (n \) data range, we guess it's great, but it is known \ (m = 15 \) .

Thus, there is not the denominator when the natural mode \ (x ^ n \) a. We make \ (F_m (X) = \ {f_m FRAC (X)} {g_m (X)} \) , where \ (f (x), g (x) \) are not the denominator.

Thus, two equations can be derived:
\ [f_m (X) = F_ {}. 1-m (X) ^ 2 \\ g_m (X) = {G_-m}. 1 (X) ^ {2-G_ m-1} (x) f_
{m-1} (x) \] so we can see that, \ (f_m (X), g_m (X) \) is the number of times \ (2 ^ {m} \ ) polynomial, and \ (f_m (X) = X ^ 2 ^ {m} \) .

We last \ (g_m (x) \) seek out, the question becomes request \ (\ frac {1} { g_m (x)} \) of \ (n-2 ^ m \ ) key.

Consider violent process Inverse: for \ (I \) , there are
\ [\ sum_ {j \ le
n} f_jg_ {ij} = [i = 0] \] transposition, found that a length \ (2 ^ m \) linear recursive, can quickly polynomial modulo exponentiation +.

Guess you like

Origin www.cnblogs.com/p-b-p-b/p/11305258.html