Tutorials › Statistical Theory I - Probability and Distribution Theory › Zero Covariance Implies Independence for Bernoulli Variables

Variance and Covariance Structure · Tutorial 359 of 994

Zero Covariance Implies Independence for Bernoulli Variables

Learn to parameterize the joint table of two Bernoulli variables and prove exactly when zero covariance characterizes their independence.

Intermediate 9 min read

What You'll Learn

  • Represent the joint distribution of two Bernoulli variables using their success probabilities and one joint-cell probability.
  • Derive covariance directly from the four-cell table.
  • Prove that zero covariance is equivalent to independence for Bernoulli variables.
  • Check the equivalence in independent, dependent, and degenerate examples.
  • Distinguish this special result from the general fact that zero covariance need not imply independence.

Why Bernoulli Variables Are a Special Case

Zero covariance is a statement about a particular average: the expected product of centered variables is zero. Independence is stronger; it requires the joint distribution to factor into the two marginal distributions. In general, the first condition does not guarantee the second. Bernoulli variables are an important exception: because each variable has only two possible values, their entire joint distribution is determined by their two success probabilities and one joint probability.

This tutorial identifies that remaining joint probability and shows that covariance measures exactly how far it is from the value required by independence. The argument uses the full joint probability table, so it also makes clear why the conclusion is special to two-valued variables.

Definition: A random variable \(X\) is Bernoulli with success probability \(p\) if \(P(X=1)=p\) and \(P(X=0)=1-p\), where \(0\leq p\leq 1\). For two Bernoulli variables \(X\) and \(Y\), write \(p=P(X=1)\), \(q=P(Y=1)\), and \(t=P(X=1,Y=1)\). Their success probabilities are nonzero when \(p>0\) and \(q>0\).

The Joint Table Has One Free Probability

Once \(p\), \(q\), and \(t\) are specified, the other three cell probabilities follow from the marginal probabilities and the fact that all four cells sum to one. The joint table must therefore have this form:

$$ \begin{array}{c|cc|c} & Y=1 & Y=0 & \text{Row total}\\ \hline X=1 & t & p-t & p\\ X=0 & q-t & 1-p-q+t & 1-p\\ \hline \text{Column total} & q & 1-q & 1 \end{array} $$

For example, \(P(X=1,Y=0)=p-t\), because \(P(X=1)=p\) consists of the disjoint outcomes \((X,Y)=(1,1)\) and \((1,0)\). The other entries follow in the same way. Since each cell must be nonnegative, \(t\) must satisfy

$$ \max(0,p+q-1)\leq t\leq \min(p,q). $$

The upper bounds \(t\leq p\) and \(t\leq q\) follow because the event \(\{X=1,Y=1\}\) is contained in each success event. The lower bounds follow from \(t\geq 0\) and \(1-p-q+t\geq 0\). These constraints ensure that the displayed table is a valid probability distribution.

Result: For Bernoulli \(X\) and \(Y\), \(E[X]=p\), \(E[Y]=q\), and \(E[XY]=t\). Consequently, $$ \operatorname{Cov}(X,Y)=t-pq. $$ Thus the covariance is the difference between the actual probability of joint success and the joint-success probability \(pq\) that independence would require.

To verify the result, the expectation of a Bernoulli variable is its success probability: \(E[X]=1\cdot p+0\cdot(1-p)=p\), and likewise \(E[Y]=q\). The product \(XY\) equals one only in the \((1,1)\) cell and is zero in the other three cells. Therefore \(E[XY]=t\). By the definition of covariance,

$$ \operatorname{Cov}(X,Y) =E[XY]-E[X]E[Y] =t-pq. $$

This calculation shows that positive covariance means joint success occurs more often than it would under independence, while negative covariance means it occurs less often. The sign describes the direction of this difference; a zero value means the joint-success probability equals \(pq\).

The Equivalence: Zero Covariance and Independence

Independence means that every joint cell probability equals the product of its corresponding marginal probabilities. For this two-by-two table, it is enough to examine the \((1,1)\) cell, provided we use the marginal probabilities to determine the other cells as well.

Theorem: Let \(X\) and \(Y\) be Bernoulli random variables with success probabilities \(p>0\) and \(q>0\). Then $$ \operatorname{Cov}(X,Y)=0 \quad\Longleftrightarrow\quad X\text{ and }Y\text{ are independent}. $$ The equivalence also holds if either success probability is zero; the stated positive-probability condition is not needed for the algebraic proof.

Proof. Let \(t=P(X=1,Y=1)\). The covariance calculation above gives \(\operatorname{Cov}(X,Y)=t-pq\). Hence zero covariance is equivalent to \(t=pq\).

If \(X\) and \(Y\) are independent, then by the definition of independence,

$$ t=P(X=1,Y=1)=P(X=1)P(Y=1)=pq, $$

so their covariance is zero. Conversely, suppose their covariance is zero. Then \(t=pq\). Substituting this value into all four entries of the joint table gives

$$ \begin{array}{c|cc} & Y=1 & Y=0\\ \hline X=1 & pq & p(1-q)\\ X=0 & (1-p)q & (1-p)(1-q) \end{array} $$

