Expected Value – How to Show Bernoulli Variables Are Dependent But Not Correlated

bernoulli-distributioncovarianceexpected value

I was looking at the following question from "One Thousand Exercises in Probability" by Grimmett, page 25, question 16 (not homework just self-study):

Let $X$ and $Y$ be independent Bernoulli random variables with $p = 1/2$.
Show that $X + Y$ and $|X − Y|$ are dependent though uncorrelated.

Now, the solution given on page 176 goes as follows:

$\mathrm{cov}(X+Y, |X-Y|) = E[(X+Y)\cdot(|X-Y|)] – E[X+Y]\cdot E[|X-Y|]$

I can work out that

$E[X+Y] = (0)(1/4) + (1)(1/2) + (2)(1/4) = 1$

and

$E[|X-Y|] = (0)(1/2) + (1)(1/2) = 1/2$

But I can't work out how to do

$E[(X+Y)\cdot(|X-Y|)]= ?$

The solution in the book for the covariance is:

$1/4 + 1/4 – 1(1/2) = 0$

To show dependence, the book provides the following solution:

$P(X+Y=0, |X-Y|=0) = 1/4$ is not the same as $P(X+Y=0)\cdot P(|X-Y|=0) = 1/8$

Best Answer

Here you can do a separation of the cases because there are very few. Here we go:

$X = 0; Y = 0 \Rightarrow |X - Y| = 0;(X+Y) = 0;(X+Y)|X-Y| = 0$
$X = 1; Y = 0 \Rightarrow |X - Y| = 1;(X+Y) = 1;(X+Y)|X-Y| = 1$
$X = 0; Y = 1 \Rightarrow |X - Y| = 1;(X+Y) = 1;(X+Y)|X-Y| = 1$
$X = 1; Y = 1 \Rightarrow |X - Y| = 0;(X+Y) = 2;(X+Y)|X-Y| = 0$

By giving a $1/4$ weight to each of these cases, you should find that the expected value of $E\left((X+Y)|X-Y|\right)$ is $1/2$ and not $0$. But the covariance is

$$E\left((X+Y)|X-Y|\right) - E(X+Y)E(|X-Y|) = 1/2 - 1 \cdot 1/2 = 0.$$

Related Question