跳到正文

算法·理论

奇妙数学概率

Ether13约 2 分钟
原文
文章信息与版本

文章信息

发布
2024年9月25日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 2 分钟
获赞
4

版本

  1. v1当前

均匀独立随机 nn 次,选出 nn 个 (0,1)(0,1) 中的实数,和小于 xx 的概率:

考虑对于 nn 个随机正实数,其和小于等于 xx 的概率为 xnn!\frac{x^n}{n!}。

这是通过积分得到的:

∫0xdx1∫0x−x1dx2 ⁣⋯∫0x−x1−x2…xn−1dxn=∫0xdx1∫0x−x1dx2 ⁣⋯∫0x−x1−x2…xn−2(x−x1−x2…xn−1)dxn−1=∫0xdx1∫0x−x1dx2 ⁣⋯∫0x−x1−x2…xn−3(x−x1−x2…xn−2)22dxn−2=∫0xdx1∫0x−x1dx2 ⁣⋯∫0x−x1−x2…xn−4(x−x1−x2…xn−3)32×3dxn−3⋮=∫0xdx1∫0x−x1(x−x1−x2)n−2(n−2)!dx2=∫0x(x−x1)n−1(n−1)!dx1=xnn!\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)P(x) 是 nn 个正实数中,满足和 ≤x\le x 且没有一个大于 11 的概率。
对于至少有 ii 个 ≥1\ge 1 的概率是好求的。
至少有 ii 个 ≥1\ge 1 的概率 =(x−i)nn!=\frac{(x-i)^n}{n!}。
那么知道了至少有 ii 个 ≥1\ge 1 的概率后就可以求没有 ≥1\ge 1 的了。这是典型的容斥。

有

P(x)=∑i=0⌊x⌋(−1)i(ni)(x−i)nn!P(x)=\sum_{i=0}^{\lfloor x\rfloor}(-1)^i{n\choose i}\frac{(x-i)^n}{n!}

注意到 [0,1][0,1] 的概率和 (0,1)(0,1) 的概率理应是一样的。因为端点取到的概率是无穷小。

原文
存档评论2 条抓取于