TITLE: Is statistical dependence transitive?
QUESTION [10 upvotes]: Take any three random variables $X_1$, $X_2$, and $X_3$. 
Is it possible for $X_1$ and $X_2$ to be dependent, $X_2$ and $X_3$ to be dependent, but $X_1$ and $X_3$ to be independent?
Is it possible for $X_1$ and $X_2$ to be independent, $X_2$ and $X_3$ to be independent, but $X_1$ and $X_3$ to be dependent?

REPLY [2 votes]: Let $X,Y$ be independent real-valued variables each with the standard normal distribution $\mathcal N(0,1)$
We have then: $$EX = EY = 0, EX^2 = EY^2 = 1.$$
Consider random variables $U = X +Y$, $V = X - Y$.   We have $E(U * V) = 0 .$
Since $U$ and $V$ are also normally distributed,  this implies that  $U$ and $V$ are statistically independent. Meanwhile, $(X, U)$, $(X, V)$ (as well as $(Y, U)$ and $(Y, V)$  are statistically dependent variables in each of these pairs.
Consider a regular triangular pyramid which 4 faces are colored as follows: 
$$(1,R), (2,G), (3, B), (4, RGB).$$ In rolling a pyramid, we have equal probability of  $1/4$  for each face to land on.
The probability to observe certain colors on the landed face are:
$$P(R) = P((1,R),(4,RGB)) = 1/2.$$ Similarly, $$P(G) = 1/2, P(B)= 1/2.$$
Then, we have $P(RGB)=1/4$ which is not equal to $P(R)*P(G)*P(G) = 1/8.$