I was helping a student with a question I couldn't solve. We have the following process: X is sampled from a $U(0,1)$ distribution. Then Y is sampled from a $U(-x,x)$ distribution. Therefore I have $Y|X$ is a Uniform. How do I find the distribution for $Y$ and $X|Y$? I was unable to integrate the joint distribution for x because the integration limits depend on x, if I can solve this, then it's just a Bayes theorem application.

$$f_{X,Y}(x,y) = f_{Y|X=x}(y)f_{X}(x) = \frac{1}{2x}\mathbb{1}_{(-x,x)}(y) \mathbb{1}_{(0,1)}(x) $$ $$ f_Y(y) = \int f_{X,Y}(x,y) dx = \int \frac{1}{2x}\mathbb{1}_{(-x,x)}(y) \mathbb{1}_{(0,1)}(x) dx $$

$$f_{X|Y} = \frac{f_{X,Y}}{ f_{Y}} $$

Is there something I missed? Is it possible to avoid this integral?

  • 1
    $\begingroup$ You don't use the same symbol for the dummy in the integral as the 'real' variable in the limit. I suggest drawing a picture of the relationship between the bounds on Y and the value of X, which should make it easier to see what's going on. $\endgroup$
    – Glen_b
    Apr 16, 2015 at 1:15

1 Answer 1


Hint: $(X,Y)$ must always be inside the triangle with vertices $(0,0), (1,1), (1,-1)$ with $f_{X,Y}(x_0,y)$ having the same value (call it $g(x_0)$) for all $y, -x_0 < y < x_0$ (else the conditional pdf of $Y$ given $X=x_0$ would not be $U(-x_0,x_0)$). Note that value of $g(x_0)$ does change with choice of $x_0$. Indeed, since the area at $x_0$ of the cross-section of the solid defined by the joint pdf is $f_X(x_0)$ which we know has value $1$ (by uniformity of $X$ on $(0,1)$), it must be that $2x\cdot g(x_0) = 1$, that is, $g(x) = \frac{1}{2x}, x\in(0,1)$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.