# Conditional probability, uniform distributions

Problem: Suppose that the random variable X is uniformly distributed symmetrically around zero, but in such a way that the parameter is uniform on (0, 1); that is, suppose that $X\mid (A=a) \sim U(-a,a)$ with $A \sim U(0,1)$. Find the distribution of X.

My attemt: $f_{A,X}(a,x)=f_{X\mid A=a}(x) \cdot f_{A} (a)$.

$f_{A}(a)=1$ for $0<a<1$ and $f_{X,A=a}(x)=\frac{1}{2a}$ for $-a<x<a$ which means that $f_{A,X}(a,x)=\frac{1}{2a}$ for $0<a<1$ and $-a<x<a$. Next I integrate the joint distribution over a to find $f_{X}(x)$.

$f_{X}(x)=\int_0^1 f_{A,X}(a,x) da=\int_0^1 \frac{1}{2a}da$, but this integral is not convergent. Where do I go wrong?

Thanks.

-
I think the standard symbol where you use $\in$ would be $\sim$. – joriki Mar 19 '13 at 2:04

You were correct up until setting up the integral for the marginal density: $$f_X(x) = \int_0^1 f_{A,X}(a,x) \mathrm{d}a = \int_0^1 \frac{1}{2a} [-a<x<a] \mathrm{d}x$$ For a given $-1<x<1$, the indicator function $[-a<x<a]$ is non-zero for $|x|<a<1$, therefore $$f_X(x) = \int_{|x|}^a \frac{\mathrm{d}a}{2a} = \frac{1}{2} \ln \frac{1}{|x|}$$