3

This is a modified version to a pretty common problem; here's that classic problem: Choose a random number between $0$ and $1$ and record its value. Keep doing it until the sum of the numbers exceeds $1$. How many tries do we need?. That question has an answer of $e$.

My question is, once you reach a sum exceeding 1, what's the expected value of this sum? I saw somewhere the answer is $\frac{e}{2}$. That seems intuitive because the expected value of each number is $\frac{1}{2}$, but that doesn't seem very rigorous.

APerson
  • 107

1 Answers1

3

Your intuition is formalised by Wald's equation. Apply it with $X_n$ equal to the $n$-th random number and $N=\inf\left\{n\in\mathbb N^*\mid\sum_{k=1}^nX_k\ge1\right\}$. Then $$ \mathbb E\left[\sum_{k=1}^NX_k\right]=\mathbb E[N]\times\mathbb E[X_1]=\mathrm{e}\times\frac12. $$

Will
  • 8,358
  • 2
    But doesn't $N$ have to be independent of the $X$'s to apply Wald's? And I feel like these are dependent; if you have a larger $X_1$ value, aren't you more likely to have a smaller $N$ (and vice versa)? – APerson Jun 11 '23 at 09:38
  • 1
    For the so-called basic version yes. For the general version you can see you just need ${N\ge n}$ to be independent of $X_n$. This is the case here because ${N\ge n}={N\le n-1}^\complement$ depends on $(X_1,\cdots,X_{n-1})$, which is independent of $X_n$. – Will Jun 11 '23 at 09:44
  • Thanks! For anyone wanting to learn more, this link does a pretty good job of explaining Wald's. – APerson Jun 11 '23 at 17:51