Is statistical dependence transitive?

Solution 1:

First problem: Toss a fair coin twice. Let $X_1=1$ if the first toss is a head, and $0$ otherwise. Let $X_3=1$ if the second toss is a head, and $0$ otherwise. Let $X_2$ be the number of heads in the two tosses combined.

Then $X_1$ and $X_2$ are dependent, as are $X_2$ and $X_3$, but $X_1$ and $X_3$ are independent.

Second problem: Again, two tosses of a fair coin. Let $X_1$ and $X_3$ each be $1$ if we get head on the first toss, and $0$ otherwise. Let $X_2$ be $1$ if we got a head on the second toss, and $0$ otherwise. Then $X_1$ and $X_2$ are independent, as are $X_2$ and $X_3$, but $X_1$ and $X_3$ are very much not independent.

Solution 2:

for $(ii)$ consider $X_1, X_2$ independant and $X_1 = 3X_3$.