Binomial inversion notes

Binomial inversion

If the

\[ f(n)=\sum^{n}_{i=0} g(i) C_{n}^{i} \]

\[ g(n)=\sum^{n}_{i=0}(-1)^{n-i}f(i)C_{n}^{i} \]

prove:

Substituting \ (g (i) \) to give:
\ [G (n-) = \ SUM ^ {n-} _ {I = 0} (-. 1) ^ {Ni} C_ {n-} ^ {I} \ sum_ {J = 0} ^ {i} g
(j) C_ {i} ^ {j} \] change enumeration sequence can be obtained:
\ [G (n-) = \ ^ {n-SUM {I} _} = 0 (-. 1 ) ^ {ni} C_ {n } ^ {i} C_ {i} ^ {j} \ sum_ {j = 0} ^ {i} g (j) \]

\[ g(n)=\sum_{j=0}^{n}g(j)\sum^{n}_{i=0}(-1)^{n-i}C_{n}^{i}C_{i}^{j} \]

We can get through violence a formula:
\ [^ {C_ {I} n-C_ {I}} ^ {J} = \ {n-FRAC!} I {(Ni)!!} \ Times \ I FRAC {!} {j! (ij)!} = \ frac {n!} {j! (nj)!} \ times \ frac {(nj)!} {(ni)! (ij)!} = C ^ {j} _ {n} C ^ {ni}
_ {nj} \] this formula progeny Entering:
\ [G (n-) = \ sum_ {J = 0} ^ {n-} G (J) \ SUM ^ {n-} _ {i = 0} (- 1
) ^ {ni} C ^ {j} _ {n} C ^ {ni} _ {nj} \] so
\ [g (n) = \ sum_ {j = 0} ^ { n} g (j) C ^
{j} _ {n} \ sum ^ {n} _ {i = 0} (- 1) ^ {ni} C ^ {ni} _ {nj} \] when \ (I \ ne n \) when obtained by the binomial theorem:
\ [\ ^ {n-SUM {I} _} = 0 (-. 1) ^ C ^ {Ni}} _ {Ni} = {NJ (- 1+ 1) ^ {nj} = 0
\] it (in this case \ (n-I = \) ): \
[G (n-) = G (n-) n-C ^ {} _} = {n-G (n-) \]
QED

example

Luo Gu P4859 has nothing to be afraid of the

Have meaning of the questions, \ (K = \ + K FRAC {n-2}} {\) (issues and difference)

We begin first \ (a, b \) from small to large

Set \ (f [i] [j ] \) representing the forward \ (I \) a \ (A \) , the election \ (J \) a \ (A \) such that \ (a> b \) to give Program number

Order \ (last [i] \) represents \ (B \) last \ (<a [i] \ ) number of the number of

Is not selected and is selected from nothing, so it is easy to obtain a state transition equation:
\ [F [I] [J] = F [. 1-I] [J] + (Last [I] + -j. 1) * F [ i-1] [j-1
] \] where we met was a common routine a binomial inversion in the title: at least and just

So \ (g [i] \) represents at least chose \ (i \) a number of programs, \ (ANS [i] \) represents just chose \ (i \) number (that is, we want to answer) program

In the previous dp, we are still some did not choose the number, they can be in any order

So:
\ [! G [i] = f [the n-] [i] * (Ni) \]
For each \ (G [i] \) , and we try to find it all than \ (i \) large \ (j \) is \ (ans [j] \) relationship

For each \ (ans [j] \) in each scenario, we can from all \ (j \) select any number of individual personal

So we get:
\ [G [I] = \ J = I sum_ {}} ^ {n-C_ {J} ^ {I} ANS [J] \]
by the binomial inversion to give:
\ [ANS [J] = \ sum_ {J} = ^ {n-I} (-. 1)} C ^ JI ^ {} _ {I} {J G [J] \]
(I Gu code is out)

Guess you like

Origin www.cnblogs.com/ybwowen/p/10963195.html