• [二项式反演]总结


    Intro and Proof

    基本形式:

    $f_n = sum_{i=0}^n (-1)^i {n choose i} g_i Leftrightarrow g_n = sum_{i=0}^n (-1)^i {n choose i} f_i$

    常用形式:

    $f_n = sum_{i=0}^n {n choose i} g_i Leftrightarrow g_n = sum_{i=0}^n (-1)^{n-i} {n choose i} f_i$

    $f_n = sum_{i=n}^{N} {i choose n} g_i Leftrightarrow g_n = sum_{i=n}^N (-1)^{i-n} {i choose n} f_i$

    代数证明:

    其实就是将其中一个式子代入另一个,交换一下求和顺序

    先将$f_j$提到前面去,就能得到下式

    $$egin{aligned}
    & sum_{i=j}^n (-1)^{i+j} {n choose i}{i choose j} \
    &= {n choose j} (-1)^j sum_{i=j}^n (-1)^i {{n-j} choose {n-i}} \
    &= {n choose j} (-1)^j sum_{i=0}^{n-j} (-1)^{n-i} {{n-j} choose i} \
    &= {n choose j} (-1)^{n + j} (1 - 1)^{n - j} \
    &= [n==j]
    end{aligned}$$

    其中运用了一个组合中的技巧:${n choose i}{i choose j}={n choose j} {{n-j} choose {n-i}}$

    从组合意义可以理解为交换了选择顺序,先选择$j$个再从剩下的数中除去$n-i$个

    容斥证明:

    传送门

    Application

    现在做到的基本都是至少/至多和恰好间的转换

    设$f[i]$为至多则可使用常用形式1:$g_n = sum_{i=0}^n (-1)^{n-i} {n choose i} f_i$

    设$f[i]$为至少则可使用常用形式2:$g_n = sum_{i=n}^N (-1)^{i-n} {i choose n} f_i$

  • 相关阅读:
    hdu 4081 Qin Shi Huang's National Road System
    Finding Team Member
    hdu 5491 The Next
    Queue
    Backward Digit Sums
    HDU
    HDU
    CodeForces 500 A. New Year Transportation
    拓扑排序
    “玲珑杯”ACM比赛 Round #1 题解
  • 原文地址:https://www.cnblogs.com/newera/p/10190870.html
Copyright © 2020-2023  润新知