From a Joint Law to Marginals
When two random variables are recorded together, their joint law describes both their individual behavior and how their values can occur together. Summing or integrating that law over one coordinate removes that coordinate and gives the distribution of the other. The same joint law also lets us calculate probabilities for regions such as \(\{(x,y):x<y\}\) or \(\{(x,y):x+y\ge 2\}\), while its factorization reveals whether the variables are independent.
Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). For random variables \(X\) and \(Y\), their joint distribution assigns probability \(\mathbb{P}(X\in A,Y\in B)\) to pairs of measurable sets \(A,B\). Their marginal distributions are the individual laws of \(X\) and \(Y\). If \(X,Y\) have a joint probability mass function, it is \(p_{X,Y}(x,y)=\mathbb{P}(X=x,Y=y)\). If they have a joint density, it is a nonnegative function \(f_{X,Y}\) whose integral over a set in the plane gives that set's probability. In either case, values outside the joint support contribute zero.
Proof. For a discrete value \(x\), the events \(\{X=x,Y=y\}\), as \(y\) ranges over the possible values of \(Y\), are disjoint and their union is \(\{X=x\}\). Countable additivity therefore gives \(\mathbb{P}(X=x)=\sum_y\mathbb{P}(X=x,Y=y)\). Interchanging the roles of \(X\) and \(Y\) gives the other mass formula. In the density case, the probability that \(X\) belongs to a measurable set \(A\) is the integral of the joint density over \(A\times\mathbb{R}\). Integrating first in \(y\) gives \(\int_A\left(\int_{\mathbb R}f_{X,Y}(x,y)\,dy\right)dx\), by Tonelli's theorem for nonnegative functions. Thus the inner integral is a density for \(X\); integrating first in \(x\) proves the formula for \(Y\). \(\square\)
For any measurable region \(C\) in the plane, the probability that \((X,Y)\) lies in \(C\) is the sum of \(p_{X,Y}(x,y)\) over support points in \(C\), in the discrete case, or the integral of \(f_{X,Y}\) over \(C\), in the density case. The region must be intersected with the joint support: points outside it have probability zero. For discrete variables, a condition such as \(x+y\ge2\) includes points on the boundary, while \(x+y>2\) excludes them. For a joint density, a straight-line boundary has probability zero, but the region's strictness still determines which side is being integrated.
Independence as Factorization
Independence is a property of the joint law, not simply a resemblance between two marginal distributions. The variables \(X\) and \(Y\) are independent if \(\mathbb{P}(X\in A,Y\in B)=\mathbb{P}(X\in A)\mathbb{P}(Y\in B)\) for every pair of measurable sets \(A,B\).
Proof. First consider discrete variables. If they are independent, apply the definition to \(A=\{x\}\) and \(B=\{y\}\); this gives \(p_{X,Y}(x,y)=p_X(x)p_Y(y)\). Conversely, suppose the factorization holds at every pair. For any sets \(A,B\) of possible values, countable additivity and the factorization give \(\mathbb{P}(X\in A,Y\in B)=\sum_{x\in A}\sum_{y\in B}p_X(x)p_Y(y)=(\sum_{x\in A}p_X(x))(\sum_{y\in B}p_Y(y))\). These sums have nonnegative terms, so the product identity holds also for infinite sets. This is independence.
For variables with a joint density, if the density factors almost everywhere, integrating over \(A\times B\) gives \(\mathbb{P}(X\in A,Y\in B)=(\int_A f_X(x)\,dx)(\int_B f_Y(y)\,dy)\), which is independence. Conversely, if \(X,Y\) are independent, their joint law and the measure with density \(f_X(x)f_Y(y)\) agree on every rectangle \(A\times B\). The standard uniqueness theorem for probability measures agreeing on all measurable rectangles implies that these are the same joint law. Uniqueness of densities up to sets of measure zero then gives \(f_{X,Y}=f_Xf_Y\) almost everywhere. This proves both directions. \(\square\)
In applications, first find the marginals, then compare the joint mass or density with their product. A discrepancy at even one support point disproves independence in a discrete model. For densities, a discrepancy must occur on a set of positive area to disprove equality almost everywhere; different values at a single point alone are not enough.
Worked Example: Marginals and a Region in a Discrete Law
Let \(X\) take values \(0,1\) and \(Y\) take values \(0,1,2\), with joint mass function given by this table. Find both marginals, test independence, and calculate \(\mathbb{P}(X+Y\ge2)\).
| \(p_{X,Y}(x,y)\) | \(y=0\) | \(y=1\) | \(y=2\) | Row sum |
|---|---|---|---|---|
| \(x=0\) | \(\tfrac18\) | \(\tfrac14\) | \(\tfrac18\) | \(\tfrac12\) |
| \(x=1\) | \(\tfrac18\) | \(\tfrac18\) | \(\tfrac14\) | \(\tfrac12\) |
| Column sum | \(\tfrac14\) | \(\tfrac38\) | \(\tfrac38\) | \(1\) |
The row sums give \(p_X(0)=\tfrac12\) and \(p_X(1)=\tfrac12\). The column sums give \(p_Y(0)=\tfrac14\), \(p_Y(1)=\tfrac38\), and \(p_Y(2)=\tfrac38\). The total mass is \(\tfrac12+\tfrac12=1\), so the table is normalized.
At \((x,y)=(0,1)\), the joint mass is \(\tfrac14\), while the product of the marginals is \(\tfrac12\cdot\tfrac38=\tfrac3{16}\). Since \(\tfrac14=\tfrac4{16}\ne\tfrac3{16}\), the variables are not independent.
To have \(X+Y\ge2\), the included support points are \((0,2),(1,1),(1,2)\). The boundary point \((1,1)\) is included because the inequality is non-strict. Therefore \(\mathbb{P}(X+Y\ge2)=\tfrac18+\tfrac18+\tfrac14=\tfrac12\). As a check, the remaining points \((0,0),(0,1),(1,0)\) have total mass \(\tfrac18+\tfrac14+\tfrac18=\tfrac12\), so the two event probabilities sum to \(1\).
Worked Example: A Triangular Support Forces Dependence
Suppose \((X,Y)\) has joint density \(f_{X,Y}(x,y)=2\) when \(0<x<y<1\), and \(0\) elsewhere. Find the marginals, show that \(X,Y\) are dependent, and compute \(\mathbb{P}(X<\tfrac12,\ Y>\tfrac12)\).
The support is the triangle below the line \(y=1\) and above \(y=x\), with \(0<x<1\). Its area is \(\tfrac12\), so the density's total integral is \(2\cdot\tfrac12=1\). For fixed \(x\), the permitted values of \(y\) range from \(x\) to \(1\), giving \(f_X(x)=\int_x^1 2\,dy=2(1-x)\) for \(0<x<1\), and zero elsewhere. For fixed \(y\), the permitted values of \(x\) range from \(0\) to \(y\), giving \(f_Y(y)=\int_0^y2\,dx=2y\) for \(0<y<1\), and zero elsewhere.
These marginals each integrate to one: \(\int_0^1 2(1-x)\,dx=[2x-x^2]_0^1=1\), and \(\int_0^1 2y\,dy=[y^2]_0^1=1\). To test independence, consider \(A=(\tfrac34,1)\) and \(B=(0,\tfrac14)\). Every pair in \(A\times B\) has \(x>y\), outside the joint support, so \(\mathbb{P}(X\in A,Y\in B)=0\). But the marginal probabilities are \(\mathbb{P}(X\in A)=\int_{3/4}^1 2(1-x)\,dx=\tfrac1{16}\) and \(\mathbb{P}(Y\in B)=\int_0^{1/4}2y\,dy=\tfrac1{16}\). Their product is \(\tfrac1{256}>0\), so the variables are dependent.
For the requested event, the integration region is \(\tfrac12<y<1\) and \(0<x<\tfrac12\). Every such pair lies in the support since \(x<y\). Thus \(\mathbb{P}(X<\tfrac12,Y>\tfrac12)=\int_{1/2}^1\int_0^{1/2}2\,dx\,dy=\int_{1/2}^1 1\,dy=\tfrac12\). For comparison, the marginal probabilities are \(\mathbb{P}(X<\tfrac12)=\int_0^{1/2}2(1-x)\,dx=\tfrac34\) and \(\mathbb{P}(Y>\tfrac12)=\int_{1/2}^1 2y\,dy=\tfrac34\). Their product is \(\tfrac9{16}\), not \(\tfrac12\), another check that the variables are dependent.
Worked Example: Factorized Density and a Region Probability
Let \(f_{X,Y}(x,y)=2x\) for \(0<x<1\) and \(0<y<1\), and zero elsewhere. Find the marginals, establish independence, and calculate \(\mathbb{P}(X<Y)\).
The density integrates to one: \(\int_0^1\int_0^1 2x\,dy\,dx=\int_0^1 2x\,dx=1\). The marginals are \(f_X(x)=\int_0^1 2x\,dy=2x\) for \(0<x<1\), and \(f_Y(y)=\int_0^1 2x\,dx=1\) for \(0<y<1\); each is zero outside its stated interval. Their product is \(f_X(x)f_Y(y)=2x\), equal to the joint density throughout the unit square. The factorization criterion proves independence.
The event \(X<Y\) corresponds to \(0<x<1\) and \(x<y<1\). Therefore \(\mathbb{P}(X<Y)=\int_0^1\int_x^1 2x\,dy\,dx=\int_0^1 2x(1-x)\,dx=[x^2-\tfrac23x^3]_0^1=\tfrac13\). As a check, the complementary region \(X\ge Y\) gives \(\int_0^1\int_0^x2x\,dy\,dx=\int_0^1 2x^2\,dx=\tfrac23\). The line \(X=Y\) has probability zero under a density, and \(\tfrac13+\tfrac23=1\).
A Common Pitfall: Multiplying Marginals Too Soon
A frequent error is to multiply marginal probabilities for an event involving both variables before checking independence. In the triangular-density example, the incorrect calculation would be \(\mathbb{P}(X<\tfrac12,Y>\tfrac12)\stackrel{\text{wrong}}{=}\mathbb{P}(X<\tfrac12)\mathbb{P}(Y>\tfrac12)=\tfrac34\cdot\tfrac34=\tfrac9{16}\). The product rule applies here only if \(X\) and \(Y\) are independent, and the triangular support shows they are not. Direct integration over the event gives \(\tfrac12\), the correct value. For dependent variables, use the joint law and the actual region; use a product of marginal probabilities only after independence has been established for the variables.
Check Your Understanding
For each question, use the joint support and the relevant marginalization or factorization rule.
- A discrete joint mass function has \(p_{X,Y}(1,0)=\tfrac16\), \(p_X(1)=\tfrac13\), and \(p_Y(0)=\tfrac12\). Does this entry agree with independence? What does your answer establish?
- A density is \(f_{X,Y}(x,y)=3\) on \(0<x<y<1\) and zero elsewhere. What is its total integral? Is it a valid probability density as stated?
- For the discrete table in the first worked example, list the support points satisfying \(X+Y>2\). How does that event differ from \(X+Y\ge2\)?
- If a joint density factors as \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\) almost everywhere, what does the factorization criterion imply about \(X,Y\)?
- For the density \(f_{X,Y}(x,y)=2x\) on the unit square, compute the probability of \(X\ge Y\) by integrating over the corresponding region.