Example (Practice Exercise 5.8)
Find \(\mathbb{P}[Y > y]\) where : \[ X \sim Uniform[1,2]\\ Y\mid X \sim Exponential(x) \]
We have then \(f_{Y\mid X} = x e^{-x y}\) (the Exponential distribution with rate x). For a given X, then we can compute \(\mathbb{P}[Y > y \mid X= x]\):
\[ \mathbb{P}[Y> y \mid X= x] = \int_{y}^{\infty}x e^{-xy'}dy' = e^{-xy} \] and we can now integrate over the entire (\(\Omega_X\)) distribution for x to get the final answer:
\[ \begin{align} \mathbb{P}[Y> y] &= \int_{\Omega_X}\mathbb{P}[Y> y \mid X= x] f_X(x) dx \\ &= \int_{1}^{2} e^{-xy} dx \\ &= \frac{1-e^{-y}}{y} \end{align} \]