Let $X, X′$ be independent random variables taking values $\pm1$ with probabilities $\frac{1}{2}$. Let $0\le r \le 1$ and set:
$\ Y = \left\{ \begin{array}{ll} X & \mbox{with probability $r$}\\ X' & \mbox{with probability $1-r$}.\end{array} \right. $
Find $\rho(X, Y ) = \frac{E[XY]-E[X]E[Y]}{\sqrt{Var(X)Var(Y)}}$.
My attempt: $E[X]=E[X']=0$, $Var(X)=Var(X')=1$, $E[Y]=E[X] r + E[X'] (1-r) = 0$, $E[Y^2]= X^2 r + X'^2 (1-r)=r+(1-r)=1$ so $Var[Y]=1$. So all boils down to finding $E[XY]$ which I don't know how to do.
There are several methods. One is to look at the joint distribution
which gives $E[XY]= r$. As a check, this is clearly correct when $r=0$ or $1$