# Expected Value from Conditional Expected Value

Here is a question I've been thinking about, but for which I couldn't find a solution.

Let $X\sim Exp(\alpha)$ and $Y|X=x\sim Exp(\sqrt x)$ (Y conditional X=x). What is the expected value and variance of Y?

Thank you very much in advance.

Edit:

$E[Y] = E[E[Y|X]] = E[\frac{1}{\sqrt x}] = \int \frac{1}{\sqrt x}*\alpha*e^{-\alpha*x} = \alpha*e^{-\alpha}\int_0^\infty \frac{1}{\sqrt x}*e^{-x}=$

$= \alpha*e^{-\alpha}*\Gamma(1/2) = \alpha*e^{-\alpha}*\sqrt \pi$

and

$V[Y] = E[V[Y|X]]+V[E[Y|X]] = E[\frac{1}{x}]+V[\frac{1}{\sqrt x}] = \int \frac{1}{x}*\alpha*e^{-\alpha*x}+V[\frac{1}{\sqrt x}] =$ $=\alpha*e^{-\alpha}\int_0^\infty \frac{1}{x}*e^{-x} + V[\frac{1}{\sqrt x}] = \infty$

Is that right?

• – Galc127 Jul 10 '18 at 14:09
• The problem I have with that is that I need to get from Y|X=x to Y|X in order to use those two laws. – Nick Jul 10 '18 at 14:13
• No, you don't. Writing $Y\mid X$ or $Y\mid X=x$ is actually the same. Do you know what should be the results? – Galc127 Jul 10 '18 at 14:24
• I've edited my question to add my results. Could you please check them? – Nick Jul 10 '18 at 15:39
• You have some mistakes (mostly wrong use of exponentiation rules). Please see my answer. – Galc127 Jul 10 '18 at 18:15

## 1 Answer

Using law of total expectation and definition of expectation $$\mathbb{E}[Y]=\mathbb{E}\left[\mathbb{E}\left[Y\vert X\right]\right]=\mathbb{E}\left[\frac{1}{\sqrt{x}}\right]=\int\limits_{-\infty}^{\infty}\frac{1}{\sqrt{x}}f_x(x)\text{d}x=\int\limits_{0}^{\infty}\frac{1}{\sqrt{x}}\alpha\exp\left(-\alpha x\right)\text{d}x$$ Let $\sqrt{x}=u$, so $\dfrac{1}{2\sqrt{x}}\text{d}x=\text{d}u$ and we get $$\mathbb{E}[Y]=2\alpha\int\limits_{0}^{\infty}\exp\left(-\alpha u^2\right)\text{d}u=2\alpha\cdot \frac{1}{2}\sqrt{\frac{\pi}{\alpha}}=\sqrt{\pi\alpha}$$

Using law of total variance and definitions of expectation and variance $$\mathbb{V}[Y]=\mathbb{V}\left[\mathbb{E}\left[Y\vert X\right]\right]+\mathbb{E}\left[\mathbb{V}\left[Y\vert X\right]\right]=\mathbb{V}\left[\frac{1}{\sqrt{x}}\right]+\mathbb{E}\left[\frac{1}{x}\right]=2\mathbb{E}\left[\frac{1}{x}\right]-\mathbb{E}^2\left[\frac{1}{\sqrt{x}}\right]$$ Now, $$\mathbb{E}\left[\frac{1}{x}\right]=\int\limits_{-\infty}^{\infty}\frac{1}{x}f_x(x)\text{d}x=\int\limits_{0}^{\infty}\frac{\alpha}{x}\exp\left(-\alpha x\right)\text{d}x$$ and this integral diverges.