## Expected number of uniform variates which are strictly increasing

*Tags:* math

Let (*r*_{1}, *r*_{2}, …) be an infinite sequence of iid uniform random variates. Let *K* be the largest number such that *r*_{1} < *r*_{2} < ⋯ < *r*_{K}. What is 𝔼[*K*]?

Note that:

$$\mathbb{E}[K] = \sum_{k=1}^{\infty} \text{Pr}[K \ge k].$$

We have *K* ≥ *k* iff the *k* elements satisify *r*_{1} < *r*_{2} < ⋯ < *r*_{k}, which happens with probability 1/*k*!. Therefore:

$$\mathbb{E}[K] = \sum_{k=1}^{\infty} \frac1{k!} = e - 1.$$