> 
> Assume that $X$ and $U$ are two random variables such that:
> 
> 
> $X|U=u \sim \mathsf{Unif}(0,u)$ and $U \sim \mathsf{Unif}(0,1)$
> 
> 
> (1) Are $X$ and $U$ independent?
> 
> 
> (2) Find $\mathsf E[X]$
> 
> 
> 

Task (1)
I'm having difficulties with this task since it's the only one of it's kind in my book.

So my idea is to use;

$X$ and $Y$ are independent if

$f\_{XU}(x,u)=f\_X(x)·f\_U(u)$

Now since $U\sim\mathsf{Unif}(0,1)$ its PDF is given by:

$f\_U(u)=1, u \in [0,1]$

Since $X|U=u \sim\mathsf{Unif}(0,u)$ its PDF is given by:

(First doubt arises here)

$f\_{X|U}(x|u)=\frac{1}{u}, x \in [0,u]$

Having these I can rewrite this formula:

$f\_{X|Y}(x|y)=\frac{f\_{XY}(x,y)}{f\_Y(y)}$ 

$f\_{X|Y}(x|y)·f\_Y(y)=f\_{XY}(x,y)$

Thus;

$f\_{XY}(x,y)=\frac{1}{u}·1$

To find the marginal PDF i integrate the above using $u's$ limits:

$\int\_0^1\frac{1}{u}·1 du=0$

Now the above makes no sense. Something has gone wrong and hours of trying a lot of different things haven't solved it.

Task (2)
Since I need the marginal PDF for $X$ to solve this I haven't solved it yet.