[学习笔记]快速莫比乌斯与快速沃尔什变换

直接给定形式吧。

不给证明了。

或卷积

\(c_i = \sum_{i | j =k} a_i * b_i\)

写作\(FWT(A)_i = \sum_{j \in i}A_j\)

将\(A\)对半分为\(A_0,A_1\)

\(FWT(A) = \left\{ \begin{aligned} (FWT(A_0),FWT(A_0) + FWT(A_1))\\ A(len_A = 0) \end{aligned} \right.\)

先转成\(FWT\)后,两式单点乘,再\(IFWT\)。

与卷积

\(c_i = \sum_{i \& j =k} a_i * b_i\)

写作\(FWT(A)_i = \sum_{i \in j}A_j\)

先转成\(FWT\)后,两式单点乘,再\(IFWT\)。

\(FWT(A) = \left\{ \begin{aligned} (FWT(A_0) + FWT(A_1),FWT(A_1))\\ A(len_A = 0) \end{aligned} \right.\)

异或卷积

\(FWT(A) = \left\{ \begin{aligned} (FWT(A_0) + FWT(A_1),FWT(A_0) - FWT(A_1))\\ A\ (len_A = 0) \end{aligned} \right.\)

\(IFWT(A) = \left\{ \begin{aligned} (\frac{FWT(A_0) + FWT(A_1)}{2},\frac{FWT(A_0) - FWT(A_1)}{2})\\ A\ (len_A = 0) \end{aligned} \right.\)

上一篇:概率


下一篇:Dirichlet 卷积学习笔记