# 从抛硬币实验得出沃利斯公式

|

【对数据分析、人工智能、金融科技、风控服务感兴趣的同学，欢迎关注我哈，阅读更多原创文章】

《无穷算术》第一次把代数学扩展到分析学，发展了卡瓦列里的不可分量原理，开辟了用级数表示函数的道路，把有限算术变成无限算术，成为牛顿、莱布尼兹发明微积分的前奏。

# 理论推导

## $T_{n}$ 的定义

$n$ $Q_{n}$ $T_{n}$ $\frac{T_{n}^{2}}{n}$
5 60 1.875 0.703125
6 120 1.875 0.5859375
7 280 2.1875 0.68359375
8 560 2.1875 0.59814453125
9 1260 2.4609375 0.67291259765625
10 2520 2.4609375 0.605621337890625
11 5544 2.70703125 0.6661834716796875
12 11088 2.70703125 0.6106681823730469

## $T_{2n} = T_{2n-1}$

\begin{align} Q_{2n-1} &= 2\sum\limits_{m=0}\limits^{n-1}(\binom{2n-1}{m}(2n-1-2m)) \\ &= 2(\binom{2n-1}{0}(2n-1) + \binom{2n-1}{1}(2n-3) + \binom{2n-1}{2}(2n-5) + \cdots + \binom{2n-1}{n-2}\cdot 3 + \binom{2n-1}{n-1}\cdot 1) \\ \end{align} \begin{align} Q_{2n} &= 2\sum\limits_{m=0}\limits^{n-1}(\binom{2n}{m}(2n-2m)) \\ &= 2(\binom{2n}{0}(2n) + \binom{2n}{1}(2n-2) + \binom{2n}{2}(2n-4) + \cdots + \binom{2n}{n-2}\cdot 4 + \binom{2n}{n-1}\cdot 2) \\ \end{align}

\begin{align} Q_{2n} &= 2(\binom{2n}{0}(2n) + \binom{2n}{1}(2n-2) + \binom{2n}{2}(2n-4) + \cdots + \binom{2n}{n-2}\cdot 4 + \binom{2n}{n-1}\cdot 2) \\ &= 2(\binom{2n-1}{0}(2n) + (\binom{2n-1}{0} + \binom{2n-1}{1})(2n-2) + (\binom{2n-1}{1} + \binom{2n-1}{2})(2n-4) + \cdots \\ & \quad\quad\quad\quad\quad\quad+ (\binom{2n-1}{n-3} + \binom{2n-1}{n-2})\cdot 4) + (\binom{2n-1}{n-2} + \binom{2n-1}{n-1})\cdot 2) \\ &= 2(\binom{2n-1}{0}(4n-2) + \binom{2n-1}{1}(4n-6) + \cdots + \binom{2n-1}{n-2}\cdot 6 + \binom{2n-1}{n-1}\cdot 2) \\ &= 2\times 2(\binom{2n-1}{0}(2n-1) + \binom{2n-1}{1}(2n-3) + \cdots + \binom{2n-1}{n-2}\cdot 3 + \binom{2n-1}{n-1}\cdot 1) \\ \end{align}

## $\frac{T_{2n}}{T_{2n+1}} = \frac{2n+1}{2n}$

$T_{2n}$ 与 $T_{2n-1}$ 的关系是从表格计算结果中猜想后证明的。而 $T_{2n}$ 与 $T_{2n+1}$ 的关系就不是很好从表格中猜想的，这里我们进行正面推导。

\begin{align} Q_{2n+1} &= \sum\limits_{m=0}\limits^{2n+1}(\binom{2n+1}{m}|2n+1-2m|) \\ &= 2\sum\limits_{m=0}\limits^{n}(\binom{2n+1}{m}(2n+1-2m)) \\ &= 2(\binom{2n+1}{0}(2n+1) + \binom{2n+1}{1}(2n-1) + \binom{2n+1}{2}(2n-3) + \cdots + \binom{2n+1}{n-1}\cdot 3 + \binom{2n+1}{n}\cdot 1) \\ &= 2(\binom{2n}{0}(2n+1) + (\binom{2n}{0} + \binom{2n}{1})(2n-1) + (\binom{2n}{1} + \binom{2n}{2})(2n-3) + \cdots \\ & \quad\quad\quad\quad\quad\quad + (\binom{2n}{n-2} + \binom{2n}{n-1})\cdot 3 + (\binom{2n}{n-1} + \binom{2n}{n})\cdot 1) \\ &= 2(\binom{2n}{0}(4n) + \binom{2n}{1}(4n-4) + \cdots + \binom{2n}{n-1}\cdot 4 + \binom{2n}{n}) \\ &= 2Q_{2n} + 2\binom{2n}{n} \end{align}

# 模拟结果

$n$ $T_{n}$ $\frac{T_{n}^{2}}{n}$ $\frac{2n}{T_{n}^{2}}$
5 1.87719 0.70476845922 2.8378114454972816
6 1.879865 0.5889820697041667 3.395689109864682
7 2.191715 0.6862306630321429 2.9144719228413734
8 2.194105 0.601762093878125 3.3235725884805576
9 2.465125 0.6752045850694445 2.962065193609876
10 2.46335 0.6068093222500001 3.295928270488926
11 2.7106 0.6679411236363636 2.9942758863411854
12 2.709445 0.6117576840020834 3.2692682941325977
100 7.96788 0.634871116944 3.1502456902231604
200 11.28695 0.6369762015124999 3.139834730482866
400 15.956695 0.6365402883075625 3.1419849406824087
800 22.594895 0.6381616000762813 3.1340024215824553
1000 25.26087 0.6381115531569 3.134248220558759

Share