Computing conditional expectation of independent uniform rv

probabilityprobability distributions

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)$.

Try.

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}$$

Therefore,

$$ 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$$?

Best Answer

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}. $$

Related Question