Why Swapping the Variables Matters
A joint distribution describes two random variables together, including how their possible values occur in pairs. Sometimes the model treats the variables in exactly the same way: exchanging their labels leaves the joint law unchanged. In that case, neither variable has a different distribution from the other. This is useful when a model has no inherent “first” and “second” variable, but the conclusion requires symmetry of the joint law, not merely a support that looks symmetric.
For example, two randomly selected measurements might be governed by a law that assigns the same probability to the pair \((x,y)\) as to \((y,x)\). If that holds for every possible pair, the distribution of the first measurement must match the distribution of the second. The equality is about distributions; it does not say that the two random variables have equal values in every outcome.
The Equal-Marginals Result
The marginal distribution of a random variable describes its probabilities without specifying the value of the other variable. The result below says that swap invariance is enough to make the two marginal distributions identical.
The CDF proof is short, but it identifies exactly where the symmetry is used. The event \(\{X\leq t\}\) can be written as the event that the first coordinate of the pair is at most \(t\), with no restriction on the second coordinate.
The middle equality follows from swap invariance: swapping the coordinates turns the event \(X\leq t,\ Y\in\mathbb{R}\) into \(Y\leq t,\ X\in\mathbb{R}\), without changing its probability. Since the CDFs agree at every \(t\), the marginal distributions agree. The same argument applies to any Borel set \(A\): swap invariance gives \(P(X\in A)=P(Y\in A)\).
In particular, if a discrete joint probability mass function satisfies \(p_{X,Y}(a,b)=p_{X,Y}(b,a)\), summing over the other coordinate gives identical marginal masses. If a joint density is symmetric, integrating over the other coordinate gives identical marginal densities. These are two ways to verify the same distributional result.
Worked Example: Marginals from a Symmetric Discrete Table
A hypothetical model records two integer-valued measurements, \(X\) and \(Y\), each taking values in \(\{0,1,2\}\). Their joint probability mass function is given by this table. Find both marginal distributions, check swap invariance, and calculate \(P(X\leq 1)\) and \(E[X]\).
| \(X\backslash Y\) | 0 | 1 | 2 |
|---|---|---|---|
| 0 | \(1/10\) | \(1/20\) | \(1/20\) |
| 1 | \(1/20\) | \(1/5\) | \(1/20\) |
| 2 | \(1/20\) | \(1/20\) | \(2/5\) |
Step 1: Check that the entries form a probability distribution. The diagonal entries sum to \(1/10+1/5+2/5=7/10\). The six off-diagonal entries sum to \(6(1/20)=3/10\). Thus the total is \(7/10+3/10=1\).
Step 2: Check swap invariance. The table is symmetric across its diagonal: for example, the probabilities at \((0,2)\) and \((2,0)\) are both \(1/20\), and the probabilities at \((0,1)\) and \((1,0)\) are both \(1/20\). The diagonal entries are unchanged when the coordinates are swapped. Therefore \(p_{X,Y}(a,b)=p_{X,Y}(b,a)\) for all possible pairs.
Step 3: Sum the rows to find the marginal distribution of \(X\).
Step 4: Sum the columns to find the marginal distribution of \(Y\). The table is symmetric, so the column sums are the same as the row sums: \(P(Y=0)=1/5\), \(P(Y=1)=3/10\), and \(P(Y=2)=1/2\). Each marginal totals \(1/5+3/10+1/2=1\), as required.
Step 5: Calculate the requested probability and mean. The event \(X\leq 1\) includes \(X=0\) and \(X=1\), so \(P(X\leq 1)=1/5+3/10=1/2=0.5000\). Also,
The same marginal distribution gives \(E[Y]=1.3\). The check is consistent with the equal-marginals theorem. The method is to verify the entries under coordinate swapping, then sum over the other coordinate; it avoids assuming equality just because the two variables have similar names.
Continuous Models: Swap and Integrate
For a continuous pair with joint density \(f_{X,Y}\), the marginal density of \(X\) is obtained by integrating the joint density over all possible values of \(Y\). The marginal density of \(Y\) is obtained by integrating over all possible values of \(X\). If the density and its support are unchanged by swapping coordinates, these two integrations give the same function. The bounds must cover the actual support; writing bounds for a convenient rectangle when the support is smaller can give an incorrect marginal.
Worked Example: A Symmetric Density on a Square
Let \((X,Y)\) have joint density $$ f_{X,Y}(x,y)=4(1-x)(1-y),\qquad 0<x<1,\quad 0<y<1, $$ and density zero elsewhere. Verify that this is a density, obtain both marginals, and calculate \(P(Y\leq 1/2)\). Give the probability to four decimal places.
Step 1: Verify nonnegativity and normalization. On the unit square, both \(1-x\) and \(1-y\) are nonnegative. The integral is
Thus the stated function is a valid joint density. It is unchanged when \(x\) and \(y\) are exchanged, and the square support is also unchanged by that swap.
Step 2: Integrate out \(Y\) to obtain the marginal density of \(X\).
Step 3: Integrate out \(X\) to obtain the marginal density of \(Y\). The same calculation gives \(f_Y(y)=2(1-y)\) for \(0<y<1\). The two marginal densities have the same formula, with the variable appropriate to each marginal.
Step 4: Calculate the requested probability.
As a check, \(P(X\leq 1/2)\) has the same integral and is also \(0.7500\), as the theorem requires. The result comes from integrating the correctly derived marginal density; the number is not inferred merely from the visual symmetry of the square.
Symmetry of the Support Is Not Enough
The support is the set of points where a joint density can be positive. A symmetric support is necessary for swap invariance of a density, but it is not sufficient: the density values at swapped points must match as well. The following example shows the difference.
Worked Example: A Symmetric Support with Unequal Marginals
Suppose a continuous pair has density \(f_{X,Y}(x,y)=2x\) on the unit square \(0<x<1,\ 0<y<1\), and density zero elsewhere. Find both marginal densities and compare \(P(X\leq 1/2)\) with \(P(Y\leq 1/2)\). State why the equal-marginals theorem does not apply.
Step 1: Check normalization.
The density is nonnegative on the square and integrates to one.
Step 2: Calculate the marginal density of \(X\). Integrating over \(y\) gives
Step 3: Calculate the marginal density of \(Y\). Integrating over \(x\) gives
Step 4: Compare the probabilities.
The marginals differ. Although the unit square is symmetric, the density is not: \(f_{X,Y}(x,y)=2x\) while \(f_{X,Y}(y,x)=2y\), which are not equal for general \(x,y\). Therefore the joint law is not swap-invariant, and the theorem’s condition is not met. The different probabilities provide a final check on the marginal calculations.
What the Result Does—and Does Not—Say
Swap invariance is a statement about the entire joint law. It guarantees identical marginal distributions, so any marginal probability or marginal moment that exists is the same for \(X\) and \(Y\). For example, if the relevant expectations are finite, equality of the marginal distributions implies \(E[X]=E[Y]\). It does not say that \(X=Y\) for each outcome, and it does not by itself imply that \(X\) and \(Y\) are independent. A symmetric joint law can still describe dependent variables.
A useful diagnostic is to check the joint law directly. For a discrete model, compare each off-diagonal probability with its transposed entry. For a continuous model, check both the support and the density formula after exchanging its arguments. A symmetric-looking picture or equal-looking ranges alone are not a proof.
The central method is therefore: state the joint model and its support, verify that swapping the coordinates leaves the joint law unchanged, and then use the equal-marginals result or compute the marginals directly. This is aligned with the SOA VEE Mathematical Statistics syllabus.
Check Your Understanding
For each problem, verify the relevant joint-law condition before using the equal-marginals result.
- A discrete pair takes values in \(\{0,1\}^2\), with \(P(0,0)=1/8\), \(P(0,1)=3/8\), \(P(1,0)=3/8\), and \(P(1,1)=1/8\). Find \(P(X=1)\) and \(P(Y=1)\). (Answer: \(P(X=1)=P(Y=1)=1/2\).)
- A pair has density \(f_{X,Y}(x,y)=4xy\) for \(0<x<1,\ 0<y<1\), and zero elsewhere. Find the two marginal densities and \(P(X\leq 1/2)\). (Answer: \(f_X(x)=2x\) and \(f_Y(y)=2y\) on \((0,1)\); \(P(X\leq 1/2)=1/4=0.2500\).)
- A pair has constant density \(2\) on the triangle \(x>0,\ y>0,\ x+y<1\), and zero elsewhere. Find the marginal density of \(X\), and calculate \(P(Y\leq 1/2)\). (Answer: \(f_X(x)=2(1-x)\) for \(0<x<1\); \(P(Y\leq 1/2)=3/4=0.7500\).)
- A pair has density \(f_{X,Y}(x,y)=\frac{2}{3}(1+x)\) on the unit square and zero elsewhere. Find both marginal densities and compare the probabilities that each variable is at most \(1/2\). (Answer: \(f_X(x)=\frac{2}{3}(1+x)\), \(f_Y(y)=1\) on \((0,1)\); \(P(X\leq 1/2)=5/12=0.4167\) and \(P(Y\leq 1/2)=1/2=0.5000\), so the joint law is not swap-invariant.)
- A pair has density \(f_{X,Y}(x,y)=\frac{1}{2}(1+x+y)\) on the unit square and zero elsewhere. Find the common marginal density and calculate \(P(X\leq 1/2)\). (Answer: \(f_X(t)=f_Y(t)=\frac{3}{4}+\frac{t}{2}\) for \(0<t<1\); \(P(X\leq 1/2)=7/16=0.4375\).)