conditional expectation strange transformation

63 Views Asked by At

I have been given this question, but I don't get what to do.

I know I am supposed to condition on another variable, call it $Y$, which equals the number of flips until the first occurrence of tails.

$$E(X)=E(E(X|Y))=\sum_iE(X|Y=i)p(Y=i)\\ p(Y=i)=p^{i-1}(1-p)=> E(X) = (1-p)\sum_iE(X|Y=i)p^{i-1}$$ I can't figure out why, but I read that $E(X|Y=i)=i+E(X)$ for $i\in[1,r]$

Why does $\sum_xXp(X=x|Y=i)=i+E(X)???$

Question and Hint

1

There are 1 best solutions below

0
On

Conditioning on $Y$ we have $$\mathbb E[X\mid Y=i]= \begin{cases} i+\mathbb E[X],& i\leqslant r\\ r,& i>r. \end{cases} $$ The equality for the case where $i\leqslant r$ follows from the memoryless property of the geometric distribution; the distribution of $X$ conditioned on the first tails appearing at $1\leqslant i\leqslant r$ is simply $i+X$. We compute $\mathbb E[X]$ using the law of total expectation: \begin{align} \mathbb E[X] &= \sum_{i=1}^\infty \mathbb E[X\mid Y=i]\mathbb P(Y=i)\\ &= \sum_{i=1}^r (i+\mathbb E[X])(1-p)p^{i-1} + \sum_{i=r+1}^\infty r(1-p)p^{i-1}\\ &= (1-p)\sum_{i=0}^{r-1}(i+1) p^i + \mathbb E[X](1-p)\sum_{i=0}^{r-1}p^i + r(1-p)\sum_{i=r}^\infty p^i\\ &= \frac{1-p^r (1+r(1-p))}{1-p} + (1-p^r)\mathbb E[X] + rp^r\\ &= (1-p^r)\mathbb E[X] +\frac{1-p^r}{1-p}, \end{align} and hence $$ \mathbb E[X] = \frac{1-p^r}{p^r(1-p)}. $$