# Pairwise Independent Random Variables that aren't Jointly Independent

I've seen some posts similar to this one, but I feel that the problem is just different enough that I can warrant a separate post. The task at hand is the following.

"Give an example of three random variables $X_1$, $X_2$, $X_3$ such that for $k=1,2,3$, $P\{X_k=1\} = P\{X_k = -1\} = \frac{1} {2}$ and such that $X_k$ and $X_j$ are independent for all $k \neq j$, but such that $X_1$, $X_2$, and $X_3$ are not jointly independent."

What I'm struggling with is finding a way for them to be pairwise independent without being jointly independent coupled with making $X_3$ have the given probability.

My first instinct was to do something like coin tossing, say with $X_1$ being the number of heads on the first toss, $X_2$ be the number of heads on the second toss, and $X_3$ be the number of heads in 2 tosses. Ignoring the fact that it's impossible to have -1 heads/tails come up on a coin, I can't make the probability for $X_3$ be $\frac{1} {2}$.

Any hints or ideas would be much appreciative.

• After you ask a question here, if you get an acceptable answer, you should "accept" the answer by clicking the check mark ✓ next to it. This scores points for you and for the person who answered your question. You can find out more about accepting answers here: How do I accept an answer?, Why should we accept answers?. – Clement C. Aug 24 '17 at 15:51

Take $X_1,X_2$ be independent random variables, uniform in $\{-1,1\}$, and $X_3 = X_1X_2$.

It is easy to see (i) pairwise independence, (ii) marginal distributions being uniform on $\{-1,1\}$, and (iii) obvious lack of joint independence.

(The hardest thing to show is (i). A simple way to argue about it is by symmetry.)

• Note: if you prefer to think about it that way, this is strictly equivalent to $X_1,X_2$ being independent uniform Bernoulli, and $X_3 = X_1+X_2 \bmod 2$ (i.e., a translation to uniform random variables over $\mathbb{Z}_2$). – Clement C. Aug 22 '17 at 23:48

Let $X1=1$ if coin A is Heads, $-1$ if Tails.

Let $X2=1$ if coin B is Heads, $-1$ if Tails.

Let $X3=1$ if $X1=X2$, $-1$ otherwise

• That's exactly the same example as in my answer, isn't it? – Clement C. Aug 23 '17 at 11:50
• well, you wanted 1 and -1 each with probability 0.5, and the third RV in my example is not the number of heads in both flips... so no, not exactly. Also, for example, the number of heads in two rolls is not independent from number of heads in the first roll. – Ned Aug 23 '17 at 13:01
• I don't understand your comment. Are you mistaking me for the OP? Read my answer, just above. – Clement C. Aug 23 '17 at 13:02
• yes, sorry, I thought you were the OP ... yes, I didn't look at the details of what you wrote. I saw "uniform" and thought "continuous", I'm used to using simple language. Apologies. – Ned Aug 23 '17 at 13:11
• No worries! ${}$ – Clement C. Aug 23 '17 at 13:12