I have the following question:
$X$ is continuous random variable uniformly distributed on the interval $[1, 2]$. Conditional on the value of $X = x$, $Y$ is an exponential random variable with rate $x$, that is:
$f_X(x) = 1 \text{ for } 1 ≤ x ≤ 2, 0$ otherwise, $\quad f_{Y|X}(y|x) = x exp(−xy) \text{ for } y > 0, 0$ otherwise
The final part of the question asks to verify the answers of $E[Y]$ and $Var[Y]$ using the theorems of conditional expectation, ie:
$E[Y] = E[E[Y|X]], \quad Var[Y] = E[Var[Y|X]] +Var[E[Y|X]]$
These answers can be solved when you calculate the MGF of Y, which is: $M_y(t) = 1- t\text{log}\frac{2-t}{1-t}.$
$M_y(t)$ gives: $\quad E[Y] = \text{log}(2), \quad Var[Y] = 1$
In the answers, it states that, $E[E[Y|X]] = E[1/X]$ and also that $E[Var[Y|X]] = E[1/X^2]$. I don't understand this step, any insight or hints would be great help. Thanks.
$Y|X$ is distributed exponentially with parameter $X$, so $E[Y|X]=1/X$, since this is the expectation of an exponential distribution. So $$E[E[Y|X]]=E[1/X]$$Similarly, the variance of a variable distributed exponentially with parameter $\mu$ is $1/\mu^2$. So $$E[Var[Y|X]]=E[1/X^2]$$