I have a random number $X\sim Exp(\lambda)$ and a value $Y\sim Poi(X)$. I have to calculate $\mathbb{E}[Y]$.
I proved that $Y\sim Geo(\frac{\lambda}{(\lambda+1)})$, so i should have $\mathbb{E}[Y]:=\frac{\lambda+1}{\lambda}$.
Why, instead, is $\frac{1}{\lambda}$?
Text says that $\mathbb{E}[Y]=\mathbb{E}[\mathbb{E}[Y|X]]=\mathbb{E}[X]$. Trivially the first equivalence is a property of conditional expectation but what justifies the second equivalence?
Thanks in advance for any help!
Note that technically $Y|X\sim Poi(X)$. Then the second equivalence is using the expected value of a Poisson random variable.