Skip to content
Part IA Easter Term

Joint Distributions for Discrete Random Variables

Motivation

Many experiments involve multiple random variables simultaneously. We need to describe how they behave together, not just individually.

Examples:

  • Height and weight of a person
  • Roll of two dice
  • Price and quantity sold

Joint PMF

For discrete random variables XX and YY, the joint PMF is:

p(x,y)=P(X=x,Y=y)p(x, y) = P(X = x, Y = y)

Properties

  1. p(x,y)0p(x, y) \geq 0 for all (x,y)(x, y)
  2. xyp(x,y)=1\sum_x \sum_y p(x, y) = 1
  3. P((X,Y)A)=(x,y)Ap(x,y)P((X, Y) \in A) = \sum_{(x,y) \in A} p(x, y)

Example: Two Dice

Roll two dice. Let XX = first die, YY = second die.

Since independent: p(x,y)=P(X=x)P(Y=y)=1616=136p(x, y) = P(X = x) P(Y = y) = \frac{1}{6} \cdot \frac{1}{6} = \frac{1}{36} for all x,y{1,,6}x, y \in \{1, \ldots, 6\}.

All 36 outcomes (x,y)(x, y) have probability 136\frac{1}{36}.

Example: Dependent Variables

Draw two cards without replacement. Let XX = number of hearts in first draw, YY = number of hearts in second draw.

X,Y{0,1}X, Y \in \{0, 1\}. Total hearts in deck: 13.

  • P(X=0)=3952P(X = 0) = \frac{39}{52}
  • P(X=1)=1352P(X = 1) = \frac{13}{52}
  • P(Y=0,Y=1X=0)=3951,1251P(Y = 0, Y = 1 \mid X = 0) = \frac{39}{51}, \frac{12}{51}

Joint PMF:

X\YX \backslash YY=0Y = 0Y=1Y = 1
X=0X = 039523851\frac{39}{52} \cdot \frac{38}{51}39521351\frac{39}{52} \cdot \frac{13}{51}
X=1X = 113523951\frac{13}{52} \cdot \frac{39}{51}13521251\frac{13}{52} \cdot \frac{12}{51}

Computing Joint Probabilities

Product Rule

p(x,y)=P(Y=yX=x)P(X=x)p(x, y) = P(Y = y \mid X = x) \cdot P(X = x)

If independent:

p(x,y)=P(X=x)P(Y=y)=pX(x)pY(y)p(x, y) = P(X = x) \cdot P(Y = y) = p_X(x) \cdot p_Y(y)

Example

Two items from a batch. Each is defective with probability p=0.1p = 0.1, independent. Let XX = number defective in item 1 (Bernoulli), YY = number defective in item 2.

X\YX \backslash YY=0Y = 0Y=1Y = 1
X=0X = 00.810.810.090.09
X=1X = 10.090.090.010.01

The entry for (X=0,Y=0)(X=0, Y=0): P(X=0)P(Y=0)=0.9×0.9=0.81P(X=0) P(Y=0) = 0.9 \times 0.9 = 0.81.

Marginal PMFs

From the joint PMF, we can recover the marginal PMF of each variable:

pX(x)=yp(x,y)p_X(x) = \sum_y p(x, y)

pY(y)=xp(x,y)p_Y(y) = \sum_x p(x, y)

Intuition: To find the distribution of XX alone, “marginalise out” YY by summing over all possible yy values.

Example

From the joint table for two defective items:

P(X=0)=0.81+0.09=0.9P(X = 0) = 0.81 + 0.09 = 0.9

P(X=1)=0.09+0.01=0.1P(X = 1) = 0.09 + 0.01 = 0.1

These are the original marginal probabilities.

Visualisation

Joint PMFs can be visualised as a 3D bar chart or as a 2D heatmap with values in each cell.

Joint PMF as table

Independence from Joint PMF

XX and YY are independent if and only if:

p(x,y)=pX(x)pY(y)for all x,yp(x, y) = p_X(x) \cdot p_Y(y) \quad \text{for all } x, y

Checking Independence

Compute the product of marginals. If it equals the joint PMF everywhere, they are independent.

Counterexample: In cards without replacement:

P(X=0,Y=0)=39523851=14822652P(X = 0, Y = 0) = \frac{39}{52} \cdot \frac{38}{51} = \frac{1482}{2652}

P(X=0)P(Y=0)=39523952=15212704P(X = 0) P(Y = 0) = \frac{39}{52} \cdot \frac{39}{52} = \frac{1521}{2704}

Not equal \Rightarrow not independent. (Drawing a non-heart first affects probability of non-heart second.)

Summary

ConceptFormula
Joint PMFp(x,y)=P(X=x,Y=y)p(x,y) = P(X=x, Y=y)
Marginal of XXpX(x)=yp(x,y)p_X(x) = \sum_y p(x,y)
Independencep(x,y)=pX(x)pY(y)p(x,y) = p_X(x) p_Y(y)