Pairwise independence

In probability theory, a pairwise independent collection of random variables is a set of random variables any two of which are independent. Any collection of mutually independent random variables is pairwise independent, but some pairwise independent collections are not independent.

Example
Here is perhaps the simplest example. Suppose X, Y, and Z have the following joint probability distribution:


 * $$(X,Y,Z)=\left\{\begin{matrix}

(0,0,0) & \mbox{with}\ \mbox{probability}\ 1/4, \\ (0,1,1) & \mbox{with}\ \mbox{probability}\ 1/4, \\ (1,0,1) & \mbox{with}\ \mbox{probability}\ 1/4, \\ (1,1,0) & \mbox{with}\ \mbox{probability}\ 1/4. \end{matrix}\right\}$$

Then


 * X and Y are independent, and
 * X and Z are independent, and
 * Y and Z are independent, but
 * X, Y, and Z are not independent, since any of them is just the mod 2 sum of the other two, and so is completely determined by the other two. That is as far from independence as random variables can get.  However, X, Y, and Z are pairwise independent, i.e. in each of the the pairs (X, Y), (X, Z), and (Y, Z), the two random variables are independent.