I am given a random variable (uniformly distributed) between 0 and 1. To this, I add a second such random variable. I keep on adding these variables until sum exceeds 1, and then stop. Let us call number of such random variables needed is N. What is expectation of N ? What is the variance of N ?
To this my approach was following:
The sum of n independent and identically distributed U(0,1) random variables follow the Irwin-Hall distribution. Let $X_i = \sum_{k=0}^i{U_k}$ where $U_k$s are uniform on [0,1] and i.i.d random variables.
- Is it true that $\mathbb{E}[N]=\sum_{i=1}^{\infty} i \mathbb{P}(\{X_i \geq 1\})$ ?
I am not sure it is because in that case, by the p.d.f of the Irwin-Hall distribution (see the Wikipedia link above), we see \begin{align} \mathbb{P}(X_i \geq 1) &=1-\mathbb{P}(X_i < 1) \\ &=1-\frac{1}{(i-1)!}\sum_{k=0}^i(-1)^k \binom{i}{k} \int_{0}^1 (x-k)_+^{i-1} dx\\ &=1-\frac{1}{(i-1)!}\int_{0}^1 x^{i-1} dx = 1 - \frac{1}{i!}. \end{align} But then we note, $\mathbb{E}[N]=\sum_{i=1}^{\infty} i \mathbb{P}(\{X_i \geq 1\}) = \mathbb{E}[N]=\sum_{i=1}^{\infty} i (1 - \frac{1}{i!})$. This last sum seems to be diverging ????
- Same question applies when I try to calculate the Variance