$X_1, X_2 ... $ - independent and identically distributed random variables with $Unif(0,1)$ distribution. Let $p \in \left(0,1\right)$ and define: $$N = \inf \{ n \ge 1 : X_n >1-p\};$$ $$ Y=\max_{0 \le i \le N-1} X_i$$
where $X_0=0.$ Calculate $\mathbb{E}Y$
So I'm not sure if I can calculate the expected value. I start from the formula:
- $\mathbb{E}Y = \mathbb{E}\left(\mathbb{E}\left(Y|N \right) \right)$
- Then I calculate the distribution function for $Y$ for fixed $N=n$: $$F_{Y|N=n}(t) = t^{n-1}$$ and the density $$f_{Y|N}(t)=(n-1)t^{n-2}$$
- Then I notice that using independence: $$\mathbb{P}(N=n)=\mathbb{P}(X_1\le1-p,...,X_{n-1}\le 1-p,X_n>1-p)=(1-p)^{n-1} \cdot p$$
- Last step: $$\mathbb{E}Y=\mathbb{E}\frac{N-1}{N}=1-\mathbb{E}\frac{1}{N}=1 - \sum\limits_{k=1}^{\infty}\frac{1}{k}(1-p)^{k-1} \cdot p =1+\frac{p}{1-p} \cdot \sum\limits_{k=1}^{\infty}\frac{(-1)^{k+1}}{k}(1-p)^{k}=1+\frac{p}{1-p}\ln{p}$$.
Please let me know if the answer is ok, because I'm afraid I did something wrong. I'll be grateful :)
I'm a bit late to the party, but the answer is not quite correct. The final result for the expectation can not exceed 1-p.
$$\mathbb P(Y<t|N=n)=\prod_{i=1}^{n-1}\mathbb P(X_i<t|X_i<1-p)=\frac{t^{n-1}}{(1-p)^{n-1}}$$ for $0\leq t<1-p$.
The result changes only by a prefactor of $1-p$, so the final expected value must be $$\mathbb E[Y]=1-p+p\log(p)<1-p.$$