Example of Pairwise Independent but not Jointly Independent Random Variables?

Find a joint probability distribution $$P(X_1,\dots, X_n)$$ such that $$X_i , \, X_j$$ are independent for all $$i \neq j$$, but $$(X_1, \dots , X_n)$$ are not jointly independent.

I always remember this clear example from Probability Essentials, chapter 3, by J.Jacod & P.Protter.

Let $\Omega = \{1,2,3,4\}$, and $\mathscr{A} = 2^\Omega$. Let $P(i) = \frac{1}{4}$, where $i = 1,2,3,4$.

Let $A = \{1,2\}$, $B = \{1,3\}$, $C = \{2,3\}$. Then A,B,C are pairwise independent but are not independent.

Throw two fair dice.

Consider the events:

• $A:=\{\text{the sum of the points is 7}\}$,
• $B:=\{\text{the first die rolled a 3}\}$,
• $C:=\{\text{the second die rolled a 4}\}$.

All three events have probability $\displaystyle\frac{1}{6}$.

Moreover, you can check that they are pairwise independent.

However, they are not jointly independent.

For your random variables, just take $1_A, 1_B,$ and $1_C$, the indicator functions of these events.

Hint: Let $n\ge 3$. Toss a fair coin $n-1$ times. For $i=1$ to $n-1$, let $X_i=1$ if the $i$-th toss gave a head, and $X_i=0$ otherwise. Let $X_n=1$ if the sum $\sum_1^{n-1} X_i$ is odd, and $X_n=0$ otherwise.

It is obvious that if $i\ne j$, and they are both less than $n$, then $X_i$ and $X_j$ are independent. It takes a bit more work to show that if $i\le n-1$, then $X_i$ and $X_n$ are independent. And it is clear that $X_1,\dots,X_n$ are not mutually independent, since if we know the values of the $X_1$ from $1$ to $n-1$, then we know the value of $X_n$.