# What's the difference between these two random variables.

I'm currently learning probability theory by myself, and I came across this exercise the other day:

Suppose $X_1$'s pdf is $f_1(x)$ and $X_2$'s pdf is $f_2(x)$ and they are independent, defining two random variables $Y_1$ whose pdf is ${1\over2}f_1(y)+{1\over2}f_2(y)$ and $Y_2 ={{X_1 +X_2}\over2}$. I know that they have the same expectation, my question is what's the relationship between their variance, and is there any connection between $Y_1$ and $Y_2$? please help!

• @Vera oh sorry! yes! they are. – Bubblethan Jul 6 '18 at 14:41
• A simple way to build a random variable distributed as your $Y_1$ is to consider $$Y_1=BX_1+(1-B)X_2$$ where $B$ is independent of $(X_1,X_2)$ and Bernoulli with $$P(B=1)=P(B=0)=\frac12$$ You can see this is very different from $$Y_2=\frac12X_1+\frac12X_2$$ The value of the variance follows. – Did Jul 6 '18 at 15:11
• @Did Can you be more specific about the idea of considering $Y_1=BX_1+(1-B)X_2$ :)? – Bubblethan Jul 8 '18 at 3:04
• Sure -- but can you be more specific about what would not already be 100% specific in the construction I explained in my previous comment? – Did Jul 8 '18 at 4:22

$$\mathsf{Var}Y_2=\frac14(\mathsf{Var}X_1+\mathsf{Var}X_2)$$and for $k=1,2$:
$$\mathbb EY_1^k=\frac12(\mathbb EX_1^k+\mathbb EX_2^k)$$
so that $$\mathsf{Var}Y_1=\mathbb EY_1^2-(\mathbb EY_1)^2=\frac12(\mathbb EX_1^2+\mathbb EX_2^2)-\frac12(\mathbb EX_1+\mathbb EX_2)^2=$$$$\frac12\mathsf{Var}X_1+\frac12\mathsf{Var}X_2-\mathbb EX_1\mathbb EX_2=2\mathsf{Var}Y_2-\mathbb EX_1\mathbb EX_2$$