Uniform distribution that depends on exponential?

126 Views Asked by At

So I'm trying to solve this problem:

Let $X \sim \operatorname{Exponential}(\lambda)$. Let $Y \sim \operatorname{Uniform}(0,X)$. You are given $\operatorname{E}[X] = 1/ \lambda$ and $\operatorname{E}[X^2] = 2/\lambda^2$.

What are $\operatorname{E}[Y]$ and $\operatorname{Var}[Y]$?

So my initial thought was just to use the formula $\operatorname{E}[X] = \frac{1}{2}(a+b)$ for the expectation of a uniform variable and use $\operatorname{E}[X] = 1/ \lambda$ as $b$ for the above formula.

This is obviously wrong.

My next approach was to just think of this as a joint distribution as follows:

$$ f_{XY}=\frac{1}{\lambda \exp(-\lambda x) } $$

I got this by using the pdf formula for uniform distribution: $f(x) = \frac{1}{b-a}$ and the formula for pdf of exponetial: $f(x) = \lambda \exp(-\lambda x)$.

Next step would be to find the marginal distribution of $Y$ using:

$$ f_Y= \int_x\frac{1}{\lambda \exp(-\lambda x) } $$

Once I have the marginal distribution I can find the expectation and variance. But this integral is just infinity if I'm doing it right.

What am I doing wrong? Is there an issue with how I'm conceptually framing this problem?