Tutorials › Statistical Theory I - Probability and Distribution Theory › Matching Marginals Does Not Establish Independence

Independence and Dependence · Tutorial 239 of 994

Matching Marginals Does Not Establish Independence

Learn why equal marginals can accompany different joint laws, and how to detect dependence by checking joint probabilities or densities against marginal products.

Intermediate 9 min read

What You'll Learn

  • Distinguish information in marginal distributions from information in a joint distribution.
  • Check independence in a discrete law by comparing joint cell probabilities with products of marginals.
  • Construct Bernoulli joint laws with fixed marginals and varying dependence.
  • Verify that a continuous density has specified uniform marginals.
  • Detect dependence in a continuous law by comparing a joint rectangle probability with the product of its marginal probabilities.
  • Avoid inferring independence from matching marginal distributions.

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.

Definition: The marginal distribution of \(X\) is its distribution considered alone, without specifying the value of \(Y\); the marginal distribution of \(Y\) is defined analogously. For a discrete pair, the joint probability mass function is \(p_{X,Y}(x,y)=P(X=x,Y=y)\), and the marginals are obtained by summing over the other variable. For a pair with joint density \(f_{X,Y}\), marginal densities are obtained by integrating over the other coordinate. The variables are independent exactly when their joint distribution is the product of their marginal distributions.

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:

$$ \begin{array}{c|cc} & Y=0 & Y=1\\ \hline X=0 & t & \frac12-t\\ X=1 & \frac12-t & t \end{array} $$

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.

Result: In this family, \(X\) and \(Y\) are independent if and only if \(t=1/4\). To see this, independence would require \(P(X=1,Y=1)=P(X=1)P(Y=1)=1/4\), while the table gives \(P(X=1,Y=1)=t\). When \(t=1/4\), all four entries equal \(1/4\), so every joint cell does factor into its marginal probabilities. \(\square\)

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

$$ f_{X,Y}(x,y)=1+\rho(2x-1)(2y-1),\qquad 0\leq x\leq1,\quad 0\leq y\leq1, $$

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.

Result: For every \(|\rho|\leq1\), this is a joint density with \(X\sim\operatorname{Uniform}(0,1)\) and \(Y\sim\operatorname{Uniform}(0,1)\). If \(\rho\neq0\), the variables are dependent.

To verify the density and its marginals, first note that

$$ \int_0^1 (2y-1)\,dy=[y^2-y]_0^1=0. $$

Consequently, for \(0\leq x\leq1\), integrating the joint density over \(y\) gives

$$ f_X(x)=\int_0^1 f_{X,Y}(x,y)\,dy =\int_0^1\bigl[1+\rho(2x-1)(2y-1)\bigr]\,dy =1. $$

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,

$$ \begin{aligned} P(X\leq 1/2,Y\leq 1/2) &=\int_0^{1/2}\int_0^{1/2} \bigl[1+\rho(2x-1)(2y-1)\bigr]\,dy\,dx\\ &=\frac14+\rho\left(-\frac14\right)\left(-\frac14\right) =\frac14+\frac{\rho}{16}. \end{aligned} $$

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 lawWhat to compareEvidence 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 everywhereA joint density that does not factor as the product of its marginal densities
Either typeA joint event probability and the product required by independenceAn 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.

Key takeaway: Marginal distributions describe each variable separately; independence is a property of how their values occur together. The same pair of marginals can arise from an independent joint law or from dependent joint laws.

Check Your Understanding

For each question, distinguish what the marginals tell you from what the joint law tells you.

  1. In the Bernoulli family table, what are the marginal probabilities for \(X\) and \(Y\), and for which value of \(t\) are the variables independent?
  2. 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?
  3. For the continuous density family, why does integrating over \(y\) leave a uniform marginal density for \(X\)?
  4. 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?
  5. Why does agreement between one joint probability and the corresponding product of marginals fail to establish independence?