Each entry is the product of the corresponding marginal probabilities. For example, \(P(X=1,Y=0)=p(1-q)=P(X=1)P(Y=0)\); the same factorization holds for the other three cells. Any event determined by \(X\) is a subset of \(\{X=0,X=1\}\), and any event determined by \(Y\) is a subset of \(\{Y=0,Y=1\}\). Summing the cell factorizations over the relevant cells therefore gives the defining factorization for all such events. Thus \(X\) and \(Y\) are independent. \(\square\)

The proof establishes both directions. It does not infer independence merely from a zero average: it uses the fact that there are exactly four joint cells and that their values are fixed once \(p\), \(q\), and \(t\) are known.

Worked Example: An Independent Pair

Suppose \(X\) and \(Y\) are Bernoulli variables with \(p=0.4\), \(q=0.7\), and \(P(X=1,Y=1)=t=0.28\). Determine whether they are independent by constructing the table and checking the covariance.

The remaining cells are

$$ P(X=1,Y=0)=p-t=0.40-0.28=0.12, $$
$$ P(X=0,Y=1)=q-t=0.70-0.28=0.42, $$
$$ P(X=0,Y=0)=1-p-q+t=1-0.40-0.70+0.28=0.18. $$

The entries are nonnegative and sum to \(0.28+0.12+0.42+0.18=1\). The covariance is

$$ \operatorname{Cov}(X,Y)=t-pq=0.28-(0.40)(0.70)=0. $$

The theorem implies independence. Directly, the table entries are \(0.40(0.70)=0.28\), \(0.40(0.30)=0.12\), \(0.60(0.70)=0.42\), and \(0.60(0.30)=0.18\), confirming the factorization in every cell.

Worked Example: A Dependent Pair With Negative Covariance

Let \(p=0.4\), \(q=0.7\), and \(t=0.20\). Find the joint table, calculate the covariance, and decide whether the variables are independent.

The four cells are

$$ P(1,1)=0.20,\qquad P(1,0)=0.40-0.20=0.20, $$
$$ P(0,1)=0.70-0.20=0.50,\qquad P(0,0)=1-0.40-0.70+0.20=0.10. $$

All four probabilities are nonnegative and sum to \(0.20+0.20+0.50+0.10=1\), so this is a valid table. The covariance is

$$ \operatorname{Cov}(X,Y)=0.20-(0.40)(0.70)=0.20-0.28=-0.08. $$

Since the covariance is not zero, the variables are not independent. In particular, independence would require \(P(X=1,Y=1)=pq=0.28\), but the actual joint-success probability is \(0.20\). Joint success occurs less often than it would under independence, in agreement with the negative covariance.

Worked Example: A Degenerate Bernoulli Variable

Suppose \(P(X=1)=1\) and \(P(Y=1)=0.3\). Show that \(X\) and \(Y\) are independent even though \(X\) is constant.

Here \(p=1\). Since \(X=1\) with probability one, \(t=P(X=1,Y=1)=P(Y=1)=0.3\). The joint table is

$$ \begin{array}{c|cc} & Y=1 & Y=0\\ \hline X=1 & 0.3 & 0.7\\ X=0 & 0 & 0 \end{array} $$

The covariance is

$$ \operatorname{Cov}(X,Y)=t-pq=0.3-(1)(0.3)=0. $$

Each entry factors into its marginal probabilities: for instance, \(P(X=1,Y=0)=0.7=(1)(0.7)\), and cells with \(X=0\) have probability zero. Thus \(X\) and \(Y\) are independent. A constant random variable is independent of every random variable because the constant variable cannot alter any joint probability. This example also shows why the theorem remains valid at the boundary \(p=1\).

Why the Result Does Not Extend to General Variables

The equivalence depends on the two-point support. For a Bernoulli pair, matching \(P(X=1,Y=1)\) to \(pq\), together with the fixed marginals, forces all four joint probabilities to factor. With more possible values, a single covariance equation constrains only one weighted average of the joint probabilities; it generally does not force every joint cell to factor. Thus zero covariance need not imply independence for variables with larger or continuous supports.

A related pitfall is to reverse the general implication without checking the variable types. Independence implies zero covariance whenever the relevant expectations exist, but zero covariance alone is not generally enough to establish independence. The special Bernoulli result is a precise exception, not a replacement for the distinction between covariance and independence.

Key takeaway: For two Bernoulli variables, \(\operatorname{Cov}(X,Y)=P(X=1,Y=1)-P(X=1)P(Y=1)\). Their covariance is zero exactly when the joint-success probability factors, and the two-by-two marginal constraints then force every joint cell to factor as well.

Check Your Understanding

Use the joint-table parameter \(t=P(X=1,Y=1)\) to answer each question.

  1. If \(p=0.25\), \(q=0.8\), and \(t=0.20\), calculate all four joint probabilities and determine whether \(X\) and \(Y\) are independent.
  2. For Bernoulli \(X\) and \(Y\), explain why \(E[XY]=P(X=1,Y=1)\).
  3. If \(\operatorname{Cov}(X,Y)=0.06\), what is the difference between \(P(X=1,Y=1)\) and \(P(X=1)P(Y=1)\)?
  4. Why does the proof that zero covariance implies independence use more than the equation \(E[XY]=E[X]E[Y]\)?
  5. Does the equivalence require both success probabilities to be strictly between zero and one? Explain using the joint table.