Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$X$ is $\text{Exp}(\lambda)$, $Y$ is $\text{Uniform}(0,X)$. How can I find $\Bbb E[Y]$ and $\text{Var}(Y)$?

I did tried to plug it like double integral of $\Bbb E[Y]$ from 0 to X which $f(t)$ is $\text{Exp}(\lambda)$. But I could not solve it. Could anyone point or hint me?

Thank you

share|cite|improve this question
Do you mean E[Y] and Var[Y] – Gautam Shenoy Feb 15 '13 at 11:05
Yes, I'm sorry. – Zeal Chaiwut Feb 15 '13 at 11:15
up vote 3 down vote accepted

Lets use conditional expectation. Compute $$\mathbb{E}[Y] = \mathbb{E}[\mathbb{E}[Y|X]]$$

Now $\mathbb{E}[Y|X]$ is the mean of a uniform [0,X] which is $X/2$. Thus $$\mathbb{E}[Y] = \mathbb{E}[X/2]= \frac{1}{2\lambda}$$

Similarly you can get the variance by working with $$\mathbb{E}[Y^2] = \mathbb{E}[\mathbb{E}[Y^2|X]]$$

share|cite|improve this answer
I do not know about this $E[Y] = E[E[Y|X]]$ before. Thank you for your answer. I will try to solve the variance by myself. – Zeal Chaiwut Feb 15 '13 at 11:41
It's called the law of iterated expectation. Was this not covered? Any other way would be laborious. – Gautam Shenoy Feb 15 '13 at 11:41

First we see that for $x\geq 0$ we have $$ E[Y\mid X=x]=\frac{x}{2} $$ and so $$ E[Y\mid X]=\frac{X}{2}. $$ Now use that $$ E[Y]=E[E[Y\mid X]]. $$ For the variance you can use a similar argument using this.

share|cite|improve this answer

For finding the variance of $Y$, you can use the total variance formula which gives $$\begin{align*} \text{var}(Y) &= E[\text{var}(Y\mid X)] + \text{var}(E[Y\mid X])\\ &= E\left[\frac{X^2}{12}\right] + \text{var}\left(\frac{X}{2}\right) \end{align*}$$

Edit Note to OP: I just noticed that Stefan Hansen's answer already pointed out the total variance formula to you, but the second line above adds a little detail to get you further along the way.

share|cite|improve this answer
I did it by finding $E[E[X^2]]$ based on Gautam Shenoy hints. Then find $$Var(Y) = E[Y^2] - E[Y]^2 $$ By the way, thank you for your solution. – Zeal Chaiwut Feb 17 '13 at 22:02

Here's a hint:

Use the conditional distribution of $Y$ if $X$ is known.

share|cite|improve this answer
That is a good hint but unfortunately I already saw other post. Thank you. – Zeal Chaiwut Feb 15 '13 at 11:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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