Example 1 • Let X be a random variable that takes the value 0 with probability 1/2, and takes the value 1 with probability 1/2. • Let Y be a random variable,
independent of X, that takes the value −1 with probability 1/2, and takes the value 1 with probability 1/2. • Let U be a random variable constructed as U=XY. The claim is that U and X have zero covariance (and thus are uncorrelated), but are not independent. Proof: Taking into account that :\operatorname{E}[U] = \operatorname{E}[XY] = \operatorname{E}[X] \operatorname{E}[Y] = \operatorname{E}[X] \cdot 0 = 0, where the second equality holds because X and Y are independent, one gets : \begin{align} \operatorname{cov}[U,X] & = \operatorname{E}[(U-\operatorname E[U])(X-\operatorname E[X])] = \operatorname{E}[ U (X-\tfrac12)] \\ & = \operatorname{E}[X^2 Y - \tfrac12 XY] = \operatorname{E}[(X^2-\tfrac12 X)Y] = \operatorname{E}[(X^2-\tfrac12 X)] \operatorname E[Y] = 0 \end{align} Therefore, U and X are uncorrelated. Independence of U and X means that for all a and b, \Pr(U=a\mid X=b) = \Pr(U=a). This is not true, in particular, for a=1 and b=0. • \Pr(U=1\mid X=0) = \Pr(XY=1\mid X=0) = 0 • \Pr(U=1) = \Pr(XY=1) = 1/4 Thus \Pr(U=1\mid X=0)\ne \Pr(U=1) so U and X are not independent. Q.E.D.
Example 2 If X is a continuous random variable
uniformly distributed on [-1,1] and Y = X^2, then X and Y are uncorrelated even though X determines Y and a particular value of Y can be produced by only one or two values of X : f_X(t)= {1 \over 2} I_{[-1,1]} ; f_Y(t)= {1 \over {2 \sqrt{t}}} I_{]0,1]} on the other hand, f_{X,Y} is 0 on the triangle defined by 0 although f_X \times f_Y is not null on this domain. Therefore f_{X,Y} (X,Y) \neq f_X (X) \times f_Y (Y) and the variables are not independent. E[X] = {{1-1} \over 4} = 0 ; E[Y]= {{1^3 - (-1)^3}\over {3 \times 2} } = {1 \over 3} Cov[X,Y]=E \left [(X-E[X])(Y-E[Y]) \right ] = E \left [X^3- {X \over 3} \right ] = {{1^4-(-1)^4}\over{4 \times 2}}=0 Therefore the variables are uncorrelated. ==When uncorrelatedness implies independence==