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 X and Y, the joint PMF is:
p(x,y)=P(X=x,Y=y)
Properties
- p(x,y)≥0 for all (x,y)
- ∑x∑yp(x,y)=1
- P((X,Y)∈A)=∑(x,y)∈Ap(x,y)
Example: Two Dice
Roll two dice. Let X = first die, Y = second die.
Since independent: p(x,y)=P(X=x)P(Y=y)=61⋅61=361 for all x,y∈{1,…,6}.
All 36 outcomes (x,y) have probability 361.
Example: Dependent Variables
Draw two cards without replacement. Let X = number of hearts in first draw, Y = number of hearts in second draw.
X,Y∈{0,1}. Total hearts in deck: 13.
- P(X=0)=5239
- P(X=1)=5213
- P(Y=0,Y=1∣X=0)=5139,5112
Joint PMF:
| X\Y | Y=0 | Y=1 |
|---|
| X=0 | 5239⋅5138 | 5239⋅5113 |
| X=1 | 5213⋅5139 | 5213⋅5112 |
Computing Joint Probabilities
Product Rule
p(x,y)=P(Y=y∣X=x)⋅P(X=x)
If independent:
p(x,y)=P(X=x)⋅P(Y=y)=pX(x)⋅pY(y)
Example
Two items from a batch. Each is defective with probability p=0.1, independent. Let X = number defective in item 1 (Bernoulli), Y = number defective in item 2.
| X\Y | Y=0 | Y=1 |
|---|
| X=0 | 0.81 | 0.09 |
| X=1 | 0.09 | 0.01 |
The entry for (X=0,Y=0): P(X=0)P(Y=0)=0.9×0.9=0.81.
Marginal PMFs
From the joint PMF, we can recover the marginal PMF of each variable:
pX(x)=∑yp(x,y)
pY(y)=∑xp(x,y)
Intuition: To find the distribution of X alone, “marginalise out” Y by summing over all possible y values.
Example
From the joint table for two defective items:
P(X=0)=0.81+0.09=0.9
P(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.

Independence from Joint PMF
X and Y are independent if and only if:
p(x,y)=pX(x)⋅pY(y)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)=5239⋅5138=26521482
P(X=0)P(Y=0)=5239⋅5239=27041521
Not equal ⇒ not independent. (Drawing a non-heart first affects probability of non-heart second.)
Summary
| Concept | Formula |
|---|
| Joint PMF | p(x,y)=P(X=x,Y=y) |
| Marginal of X | pX(x)=∑yp(x,y) |
| Independence | p(x,y)=pX(x)pY(y) |