Joint Probability Distributions
A joint probability distribution gives the probabilities for two random variables at once. For discrete X and Y, a joint probability table lists p(x, y) = P(X = x and Y = y). For continuous X and Y, a joint density f(x, y) gives probabilities as double integrals over regions. Either way, the total probability is 1.
Before this lesson: Discrete Random Variables, Probability Density Functions and Double Integrals
Two random quantities at once
A store owner cares about laptop sales and tablet sales in the same hour. Knowing each one alone isn’t enough to answer questions like “what is the chance of selling at least two devices?” For that, you need the probability of every combination.
A joint distribution gives exactly that. For discrete variables it is a two-way table of probabilities. For continuous variables it is a density surface over the xy-plane, and a probability is the volume under the surface above a region.
Joint probability distribution formulas
For discrete X and Y, the joint probability mass function must satisfy
p(x, y) = P(X = x, Y = y) \ge 0, \qquad \sum_x \sum_y p(x, y) = 1, \qquad P\big((X, Y) \in A\big) = \sum_{(x, y) \in A} p(x, y)For continuous X and Y, the joint probability density function must satisfy
f(x, y) \ge 0, \qquad \iint_{\mathbb{R}^2} f(x, y)\,dA = 1, \qquad P\big((X, Y) \in R\big) = \iint_R f(x, y)\,dAThe joint CDF is F(x, y) = P(X ≤ x, Y ≤ y). It works for both kinds of variables.
Steps
- Check that the probabilities or the density are nonnegative and add or integrate to 1. Solve for any unknown constant this way.
- Draw or list the region where the event happens.
- For a table, add the cells in the region. For a density, set up a double integral over the region, with limits read from your sketch.
- Evaluate, working from the inside integral out.
Joint probability distribution examples
Example 1: A joint probability table (word problem)
A store tracks X, the number of laptops sold in an hour, and Y, the number of tablets sold. The joint distribution is in the table. Find P(X = 1, Y = 1), P(X + Y ≥ 2) and P(X \gt Y).
| Laptops x | Tablets y = 0 | Tablets y = 1 |
|---|---|---|
| x = 0 | 0.20 | 0.10 |
| x = 1 | 0.25 | 0.15 |
| x = 2 | 0.20 | 0.10 |
0.20 + 0.10 + 0.25 + 0.15 + 0.20 + 0.10 = 1
Check: the six cells add to 1.
P(X = 1, Y = 1) = 0.15
Read the cell in row x = 1, column y = 1.
P(X + Y \ge 2) = p(1, 1) + p(2, 0) + p(2, 1)
List the cells with x + y ≥ 2.
P(X + Y \ge 2) = 0.15 + 0.20 + 0.10 = 0.45
Add.
P(X \gt Y) = p(1, 0) + p(2, 0) + p(2, 1)
List the cells with x greater than y.
P(X \gt Y) = 0.25 + 0.20 + 0.10 = 0.55
Add.
Answer: 0.15, 0.45 and 0.55.
Example 2: Finding the constant in a joint PMF
X and Y have joint PMF p(x, y) = k(x + y) for x = 1, 2 and y = 1, 2, 3. Find k and P(X = 2, Y ≥ 2).
\sum_x \sum_y (x + y) = 2 + 3 + 4 + 3 + 4 + 5 = 21
Add x + y over all six pairs.
21k = 1
The probabilities must add to 1.
k = \dfrac{1}{21}Divide both sides by 21.
P(X = 2, Y \ge 2) = p(2, 2) + p(2, 3) = \dfrac{4}{21} + \dfrac{5}{21}Add the two cells.
P(X = 2, Y \ge 2) = \dfrac{9}{21} = \dfrac{3}{7}Simplify.
Answer: k = 1/21 and P(X = 2, Y ≥ 2) = 3/7.
Example 3: Finding the constant in a joint density
X and Y have joint density f(x, y) = k(x + 2y) on the unit square 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 elsewhere. Find k and P(X ≤ 1/2, Y ≤ 1/2).
\int_0^1 (x + 2y)\,dy = \Big[xy + y^2\Big]_0^1 = x + 1
Integrate in y first, holding x fixed (see double integrals).
\int_0^1 (x + 1)\,dx = \dfrac{1}{2} + 1 = \dfrac{3}{2}Then integrate in x.
\dfrac{3}{2}k = 1 \implies k = \dfrac{2}{3}The total volume must be 1.
\int_0^{1/2} (x + 2y)\,dy = \dfrac{x}{2} + \dfrac{1}{4}Inner integral over the smaller square.
\int_0^{1/2} \left(\dfrac{x}{2} + \dfrac{1}{4}\right)dx = \dfrac{1}{16} + \dfrac{1}{8} = \dfrac{3}{16}Outer integral.
P\left(X \le \tfrac{1}{2}, Y \le \tfrac{1}{2}\right) = \dfrac{2}{3} \cdot \dfrac{3}{16} = \dfrac{1}{8}Multiply by k.
Answer: k = 2/3 and the probability is 1/8. The smaller square has a quarter of the area but only an eighth of the probability, because the density is larger where x and y are larger.
Example 4: A probability over a slanted region
X and Y have joint density f(x, y) = 6e^(−2x−3y) for x ≥ 0 and y ≥ 0. Find P(X \lt Y).
P(X \lt Y) = \int_0^\infty \int_x^\infty 6e^{-2x-3y}\,dy\,dxFor each x, y runs from x to ∞ (see double integrals over general regions).
\int_x^\infty 6e^{-2x-3y}\,dy = 6e^{-2x} \cdot \dfrac{e^{-3x}}{3} = 2e^{-5x}Inner integral; e^(−2x) is a constant in y.
P(X \lt Y) = \int_0^\infty 2e^{-5x}\,dx = \dfrac{2}{5}Outer integral (see improper integrals).
Answer: 2/5 = 0.4. This density belongs to an Exp(2) time X and an Exp(3) time Y, and the answer matches the merging rule from the Poisson process lesson: 2/(2 + 3).
Example 5: The meeting problem (word problem)
Alice and Ben each arrive at a café at a random time between 0 and 60 minutes after noon, independently and uniformly. Find the probability that they arrive within 10 minutes of each other.
f(x, y) = \dfrac{1}{3600} \text{ on } [0, 60] \times [0, 60]Uniform on the square, which has area 3,600.
P(|X - Y| \le 10) = \dfrac{\text{area of band}}{3600}A constant density turns probability into area.
\text{corner triangles} = 2 \cdot \dfrac{1}{2} \cdot 50 \cdot 50 = 2500The two regions with |x − y| more than 10 are right triangles with legs 50 (see area of triangles).
\text{area of band} = 3600 - 2500 = 1100Subtract from the square.
P(|X - Y| \le 10) = \dfrac{1100}{3600} = \dfrac{11}{36} \approx 0.306Divide and simplify.
Answer: 11/36, about 0.306.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Skipping the total check | Using a table whose cells add to 0.95 | Check that the cells add to 1 (or the density integrates to 1) first. |
| Assuming independence | P(X = 1, Y = 1) = P(X = 1)P(Y = 1) = 0.40 × 0.35 = 0.14 in Example 1 | Read the joint cell: 0.15. Multiplying is only valid for independent variables. |
| Treating a density value as a probability | Saying f(1, 1) = 2 is a probability in Example 3 | A joint density can exceed 1; probabilities come from double integrals. |
| Integrating over the whole square | Using limits 0 to ∞ for y in Example 4 | Sketch the region: for X \lt Y, y runs from x to ∞. |
| Mixing up the inner limits | Writing the inner y limits in terms of y | Inner limits may depend only on the outer variable. |
Related ideas
Marginal distributions
Adding a table across a row gives P(X = x), and adding down a column gives P(Y = y). In Example 1, P(X = 1) = 0.40 and P(Y = 1) = 0.35. The next lesson, Marginal and Conditional Distributions, does this for densities too.
Two-way tables in statistics
A joint probability table is a two-way table of relative frequencies for a whole population or model. The same row-and-column thinking applies.
The joint CDF
For continuous variables, the joint density is the mixed partial derivative of the joint CDF: f(x, y) = ∂²F/∂x∂y. Practice problem 10 builds a joint CDF from a density.
Practice problems
- Using the table in Example 1, find P(Y = 1).
- Using the table in Example 1, find P(X ≤ 1, Y = 0).
- p(x, y) = cxy for x = 1, 2 and y = 1, 2. Find c.
- X and Y are uniform on the rectangle [0, 2] × [0, 3]. Find the joint density and P(X ≤ 1, Y ≤ 1).
- Show that f(x, y) = 4xy on the unit square is a joint density, and find P(X ≤ 1/2, Y ≤ 1/2).
- f(x, y) = x + y on the unit square. Find P(X + Y ≤ 1).
- For the density in Example 4, find P(X ≤ 1, Y ≤ 1).
- For the density in Example 4, find P(Y \lt X).
- In the meeting problem, find the probability that Alice and Ben arrive within 15 minutes of each other.
- f(x, y) = 4xy on the unit square. Find the joint CDF F(x, y) there, and F(0.5, 0.8).
Show answers
1.
P(Y = 1) = 0.10 + 0.15 + 0.10 = 0.35
Add the y = 1 column.
Answer: 0.35
2.
P(X \le 1, Y = 0) = p(0, 0) + p(1, 0) = 0.20 + 0.25 = 0.45
Add the two cells.
Answer: 0.45
3.
c(1 + 2 + 2 + 4) = 9c = 1
Add xy over the four pairs and set the total to 1.
c = \dfrac{1}{9}Divide both sides by 9.
Answer: c = 1/9
4.
f(x, y) = \dfrac{1}{2 \cdot 3} = \dfrac{1}{6}Uniform: 1 divided by the area 6.
P(X \le 1, Y \le 1) = \dfrac{1 \cdot 1}{6} = \dfrac{1}{6}Area of the 1-by-1 square times 1/6.
Answer: f = 1/6 on the rectangle; probability 1/6
5.
\int_0^1\int_0^1 4xy\,dy\,dx = 4 \cdot \dfrac{1}{2} \cdot \dfrac{1}{2} = 1Nonnegative, and the integral splits into two single integrals.
\int_0^{1/2}\int_0^{1/2} 4xy\,dy\,dx = 4 \cdot \dfrac{1}{8} \cdot \dfrac{1}{8} = \dfrac{1}{16}Each single integral of x from 0 to 1/2 is 1/8.
Answer: it integrates to 1; the probability is 1/16
6.
\int_0^{1-x} (x + y)\,dy = x(1 - x) + \dfrac{(1 - x)^2}{2} = \dfrac{1 - x^2}{2}Inner integral, then simplify.
\int_0^1 \dfrac{1 - x^2}{2}\,dx = \dfrac{1}{2}\left(1 - \dfrac{1}{3}\right) = \dfrac{1}{3}Outer integral.
Answer: 1/3
7.
\int_0^1\int_0^1 6e^{-2x-3y}\,dy\,dx = (1 - e^{-2})(1 - e^{-3})The integral splits: 2e^(−2x) and 3e^(−3y) each integrate separately.
(1 - e^{-2})(1 - e^{-3}) \approx 0.86466 \times 0.95021 \approx 0.8216Evaluate.
Answer: about 0.8216
8.
P(Y \lt X) = 1 - P(X \lt Y) = 1 - \dfrac{2}{5} = \dfrac{3}{5}Complement; ties have probability 0.
Answer: 3/5
9.
\text{corner triangles} = 2 \cdot \dfrac{1}{2} \cdot 45 \cdot 45 = 2025Legs are 60 − 15 = 45.
P = \dfrac{3600 - 2025}{3600} = \dfrac{1575}{3600} = \dfrac{7}{16}Subtract and simplify.
Answer: 7/16 = 0.4375
10.
F(x, y) = \int_0^x\int_0^y 4st\,dt\,ds = 4 \cdot \dfrac{x^2}{2} \cdot \dfrac{y^2}{2} = x^2y^2Integrate the density up to (x, y).
F(0.5, 0.8) = 0.25 \cdot 0.64 = 0.16
Substitute.
Answer: F(x, y) = x²y² on the unit square; F(0.5, 0.8) = 0.16
Joint probability distribution FAQ
What is a joint probability distribution?
It describes how two (or more) random variables behave together, by giving the probability or density of every combination of their values.
How do you find a probability from a joint PDF?
Sketch the region where the event happens, set up a double integral of f(x, y) over that region, and evaluate it from the inside out.
Can a joint density be greater than 1?
Yes. Only the total volume under the density has to be 1. In Example 3, f(1, 1) = 2.
What is the difference between a joint PMF and a joint PDF?
A joint PMF is for discrete variables, and its values are probabilities that add to 1. A joint PDF is for continuous variables, and probabilities are volumes under it.
Summary
- A joint PMF p(x, y) gives P(X = x, Y = y); the cells add to 1.
- A joint PDF f(x, y) is nonnegative and has total volume 1.
- Probabilities are sums of cells or double integrals over a region.
- Use the total of 1 to find an unknown constant.
- Don’t multiply single probabilities unless the variables are independent.
Previous lesson: Functions of a Random Variable
Next lesson: Marginal and Conditional Distributions
Back to the Probability Theory Index