我爱 GF!
名字都是瞎扯。
单变量带常数的变量幂次的单二项求和
求 \(\displaystyle \sum_{j=0}^k 2^{k-j} \binom{k+j}{j}\)
(没有了数据范围反而感觉很奇怪……)
注意到 \(k \geq j\),后面的二项式无法上指标求和,因为上指标的范围的下限不是 \(j\)。
换掉二项式
\[\begin{aligned}
& \sum_{j=0}^k 2^{k-j} \binom{k+j}{j} \\
= & [x^k] \sum_{j=0}^k 2^{k-j} (1+x)^{k+j} \\
= & [x^k] 2^k (1+x)^k \sum_{j=0}^k \left(\frac{1+x}{2}\right)^j \\
= & [x^k] 2^k (1+x)^k \left(1-\left(\frac{1+x}{2}\right)^{k+1}\right) \dfrac{1}{\left(1-\frac{1+x}{2}\right)} \\
= & [x^k] (1+x)^k (2^{k+1}-(1+x)^{k+1}) \frac{1}{1-x} \\
= & [x^k] (2^{k+1}(1+x)^k-(1+x)^{2k+1}) \frac{1}{1-x} \\
= & 2^{2k+1} -2^{2k} = 2^{2k} \\
\end{aligned}
\]
一个较简单的双参数求和
求 \(\displaystyle \sum_{k\leq\frac{n}{2}} (-1)^k \binom{n-k}{k} y^{n-2k}\)
MO 题不需要数据范围
\[\begin{aligned}
= & [x^n] \sum_n x^n \sum_{k\leq\frac{n}{2}} (-1)^k \binom{n-k}{k} y^{n-2k} \\
= & [x^n] \sum_k (-1)^k y^{-2k} \sum_{n \geq 2k} \binom{n-k}{k} x^n y^n \\
= & [x^n] \sum_k (-1)^k x^k y^{-k} \sum_{m \geq k} \binom{m}{k} x^m y^m \\
= & [x^n] \sum_k (-1)^k x^k y^{-k} \dfrac{(xy)^k}{(1-xy)^{k+1}} \\
= & [x^n] \dfrac{1}{1-xy} \sum_k \left(\dfrac{-x^2}{1-xy}\right)^k \\
= & [x^n] \dfrac{1}{1-xy} \dfrac{1}{1+\frac{x^2}{1-xy}} \\
= & [x^n] \dfrac{1}{1-xy+x^2} \\
\end{aligned}
\]
中间有一步用了上指标求和:
\[\sum_n \binom{n+k}{k} x^n = \dfrac{1}{(1-x)^{k+1}} \iff \sum_n \binom{n}{k}x^n = \dfrac{x^k}{(1-x)^{k+1}}
\]
仿造 Fibonacci 数列用特征根方程找出通项即可。
一个关于 Catalan 数的恒等式
\(\displaystyle\sum\limits_{a+b=n}\binom{2a}{a}\binom{2b}{b}=4^n\)
同样没有数据范围
熟知
\[\dfrac{1-\sqrt{1-4x}}{2x}= \sum_n \binom{2n}{n} \dfrac{x^n}{n+1}
\]
即
\[\dfrac{1-\sqrt{1-4x}}{2}= \sum_n \binom{2n}{n} \dfrac{x^{n+1}}{n+1}
\]
两边求导弄掉分母,平方弄掉根号
\[\begin{aligned}
(1-4x)^{-\frac{1}{2}} &= \sum_n \binom{2n}{n}x^{n} \\
\frac{1}{1-4x} &= \left(\sum_{n} \binom{2n}{n}x^{n}\right)^2
\end{aligned}
\]
两边提取系数即得。
简单的单参数双二项式求和
求 \(\displaystyle \sum_k \binom{n}{k}\binom{2k}{k}\left(-\dfrac{1}{2}\right)^k\)
范围?不存在的。说就是无穷
记得
\[\frac{1}{\sqrt{1-4x}} = \sum_n \binom{2n}{n} x^n
\]
原式化简:
\[\begin{aligned}
= & [x^n] \sum_n x^n \sum_k \binom{n}{k}\binom{2k}{k}\left(-\dfrac{1}{2}\right)^k \\
= & [x^n] \sum_k \binom{2k}{k}\left(-\dfrac{1}{2}\right)^k \sum_n \binom{n}{k} x^n \\
= & [x^n] \sum_k \binom{2k}{k}\left(-\dfrac{1}{2}\right)^k \dfrac{x^k}{(1-x)^{k+1}} \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-\frac{x}{2})^k}{(1-x)^{k+1}} \\
= & [x^n] \frac{1}{1-x} \left(1-4\dfrac{-\frac{x}{2}}{1-x}\right)^{-\frac{1}{2}} \\
= & [x^n] \sqrt{\frac{1}{1-x^2}} \\
= & [x^n] \sum_n \binom{2n}{n} \left(\dfrac{x^2}{4}\right)^n \\
= & \begin{cases} 0 & \quad n \not \equiv 0 \pmod 2 \\ \binom{n}{\frac{n}{2}} 2^{-n} & \quad \text{otherwise} \end{cases}
\end{aligned}
\]
运用组合恒等式化简的双参数求和
求 \(\displaystyle\sum\limits_{k}\binom{n+k}{m+2k}\binom{2k}{k}\dfrac{(-1)^k}{k+1}\)
\(n,m\in \mathbb Z\)
\[\begin{aligned}
= & [x^n] \sum_{n} x^n \sum\limits_{k}\binom{n+k}{m+2k}\binom{2k}{k}\dfrac{(-1)^k}{k+1} \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-1)^k}{k+1} \sum_n \binom{n+k}{m+2k}x^n \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-1)^k}{k+1} x^{-k} \sum_n \binom{n+k}{m+2k}x^{n+k} \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-x^{-1})^k}{k+1} \dfrac{x^{m+2k}}{(1-x)^{m+2k+1}} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \sum_k \binom{2k}{k} \dfrac{(-x^{-1})^k}{k+1} \dfrac{x^{2k}}{(1-x)^{2k}} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \sum_k \binom{2k}{k} \dfrac{\left(\dfrac{-x}{(1-x)^2}\right)^k}{k+1} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x}\left(1-\sqrt{1+\frac{4x}{(1-x)^2}}\right) \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x} (1-\dfrac{1+x}{1-x}) \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x} \dfrac{-2x}{1-x} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m}} \\
= & \binom{n-1}{m-1}
\end{aligned}
\]
有一步从 Catalan 数生成函数逆推
\[\dfrac{1-\sqrt{1-4x}}{2x}= \sum_n \binom{2n}{n} \dfrac{x^n}{n+1}
\]
转化为生成函数解函数方程的例子
求一个自然数的子集 \(X\),\(\forall n,a+2b=n\) 在 \(a,b \in X\) 的条件下恰一组解
\(n \leq |\mathbb Z|\)
找到 GF \(\displaystyle f(x) = \sum\limits_n [n \in X] x^n\)
\[\begin{aligned}
f(x) f(x^2) &= \frac{1}{1-x} \\
f(x^2) f(x^4) &= \dfrac{1}{1-x^2} \\
f(x^{2^n})f(x^{2^{n+1}}) &= \dfrac{1}{1-x^{2^n}}
\end{aligned} \\
f(x) =\dfrac{1-x^2}{1-x} \dfrac{1-x^8}{1-x^4} \dots \dfrac{1-x^{2^{2t+1}}}{1-x^{2^{2t}}} f(x^{2^{2t+2}})
\]
能够发现 \(0\in X\),所以 \([x^0]f(x)=1\),所以 \(t \to \infty ,f(x^{2^{2t+2}}) \to 1\)
\[\therefore f(x) = (1+x)(1+x^4)(1+x^{16}) \dots (1+x^{4^t})
\]
\[X=\{m|m\ \text{的二进制位中的} \ 1 \ \text{都在奇数位上}\}
\]
说在最后
感觉 MO 的推式子方向其实和 OI 是不大一样的,OI 的式子往往是一个 GF 能表示成几个 GF 与它本身的某形式的卷积,MO 的式子是直接上求和,,,因为卷积是 OI 中相对好处理的吧。MO 的目标是化到无求和的形式,OI 只要化到方便卷积的形式或递推式就够了。但是学习 MO 的处理方式还是对 OI 有益的。
剥式子,分离常量与变量,用恒等式弄掉一个枚举变量。
看看 md 源码 就知道手推一堆式子有多复杂了。
以此表达我对 GF 的爱吧(
\begin{aligned}
= & [x^n] \sum_{n} x^n \sum\limits_{k}\binom{n+k}{m+2k}\binom{2k}{k}\dfrac{(-1)^k}{k+1} \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-1)^k}{k+1} \sum_n \binom{n+k}{m+2k}x^n \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-1)^k}{k+1} x^{-k} \sum_n \binom{n+k}{m+2k}x^{n+k} \\
= & [x^n] \sum_k \binom{2k}{k} \dfrac{(-x^{-1})^k}{k+1} \dfrac{x^{m+2k}}{(1-x)^{m+2k+1}} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \sum_k \binom{2k}{k} \dfrac{(-x^{-1})^k}{k+1} \dfrac{x^{2k}}{(1-x)^{2k}} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \sum_k \binom{2k}{k} \dfrac{\left(\dfrac{-x}{(1-x)^2}\right)^k}{k+1} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x}\left(1-\sqrt{1+\frac{4x}{(1-x)^2}}\right) \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x} (1-\dfrac{1+x}{1-x}) \\
= & [x^n] \dfrac{x^m}{(1-x)^{m+1}} \dfrac{(1-x)^2}{-2x} \dfrac{-2x}{1-x} \\
= & [x^n] \dfrac{x^m}{(1-x)^{m}} \\
= & \binom{n-1}{m-1}
\end{aligned}