Why Independence Calculations Go Wrong
Independence is often tested by comparing a joint probability with a product of marginal probabilities. The calculation is short, but it is easy to use the wrong probability, test too few events, or draw a conclusion that the calculation does not support. These errors matter because independence is a statement about an entire joint distribution, not a single number.
For two random variables, the relevant comparison is between the probability of a joint event and the product of the probabilities of its two component events. For three or more variables, even confirming independence for every pair may fail to establish independence of the full collection. The distinctions below give a reliable way to check what a calculation does—and does not—show.
Marginal Probabilities Are Not Joint Probabilities
A marginal probability concerns one variable alone, such as \(P(X=1)\). A joint probability concerns a combination of variables, such as \(P(X=1,Y=1)\). In a joint probability table, a marginal is found by summing the relevant row or column; an individual cell is a joint probability. Confusing these quantities can make a dependent pair look independent, or make a correct calculation appear wrong.
Worked Example: Comparing a Joint Cell With Its Marginals
Suppose \(X\) and \(Y\) are Bernoulli random variables with the following joint probability table. Rows give values of \(X\), and columns give values of \(Y\).
| \(X\backslash Y\) | \(Y=0\) | \(Y=1\) | Row total |
|---|---|---|---|
| \(X=0\) | 0.40 | 0.10 | 0.50 |
| \(X=1\) | 0.10 | 0.40 | 0.50 |
| Column total | 0.50 | 0.50 | 1.00 |
The row and column totals give \(P(X=1)=0.50\) and \(P(Y=1)=0.50\). The joint probability is \(P(X=1,Y=1)=0.40\), not either marginal probability. If \(X\) and \(Y\) were independent, this joint probability would have to equal $$ P(X=1)P(Y=1)=(0.50)(0.50)=0.25. $$ Since \(0.40\ne 0.25\), the variables are dependent.
The table also illustrates why matching or knowing the marginals does not settle the question. Both variables have the same Bernoulli marginal distribution, but their joint probability is not the product required by independence.
For two discrete random variables, the factorization must hold for every pair of values with positive marginal probabilities. In a finite table, this means checking all cells against the products of their row and column totals. A single cell that fails the check is enough to establish dependence. A cell that passes, however, does not usually establish independence.
Pairwise Independence Does Not Guarantee Mutual Independence
For three variables, pairwise independence checks three separate pairs. Mutual independence requires a stronger factorization involving all three variables at once. The following construction makes the difference exact.
Worked Example: Three Pairwise Independent but Dependent Variables
Let \(X\) and \(Y\) be independent Bernoulli random variables with success probability \(1/2\), and define \(Z\) to be 1 when \(X\ne Y\), and 0 when \(X=Y\). Equivalently, \(Z=X\mathbin{\mathrm{xor}}Y\). The four possible triples are
each with probability \(1/4\). Each variable is Bernoulli with success probability \(1/2\). For any fixed values \(x,y\in\{0,1\}\), exactly one of the four triples has \(X=x,Y=y\), so $$ P(X=x,Y=y)=\frac14=P(X=x)P(Y=y). $$ Thus \(X\) and \(Y\) are independent. The same argument applies to the pairs \((X,Z)\) and \((Y,Z)\): each specified pair of values occurs in exactly one of the four triples, so each pair has joint probability \(1/4\), the product of its marginal probabilities.
But the three variables are not mutually independent. The event \(X=1,Y=1,Z=1\) never occurs, because \(X=Y=1\) forces \(Z=0\). Therefore $$ P(X=1,Y=1,Z=1)=0\ne \left(\frac12\right)^3=\frac18. $$ All three pairs are independent, yet the triple is dependent. This proves that pairwise checks cannot replace the full mutual-independence condition. \(\square\)
A useful diagnostic is to ask how many variables appear in the factorization being tested. For three variables, checking \(P(X\in A,Y\in B)\) against \(P(X\in A)P(Y\in B)\) says nothing by itself about the probability \(P(X\in A,Y\in B,Z\in C)\). Pairwise independence and mutual independence are different claims and require different evidence.
Zero Covariance Is Not Independence
When \(X\) and \(Y\) have finite second moments, independence implies \(\operatorname{Cov}(X,Y)=0\). The reverse implication is not generally valid: covariance measures linear association, so a nonlinear relationship can remain even when the covariance vanishes. The next calculation verifies this directly.
Worked Example: Zero Covariance Under a Deterministic Relationship
Let \(X\) take the values \(-1,0,1\), each with probability \(1/3\), and set \(Y=X^2\). Then \(Y\) is completely determined by \(X\), so the variables cannot be independent if \(Y\) is nonconstant. Check the covariance explicitly:
By the definition \(\operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]\), $$ \operatorname{Cov}(X,Y)=0-(0)\left(\frac23\right)=0. $$ Nevertheless, \(P(X=0,Y=0)=1/3\), whereas $$ P(X=0)P(Y=0)=\frac13\cdot\frac13=\frac19. $$ These probabilities differ, so \(X\) and \(Y\) are dependent despite having zero covariance. The dependence is the nonlinear relation \(Y=X^2\), which covariance does not detect. \(\square\)
The safe conclusion from zero covariance is exactly that the covariance is zero, not that the variables are independent. Independence can be concluded from zero covariance under additional assumptions in some settings, but those assumptions must be stated and checked; zero covariance alone is not enough.
Factorization Must Be Checked Adequately
Independence requires factorization for every allowable choice of events. A successful check for one event pair is only one necessary condition. For finite-support variables, checking all pairs of atoms is sufficient; checking only one atom pair is not. This difference can be seen in a table where one cell happens to equal the product of its marginals even though another does not.
Worked Example: One Correct Cell Does Not Prove Independence
Let \(X\) and \(Y\) each take values \(1,2,3\). Suppose their joint probability table is as follows:
| \(X\backslash Y\) | \(Y=1\) | \(Y=2\) | \(Y=3\) | Row total |
|---|---|---|---|---|
| \(X=1\) | \(2/18\) | \(3/18\) | \(1/18\) | \(6/18\) |
| \(X=2\) | \(3/18\) | \(1/18\) | \(2/18\) | \(6/18\) |
| \(X=3\) | \(1/18\) | \(2/18\) | \(3/18\) | \(6/18\) |
| Column total | \(6/18\) | \(6/18\) | \(6/18\) | \(1\) |
Every marginal probability is \(1/3\). The upper-left cell passes the independence check: $$ P(X=1,Y=1)=\frac{2}{18}=\frac19 =P(X=1)P(Y=1). $$ But another cell does not: $$ P(X=1,Y=2)=\frac{3}{18}=\frac16 \ne\frac19=P(X=1)P(Y=2). $$ Thus one factorization check succeeds and another fails; the variables are dependent. The table is a direct warning against treating one correct cell as a certificate of independence.
Proof. If \(X\) and \(Y\) are independent, the defining event factorization applied to \(A=\{x\}\) and \(B=\{y\}\) gives the displayed equality for every pair of support values.
Conversely, suppose the equality holds for every support pair. For any sets \(A\) and \(B\) of possible values, finite additivity gives $$ P(X\in A,Y\in B) =\sum_{x\in A}\sum_{y\in B}P(X=x,Y=y) =\sum_{x\in A}\sum_{y\in B}P(X=x)P(Y=y). $$ Because the sums are finite, the last expression factors: $$ \left(\sum_{x\in A}P(X=x)\right) \left(\sum_{y\in B}P(Y=y)\right) =P(X\in A)P(Y\in B). $$ This is the independence condition for all events determined by the finite supports. Hence \(X\) and \(Y\) are independent. \(\square\)
The finite-support theorem also clarifies what “check all the cells” means: the atom probabilities must factor for every support pair, not merely for the most convenient or most salient one. For more general distributions, independence is still a statement about all measurable event pairs. In particular, checking a few selected events—or only point probabilities, which may all be zero for continuous variables—cannot by itself establish independence.
Common Mistakes and a Reliable Check
- Using a marginal where a joint probability is needed. The independence comparison is \(P(X\in A,Y\in B)\) versus \(P(X\in A)P(Y\in B)\). A row or column total is not the joint cell.
- Promoting pairwise independence to mutual independence. For three or more variables, each pair can factor while a joint event involving all variables fails to factor.
- Interpreting zero covariance as independence. Covariance can miss nonlinear dependence, as the relation \(Y=X^2\) demonstrates.
- Stopping after one successful factorization. A single event pair that passes is one check, not a proof. A failed check proves dependence; a passing check generally leaves the question open.
A careful calculation states the event being tested, computes its joint probability, computes each marginal from the appropriate distribution or table total, and compares the joint probability with the product. For a claim about mutual independence, include the full collection of variables in the checks. For a finite joint table, verify every atom combination before concluding independence.
Check Your Understanding
For each question, focus on what the stated calculation establishes and what it leaves undecided.
- If \(P(X=1)=0.4\), \(P(Y=1)=0.5\), and \(P(X=1,Y=1)=0.2\), what does this one event-pair check show—and what does it not show?
- In the parity example, why does the probability of \(X=1,Y=1,Z=1\) contradict mutual independence?
- Can \(X\) and \(Y\) be dependent when \(\operatorname{Cov}(X,Y)=0\)? Give the explicit relationship and probability comparison from the worked example.
- For two finite-support variables, what must be checked in their joint table to establish independence?
- Why are point-probability checks alone not an adequate general test for independence of continuous random variables?