Pairwise independence does not imply mutual independence, as shown by the following example attributed to S. Bernstein. Suppose X and Y are two independent tosses of a fair coin, where we designate 1 for heads and 0 for tails. Let the third random variableZ be equal to 1 if exactly one of those coin tosses resulted in "heads", and 0 otherwise. Then jointly the triple has the following probability distribution: Here the marginal probability distributions are identical: and The bivariate distributions also agree: where Since each of the pairwise joint distributions equals the product of their respective marginal distributions, the variables are pairwise independent:
X and Y are independent, and
X and Z are independent, and
Y and Z are independent.
However, X, Y, and Z are not mutually independent, since the left side equalling for example 1/4 for = while the right side equals 1/8 for =. In fact, any of is completely determined by the other two. That is as far from independence as random variables can get.
Bounds on the probability that the sum of Bernoulli random variables is at least one, commonly known as the union bound, are provided by the Boole–Fréchet inequalities. While these bounds assume only univariate information, several bounds with knowledge of general bivariate probabilities, have been proposed too. Denote by a set of Bernoulli events with probability of occurrence for each. Suppose the bivariate probabilities are given by for every pair of indices. Kounias derived the following upper bound: which subtracts the maximum weight of a starspanning tree on a complete graph with nodes from the sum of the marginal probabilities. Hunter-Worsley tightened this upper bound by optimizing over as follows: where is the set of all spanning trees on the graph. These bounds are not the tightest possible with general bivariates even when feasibility is guaranteed as shown in Boros et.al. However, when the variables are pairwise independent, Ramachandra-Natarajan showed that the Kounias-Hunter-Worsley bound is tight by proving that the maximum probability of the union of events admits a closed-form expression given as: where the probabilities are sorted in increasing order as. It is interesting to note that the tight bound in depends only on the sum of the smallest probabilities and the largest probability. Thus, while ordering of the probabilities plays a role in the derivation of the bound, the ordering among the smallest probabilities is inconsequential since only their sum is used.
Comparison with the Boole–Fréchet">Fréchet inequalities">Boole–Fréchet union bound">Boole's inequality">union bound
It is useful to compare the smallest bounds on the probability of the union with arbitrary dependence and pairwise independence respectively. The tightest Boole–Fréchet upper union bound is given as: As shown in Ramachandra-Natarajan, it can be easily verified that the ratio of the two tight bounds in and is upper bounded by where the maximum value of is attained when where the probabilities are sorted in increasing order as. In other words, in the best-case scenario, the pairwise independence bound in provides an improvement of over the univariate bound in.
Generalization
More generally, we can talk aboutk-wise independence, for any k ≥ 2. The idea is similar: a set of random variables is k-wise independent if every subset of size k of those variables is independent. k-wise independence has been used in theoretical computer science, where it was used to prove a theorem about the problem MAXEkSAT. k-wise independence is used in the proof that k-independent hashing functions are secure unforgeable message authentication codes.