Suppose $X$ and $Y$ are two independent uniform random variables on $[0,1]$. Compute

$$ E[X^2 \mid X+Y = a ] $$

where $a\in (0,2)$.


First, we can find density of $Z=X^2$. We have

$$ P(X^2 \leq z ) = P( - \sqrt{z} \leq X \leq \sqrt{z}) = \int_{- \sqrt{z}}^{\sqrt{z}} dx =2 \sqrt{z}$$


$$ f_Z(z) = \frac{1}{\sqrt{z}}.$$

Now, here is where the trouble starts since I always get confused when computing the conditional expectation. Do they mean that I need to compute

$$ \int \int_{\sqrt{z}+y=a} z \frac{1}{\sqrt{z} } dy dz$$?

  • 1
    $\begingroup$ @gd1035 That's wrong. Actually it should be $E([a-Y]^2 | X+Y=a)$ .. which of course is not easier than the original :-) $\endgroup$ – leonbloy Dec 16 '18 at 3:43

Find joint density function of $U=X$ and $V=X+Y$ via transformation rule. Then we have $$ f_{U,V}(u,v) = 1_{\{0<u<1,\; 0<v-u<1\}}. $$ We can compute conditional pdf $f_{U|V}(u|v)$ as follows. $$ f_{U|V}(u|v)=\frac{f_{U,V}(u,v)}{f_V(v)} = \begin{cases}\frac{1}{v}1_{\{0<u<1,\; 0<v-u<1\}} \text{ for }v\in (0,1)\\\frac{1}{2-v}1_{\{0<u<1,\; 0<v-u<1\}}\text{ for }v\in (1,2) \end{cases}$$What is left is to actually calculate $E[U^2|V=v]$ as follows. $$ E[U^2|V=v] = \int u^2f_{U|V}(u|v)du = \frac{1}{v}\int_{\{0<u<1,\; v-1<u<v\}} u^2 du = \frac{1}{v}\int_0^v u^2du = \frac{v^2}{3} $$ for $v\in (0,1)$ and $$ \frac{1}{2-v}\int_{\{0<u<1,\; v-1<u<v\}} u^2 du = \frac{1}{2-v}\int_{v-1}^1 u^2 du = \frac{1}{2-v}\frac{u^3}{3}\Big|^{u=1}_{u=v-1} = \frac{v^2-v+1}{3}. $$

  • $\begingroup$ It's very nice!! Thank you!! $\endgroup$ – Jimmy Sabater Dec 16 '18 at 18:58
  • $\begingroup$ but, question, why do you condition on $V=v$? Isnt it a constant $a$? $\endgroup$ – Jimmy Sabater Dec 16 '18 at 18:59
  • $\begingroup$ Oh, it's my mistake. Maybe it was for notational consistency. But it may not cause problem because one can read $v$ appearing in all the expressions as $a$. $\endgroup$ – Song Dec 16 '18 at 19:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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