Why Marginals Are Not Enough
The marginal distribution of a random variable describes its behavior by itself. A joint distribution describes how two variables behave together. Knowing both marginals tells us the separate distributions of \(X\) and \(Y\), but it does not, in general, tell us how their values are paired. Independence is a claim about that pairing: every joint probability must agree with the corresponding product of marginal probabilities.
This distinction matters whenever a problem provides or estimates the distributions of two variables separately. Matching each marginal to a familiar distribution does not justify treating the variables as independent. To assess independence, we must examine joint probabilities or the joint distribution itself.
In particular, for discrete variables independence requires \(P(X=x,Y=y)=P(X=x)P(Y=y)\) for every pair of values \(x,y\). For an absolutely continuous pair, it requires \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\) almost everywhere. These tests concern the joint law, not just the two marginal laws.
A Discrete Family With Fixed Marginals
A small probability table makes the distinction especially clear. Let \(X\) and \(Y\) each take values 0 and 1. For a parameter \(t\) with \(0\leq t\leq 1/2\), assign probabilities as follows:
Every entry is nonnegative for the stated range of \(t\), and the four entries sum to \(2t+2(1/2-t)=1\). In each row and column, the probabilities sum to \(1/2\). Thus \(P(X=1)=P(Y=1)=1/2\) for every allowed \(t\): the two Bernoulli marginals stay fixed even as the joint law changes.
Worked Example: Same Bernoulli Marginals, Positive Dependence
Set \(t=3/8\). The joint probabilities are \(P(X=0,Y=0)=3/8\), \(P(X=0,Y=1)=1/8\), \(P(X=1,Y=0)=1/8\), and \(P(X=1,Y=1)=3/8\). They are nonnegative and sum to \(3/8+1/8+1/8+3/8=1\).
The marginal probability that \(X=1\) is \(1/8+3/8=1/2\), and the marginal probability that \(Y=1\) is also \(1/2\). If the variables were independent, the joint probability of both being 1 would be \((1/2)(1/2)=1/4\). Instead it is \(3/8\), so the variables are dependent.
The difference is visible in the events \(\{X=1\}\) and \(\{Y=1\}\): their intersection has probability \(3/8\), greater than the \(1/4\) it would have under independence. The matching Bernoulli marginals do not erase this joint information.
Worked Example: Unequal Bernoulli Marginals
Suppose \(X\) is Bernoulli with \(P(X=1)=0.3\) and \(Y\) is Bernoulli with \(P(Y=1)=0.6\). Consider the joint table \(P(X=1,Y=1)=0.24\), \(P(X=1,Y=0)=0.06\), \(P(X=0,Y=1)=0.36\), and \(P(X=0,Y=0)=0.34\).
The entries are nonnegative and sum to \(0.24+0.06+0.36+0.34=1\). Summing the entries where \(X=1\) gives \(0.24+0.06=0.30\); summing those where \(Y=1\) gives \(0.24+0.36=0.60\). Thus the table has exactly the stated marginals.
Under independence, the joint probability of \(X=1\) and \(Y=1\) would be \(0.3(0.6)=0.18\). The table assigns probability \(0.24\) instead. Since \(0.24\neq0.18\), the variables are not independent, despite having the specified Bernoulli marginals.
A Continuous Family With Fixed Uniform Marginals
The same phenomenon occurs for continuous variables. On the unit square, define the joint density
and set the density to zero outside the square. Here \(\rho\) is a fixed number satisfying \(|\rho|\leq1\). The factor \((2x-1)(2y-1)\) lies between \(-1\) and \(1\) on the square, so \(f_{X,Y}(x,y)\geq1-|\rho|\geq0\). The function is therefore nonnegative.
To verify the density and its marginals, first note that
Consequently, for \(0\leq x\leq1\), integrating the joint density over \(y\) gives
By the same calculation, \(f_Y(y)=1\) on \(0\leq y\leq1\). These marginals each integrate to 1, so the joint density also integrates to 1. They are both uniform regardless of the value of \(\rho\) in its allowed range.
To check independence when \(\rho\neq0\), consider the rectangle \(0\leq X\leq1/2\), \(0\leq Y\leq1/2\). The integral of \(2x-1\) from 0 to \(1/2\) is \([x^2-x]_0^{1/2}=-1/4\). Therefore,
Each marginal assigns probability \(1/2\) to its half-interval. Independence would therefore make the rectangle probability \((1/2)(1/2)=1/4\). For \(\rho\neq0\), the actual probability \(1/4+\rho/16\) differs, proving dependence.
Worked Example: Uniform Marginals With a Different Joint Probability
Take \(\rho=1/2\). The density is \(1+\tfrac12(2x-1)(2y-1)\) on the unit square. Since \(|(2x-1)(2y-1)|\leq1\), its value is at least \(1/2\); it is nonnegative. The marginal calculation above shows that both \(X\) and \(Y\) are uniform on \([0,1]\).
The probability that both values are at most \(1/2\) is \(1/4+(1/2)/16=1/4+1/32=9/32\). If \(X\) and \(Y\) were independent, this probability would be \((1/2)(1/2)=1/4=8/32\). Since \(9/32\neq8/32\), they are dependent.
In contrast, setting \(\rho=0\) gives the constant density 1 on the square, which equals the product of the two uniform marginal densities. Thus the same uniform marginals occur both with independence and with dependence.
What the Joint Law Adds
Marginals answer questions such as “How often does \(X\) take the value 1?” or “What is the distribution of \(Y\) alone?” They do not answer how frequently particular values occur together. The joint law supplies that missing information. In the examples, the marginals were held fixed while a cell probability or rectangle probability changed.
The relevant independence check depends on the kind of law being used:
| Joint law | What to compare | Evidence against independence |
|---|---|---|
| Discrete | \(P(X=x,Y=y)\) and \(P(X=x)P(Y=y)\) | Any cell where these differ |
| Absolutely continuous | \(f_{X,Y}(x,y)\) and \(f_X(x)f_Y(y)\), almost everywhere | A joint density that does not factor as the product of its marginal densities |
| Either type | A joint event probability and the product required by independence | An event pair \(A,B\) with \(P(X\in A,Y\in B)\neq P(X\in A)P(Y\in B)\) |
A single mismatch is enough to disprove independence. Conversely, checking only one cell or one rectangle and finding agreement does not establish independence; the factorization condition must hold throughout the joint law.
Common Mistake
Wrong reasoning: “Both variables have the stated marginal distributions, so they are independent.” This confuses separate behavior with joint behavior. In the continuous example, both variables are uniform for every allowed \(\rho\), but a nonzero \(\rho\) changes the probability of a joint rectangle. In the discrete examples, the marginal sums remain fixed while individual cells differ.
Correction: First verify the marginals, then check the joint law against the independence criterion. For a discrete pair, compare joint cell probabilities with products of marginal probabilities. For a density, compare the joint density with the product of marginal densities, or find a rectangle whose probability differs from the product of its marginal probabilities.
Check Your Understanding
For each question, distinguish what the marginals tell you from what the joint law tells you.
- In the Bernoulli family table, what are the marginal probabilities for \(X\) and \(Y\), and for which value of \(t\) are the variables independent?
- A discrete joint table has \(P(X=1)=0.4\), \(P(Y=1)=0.5\), and \(P(X=1,Y=1)=0.25\). Does this joint cell agree with independence?
- For the continuous density family, why does integrating over \(y\) leave a uniform marginal density for \(X\)?
- When \(\rho=1/2\), what is the probability that both uniform variables are at most \(1/2\), and what would that probability be under independence?
- Why does agreement between one joint probability and the corresponding product of marginals fail to establish independence?