版本比较
浅谈多项式 & 生成函数科技(一)
标题
增加 1 行删除 1 行
11浅谈多项式&生成函数科技浅谈多项式 & 生成函数科技(一)正文
增加 56 行删除 3 行
4 行未改动56789910111213130 行未改动全部展开144145146147148148149150151152868 行未改动全部展开10211022102310241025102610271028102910309 行未改动10401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101104911024 行未改动
**前排广告**:- [从斐波那契通项公式到卡特兰数通项公式](https://www.luogu.com.cn/article/fwir6z7m)- [莫比乌斯反演学习笔记](https://www.luogu.com.cn/article/qiz6mq20)- [基于 A* 思想的 SPFA 优化-SPFA*](https://www.luogu.com.cn/article/mcxa9lph)(已被 hack)- ~~[基于 A* 思想的 SPFA 优化-SPFA*](https://www.luogu.com.cn/article/mcxa9lph)~~(已被 hack)(怎么被当成题解误杀了)
# 引子#### [P10780 BZOJ3028 食物](https://www.luogu.com.cn/problem/P10780)
130 行未改动全部展开由于 $G$ 是好求的,所以直接上多项式 $\ln$ 模板。
但是大部分人应该不会多项式全家桶,所以知道做法即可,马上会讲到这些东西。
# 章三·初等函数全家桶# 章三·多项式并不全家桶提示:1. 这部分篇幅可能稍长,如果你会多项式全家桶了,可以快进到后面。2. 这里仅给出模数为 $998244353$ 的 NTT 全家桶。
868 行未改动全部展开f_0^{-k}G&\equiv\exp(k\ln(f_0^{-1}F))\\G&\equiv f_0^{k}\exp(k\ln(f_0^{-1}F))\end{aligned}$$
但是我们忽略了一件事:$[x^0]F$ 可能为 $0$。此时我们只要将前面为 $0$ 的项先“删掉”,最后在补回来就好了。
### 多项式开根直接跳过二次根,讨论开 $k$ 次根。
$$G\equiv F^{\frac{1}{k}}$$9 行未改动\end{aligned}$$
最难的就是要求一个 $f_0$ 的 $k$ 次剩余。
## 八、多项式三角函数~~我恨三角函数!我恨三角恒等变换!我恨解三角形!~~
话虽这么说,但是多项式三角函数还是比较优美的。
首先我们可以将 $\sin$ 与 $\cos$ 的写另一种形式出来。
$$\begin{aligned}\sin x&=\frac{e^{\text{i}x}-e^{-\text{i}x}}{2\text{i}}\\\cos x&=\frac{e^{\text{i}x}+e^{-\text{i}x}}{2}\\\end{aligned}$$
然后将 $F$ 带入,可得。
$$\begin{aligned}\sin F&=\frac{\exp(\text{i}F)-\exp(-\text{i}F)}{2\text{i}}\\\cos F &=\frac{\exp(\text{i}F)+\exp(-\text{i}F)}{2}\\\end{aligned}$$
而 $\tan F$,可以由 $\dfrac{\sin F}{\cos F}$ 求出。
## 九、多项式反三角函数一开始看,觉得没有什么办法。
此时上万能的微积分就好了。先对其求导,在积分回去。
$$\begin{aligned}\arcsin'x&=\dfrac{1}{\sqrt{1-x^2}}\\\arcsin x&=\int\dfrac{1}{\sqrt{1-x^2}}\text{d}x\\\arccos'x&=-\dfrac{1}{\sqrt{1-x^2}}\\\arccos x&=-\int\dfrac{1}{\sqrt{1-x^2}}\text{d}x\\\arctan'x&=\dfrac{1}{1+x^2}\\\arctan x&=\int\dfrac{1}{1+x^2}\text{d}x\\\end{aligned}$$
然后将 $F$ 代进去得。
$$\begin{aligned}\arcsin'F&=\dfrac{F'}{\sqrt{1-F^2}}\\\arcsin F&=\int\dfrac{F'}{\sqrt{1-F^2}}\text{d}x\\\arccos'F&=-\dfrac{F'}{\sqrt{1-F^2}}\\\arccos F&=-\int\dfrac{F'}{\sqrt{1-F^2}}\text{d}x\\\arctan'F&=\dfrac{F'}{1+F^2}\\\arctan F&=\int\dfrac{F'}{1+F^2}\text{d}x\\\end{aligned}$$
# 章四·后话就先写到这里吧,已经带不动专栏了,而且也累了。
在 NOIP 之后,要是没退役,会更新《浅谈多项式 & 生成函数科技(二)》,会将部分没给出的模板题代码、类包装的全家桶、应用等坑给填完,敬清期待。
# 参考资料- [指数型生成函数 & 下降幂 学习笔记](https://www.luogu.com/article/p7qti8te)——by @[C_liar](https://www.luogu.com.cn/user/663681);- [快速傅里叶变换(FFT)学习笔记](https://www.luogu.com.cn/article/ne7zgqp6)——by @[KobeBeanBryantCox](https://www.luogu.com.cn/user/865625);- [多项式初等函数](https://oi.wiki/math/poly/elementary-func)——by [OI Wiki](https://oi.wiki);- 《算法导论·第三版》——by 机械工业出版社;- [题解 P3803 【【模板】多项式乘法(FFT)】](https://www.luogu.com.cn/article/pvwh9hpp)——by @[NaCly_Fish](https://www.luogu.com.cn/user/115864)- [[可能有用科技]多项式任意次幂&任意次根](https://www.luogu.com/article/00rovx59)——@[望月Asta](https://www.luogu.com.cn/user/122520)- [[可能有用科技]多项式任意次幂&任意次根](https://www.luogu.com/article/00rovx59)——by @[望月Asta](https://www.luogu.com.cn/user/122520)