奇妙数学概率
Ether13
·
·
算法·理论
均匀独立随机 n 次,选出 n 个 (0,1) 中的实数,和小于 x 的概率:
考虑对于 n 个随机正实数,其和小于等于 x 的概率为 \frac{x^n}{n!}。
这是通过积分得到的:
\begin{aligned}
&\int_0^x\mathrm{d}x_1\int_{0}^{x-x_1}\mathrm{d}x_2\dots\int_0^{x-x_1-x_2\dots x_{n-1}}\mathrm{d}x_n\\
=&\int_0^x\mathrm{d}x_1\int_{0}^{x-x_1}\mathrm{d}x_2\dots\int_0^{x-x_1-x_2\dots x_{n-2}}(x-x_1-x_2\dots x_{n-1})\mathrm{d}x_{n-1}\\
=&\int_0^x\mathrm{d}x_1\int_{0}^{x-x_1}\mathrm{d}x_2\dots\int_0^{x-x_1-x_2\dots x_{n-3}}\frac{(x-x_1-x_2\dots x_{n-2})^2}{2}\mathrm{d}x_{n-2}\\
=&\int_0^x\mathrm{d}x_1\int_{0}^{x-x_1}\mathrm{d}x_2\dots\int_0^{x-x_1-x_2\dots x_{n-4}}\frac{(x-x_1-x_2\dots x_{n-3})^3}{2\times 3}\mathrm{d}x_{n-3}\\
\vdots\\
=&\int_0^x\mathrm{d}x_1\int_{0}^{x-x_1}\frac{(x-x_1-x_2)^{n-2}}{(n-2)!}\mathrm{d}x_2\\
=&\int_0^x\frac{(x-x_1)^{n-1}}{(n-1)!}\mathrm{d}x_1\\
=&\frac{x^{n}}{n!}
\end{aligned}
考虑要求的 P(x) 是 n 个正实数中,满足和 \le x 且没有一个大于 1 的概率。\
对于至少有 i 个 \ge 1 的概率是好求的。\
至少有 i 个 \ge 1 的概率 =\frac{(x-i)^n}{n!}。\
那么知道了至少有 i 个 \ge 1 的概率后就可以求没有 \ge 1 的了。这是典型的容斥。
有
P(x)=\sum_{i=0}^{\lfloor x\rfloor}(-1)^i{n\choose i}\frac{(x-i)^n}{n!}
注意到 [0,1] 的概率和 (0,1) 的概率理应是一样的。因为端点取到的概率是无穷小。