# $X \sim \mathrm{Unif}[0,1], Y|X \sim \mathrm{Unif}[0,X^2].$ Find PDF of $Y$

$X \sim \mathrm{Unif}[0,1], Y|X \sim \mathrm{Unif}[0,X^2].$ Find PDF of $Y.$

Solution. $$f_{Y|X}(y|x) = \frac{1}{x^2}, \text{ x \in (0,1], y \in \mathbb{R}.}$$ Thus $$f_{X,Y}(x,y) = f_{Y|X}(y|x) \cdot f_X(x) = \frac{1}{x^2}, \text{ x \in (0,1], y \in \mathbb{R}}.$$ Then both $f_{Y|X},f_{X,Y}$ are zero otherwise than where stated.

Then $$f_Y(y) = \int_{-\infty}^{\infty}f_{X,Y}(x,y) dx = \int_{0}^{1} \frac{1}{x^2}dx = -x^{-1} |_{0}^{1}.$$

There is a problem. Can anyone give advice as to how to do this correctly or what is wrong with what I have here? Thanks very much.

As usual, the problem lies in the indicator functions: omitting these can lead to chaos or to unnecessary contortions to make sure one gets the right functions with the right limits. Hence:

Always include the conditions on their range in the density functions, using indicator functions.

Then one sees that the conditional density $f_{Y\mid X}$ is not what you write but, for every $x$ in $(0,1)$, $$f_{Y\mid X}(y\mid x)=\frac1{x^2}\mathbf 1_{0\lt y\lt x^2}.$$ Next, $$f_{X,Y}(x,y)=f_{Y\mid X}(y\mid x)f_X(x)=\frac1{x^2}\mathbf 1_{0\lt y\lt x^2}\mathbf 1_{0\lt x\lt1}=\frac1{x^2}\mathbf 1_{0\lt y\lt1}\mathbf 1_{\sqrt{y}\lt x\lt1}.$$ Finally, $$f_Y(y)=\int_\mathbb Rf_{X,Y}(x,y)\mathrm dx=\mathbf 1_{0\lt y\lt1}\int_{\sqrt{y}}^1\frac1{x^2}\mathrm dx=\mathbf 1_{0\lt y\lt1}\left(\frac1{\sqrt{y}}-1\right).$$

• Thank you very much. I am not familiar with this $1_{0 < y< 1}$ type of notation. You take the $1_{0 < y< 1}$ out of the integral because you are integrating over $x$ and then use the other for the limits? So they are not stuck to their function it looks like. I am trying to make some sense of it.
– user43138
Commented Dec 18, 2012 at 8:10
• This is the indicator function, whose value is $1$ if $0\lt y\lt1$ and $0$ otherwise.
– Did
Commented Dec 18, 2012 at 9:45

You forgot to take into account that the support of $Y$ given $X$ depends on $X$. In particular, $X$ must be larger than $\sqrt Y$.