返回题库

不断取 U(0,1) 直到和超过 1

Uniform(0,1) draws until sum > 1

专题
Probability / 概率
难度
L6

题目详情

独立生成随机数 U1,U2,Unif[0,1]U_1,U_2,\dots\sim \mathrm{Unif}[0,1],并不断累加,直到部分和首次超过 1 为止。

  1. P(需要超过 n 次抽取)P(\text{需要超过 }n\text{ 次抽取})

  2. 求期望抽取次数。

You generate random numbers U1,U2,Uniform[0,1]U_1, U_2, \ldots \sim \text{Uniform}[0,1] and keep drawing until their partial sum exceeds 1.

  1. What is P(need more than n draws)P(\text{need more than }n\text{ draws})?
  2. What is the expected number of draws?
解析

Sn=U1++UnS_n=U_1+\cdots+U_n

  1. “需要超过 nn 次” 等价于 Sn1S_n\le 1

Sn1S_n\le 1 对应于单位超立方体 [0,1]n[0,1]^n 中的单纯形体积:

P(Sn1)=1n!.P(S_n\le 1)=\frac{1}{n!}.

因此

P(N>n)=1n!.P(N>n)=\frac{1}{n!}.
  1. 用尾和公式:
E[N]=n=0P(N>n)=n=01n!=e.\mathbb{E}[N]=\sum_{n=0}^{\infty}P(N>n)=\sum_{n=0}^{\infty}\frac{1}{n!}=e.