Uncorrelated but not independent random variables Is it possible to construct two random variables $X, Y$ both of them assuming exactly two non-zero values which are uncorrelated, i. e. $\mathbf{E}[X \, Y] = \mathbf{E}[X]\,\mathbf{E}[Y]$, but not independent?
If that is not possible, what is the simplest example of non-zero discrete random variables which are uncorrelated but not independent?
Thanks a lot!
 A: Let $X$ be a standard normal random variable and let $Y = X^2$.
Then, since $E(X) = E(X^3) = 0$, we have $E(XY) = E(X^3) = 0 =E(X)E(Y).$
However, they are not independent:
$$P(0<X<1,Y>1) = 0 \neq P(0<X<1)P(Y>1)$$
For a simple discrete example, let $X_1$ and $X_2$ be independent random variables each taking values in $\{0,1\}$ with $P(X_i = 0) = P(X_i=1) = 1/2$.  Let $X = X_1 + X_2$ and $Y = X_1 - X_2$.
We have $E(X) = 1$, $E(Y) = 0$ and $E(XY) = 0$.  Hence, $E(XY) = E(X)E(Y)$.
But $P(X=0,Y=0) = 1/4 \neq P(X=0)P(Y=0) = 1/8.$
A: 
A simpler discrete example: Let $(X,Y)$ take values $(0,0)$, $(1,1)$, and $(2,0)$ with equal probability. Then:

*

*$E(XY)= 0\cdot 0\cdot \frac13 + 1\cdot 1\cdot\frac13 + 2\cdot0\cdot\frac13=\frac13$


*$E(X) = 0\cdot\frac13 + 1\cdot\frac13 + 2\cdot\frac13 = 1$


*$E(Y) = 0\cdot\frac13 + 1\cdot\frac13 + 0\cdot\frac13=\frac13$
so that $\operatorname{Cov}(X,Y)=E(XY)-E(X)E(Y)=0$ and the correlation between $X$ and $Y$ is zero. This zero correlation quantifies the fact that the relationship between $X$ and $Y$ exhibits no linear trend either upward or downward.
However, $X$ and $Y$ are not independent. Here are two ways to argue:

*

*$P(X=1,Y=1)=\frac13\ne \frac13\frac13=P(X=1)P(Y=1)$.

*Given $X=1$, you know $Y=1$ for sure, so that $P(Y=1\mid X=1)=1$. This differs from the unconditional probability $P(Y=1)=\frac13$.


Three possible values for the pair $(X,Y)$ is the simplest situation where discrete random variables can be uncorrelated but not independent. When the pair $(X,Y)$ takes two possible values and $X$ and $Y$ are uncorrelated, then they are also independent.
Proof: Since covariance is preserved under translation, wlog we may assume $(X,Y)$ takes value $(a,b)$ with probability $p\ne0$ and value $(0,0)$ with probability $q:=1-p\ne0$. Compute $E(XY)=abp$, $E(X)=ap$, $E(Y)=bp$, and $\operatorname{Cov}(X,Y)=abpq$. If the covariance equals zero, then either $a=0$ or $b=0$. If $a=0$ then $b\ne0$ and $P(X=0)=P(X=a)=1$ while $P(Y=b)=p$ and $P(Y=0)=q$. Hence $P(X=0,Y=0)=P(X=0)P(Y=0)$ and $P(X=a,Y=b)=P(X=a)P(Y=b)$ and we have independence. The case $b=0$ is similarly proved; or argue by symmetry, swapping $X,a$ with $Y,b$.
