The expectation of picking times

136 Views Asked by At

Suppose you randomly choose a number from $[0,1]$ repeatedly, and each number with equal probability to be chosen. Once the sum of the numbers picked is greater than 1, you stop. Calculate the expectation of the number of times you need to pick.

I do this by direct calculation:

Lemma. Suppose $a>0$. Let $ S_n(a)=\left\{\left(x_1, ..., x_n\right):\displaystyle0\leq\sum_{i=1}^{n} x_i\leq a, x_i \geq 0, i = 1, 2, ..., n\right\}$, $\mu\left(S_n(a)\right)$ denotes the volume of $S_n(a)$ , then $\mu\left(S_n(a)\right) =\frac{a^n}{n!}.$

Proof. Let $x_i=ay_i$, we have: $\left|\frac{\partial(x_1,...,x_n)}{\partial(y_1,...,y_n)}\right|=a^n.$ Thus, $\mu(S_n(a)) = \int_{S_n(a)} \mathrm{d}\mu=a^n\int_{S_n(1)} \mathrm{d}\mu=a^n\mu(S_n(1)).$ We only need to calculate $\mu(S_n(1))$: \begin{align*} \mu(S_n(1)) &= \int_{S_n(1)} \mathrm{d}\mu\\ &=\int_{0}^{1} \mathrm{d}x_n\int_{S_{n-1}(1-x_n)} \mathrm{d}x_1...\mathrm{d}x_{n-1} \\ &=\mu(S_{n-1}(1))\int_{0}^{1} (1-x_n)^{n-1} \mathrm{d}x_n\\ &=\frac{1}{n}\mu(S_{n-1}(1)) \\ &=\frac{1}{n(n-1)}\mu(S_{n-2}(1))\\ &=...\\ &=\frac{1}{n!}\mu(S_{1}(1))\\ &=\frac{1}{n!} \end{align*} Thus $ \mu\left(S_n(a)\right) = a^n\mu(S_n(1))=\frac{a^n}{n!}.$

Suppose at $i$th pick you get $X_i$, $X_i\sim U[0,1]$ for $i \in \{1,2,3,...\}$ and are independent. Assume at $\tau \mathrm {th}$ pick you stop, then: \begin{align*} P(\tau=n)&= P\left(\sum_{i=1}^{n-1} X_i<1 \land \sum_{i=1}^{n} X_i\geq 1\right)\\ &=P\left(\neg \sum_{i=1}^{n-1} X_i\geq1 \land \sum_{i=1}^{n} X_i\geq 1\right)\\ &=P\left(\sum_{i=1}^{n} X_i\geq1\right) - P\left(\sum_{i=1}^{n-1} X_i\geq 1\right)\\ &=\left[1-\frac{1}{n!}\right]-\left[1-\frac{1}{(n-1)!}\right]\\ &=\frac{1}{(n-1)!}-\frac{1}{n!} \end{align*}

Thus: $E[\tau]=\sum_{n=1}^{\infty}n \left[ \frac{1}{(n-1)!}-\frac{1}{n!} \right]=e$

But later I'm thinking of using stochastic process to solve this problem. In stochastic calculus we can use Feynman-Kac Theorem to get a pde, and by solving the pde we can get the expectation. So I tried to let $Y_n=X_1+...+X_n$, let $u(n,Y_n)=E[\tau|Y_n]$, then $u(n,Y_n)$ is a martingale. And obviously, $u(n,Y_n)-n$ has nothing to do with $n$ now. But I don't know what to do next since I cannot use Ito formula now. It's a discrete case. Is it possible to solve this problem using some more advanced technique? Like theorems about stopping time or something like that.