Preview

A lesson from Essential Probability & Statistics for ML

£29/month

£29/month£29/month or £249/year · 30-day money-back guarantee

Get full access

Our content is best on a larger screen

Joint PMFs

Building a joint PMF from the outcomes

Explanation

So far, a PMF has described one random variable. But on one experiment we often define several random variables, one for each quantity we care about, and these are often dependent. To see how they behave together, we need the probability of each pair of values they can take.

For two random variables XX and YY, each outcome gives one value of XX and one value of YY, so one pair of values (x,y)(x, y). The diagram finds the probability of each pair for one roll of a die.

1
(0,?)
2
(0,?)
3
(0,?)
4
(0,?)
5
(0,?)
6
(1,?)
Ω
(X,Y)
y=0
y=1
x=0
x=1
One roll of a fair die. X=1 if the roll is a six and 0 otherwise; Y=1 if the roll is odd and 0 otherwise.

Step 1: The outcomes and X

Each of the six outcomes has probability 16. Under each outcome is its value of X: X=1 only for the roll 6.

Step 2: The value of Y

Y=1 for the odd rolls 1, 3 and 5. This completes the pair (x,y) under each outcome.

Step 3: Sort the outcomes into cells

Each outcome goes in the cell for its pair, in row x and column y. No roll is both a six and odd, so the cell for (1,1) is empty.

Step 4: Add the probabilities

The probability of each pair is the sum of the probabilities of the outcomes in its cell. For the shaded cell, (0,1), the outcomes are 1, 3 and 5:

P(X=0,Y=1)=16+16+16=12

The empty cell gets probability 0.

Joint PMF

Definition

The joint PMF of discrete random variables XX and YY is the function

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

It determines the joint distribution of XX and YY: the probability of every event about the pair.

We lay it out as a two-way table, with a row for each value xx and a column for each value yy, so the cell in row xx and column yy holds p(x,y)p(x, y). Each outcome gives exactly one pair of values, so the cells add to 11.

Example

A fair coin is tossed three times. XX is the number of heads, and Y=1Y = 1 if the first toss is heads and Y=0Y = 0 otherwise. Find the joint PMF of XX and YY, and find P(X=2,Y=1)P(X = 2, Y = 1).

Solution

The sample space is

Ω={HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}\Omega = \{HHH, HHT, HTH, HTT, THH, THT, TTH, TTT\}

We sort them into cells by the pair of values (X,Y)(X, Y) each one gives:

y=0y = 0y=1y = 1
x=0x = 0TTTTTTnone
x=1x = 1THTTHT, TTHTTHHTTHTT
x=2x = 2THHTHHHHTHHT, HTHHTH
x=3x = 3noneHHHHHH

Two cells are empty: a first toss of heads means at least one head, and three heads means the first toss is heads.

The outcomes are equally likely, each with probability 18\dfrac{1}{8}, so each cell's probability is 18\dfrac{1}{8} for each of its outcomes. This gives the joint PMF:

y=0y = 0y=1y = 1
x=0x = 018\dfrac{1}{8}00
x=1x = 114\dfrac{1}{4}18\dfrac{1}{8}
x=2x = 218\dfrac{1}{8}14\dfrac{1}{4}
x=3x = 30018\dfrac{1}{8}

P(X=2,Y=1)P(X = 2, Y = 1) is the cell in row x=2x = 2 and column y=1y = 1:

P(X=2,Y=1)=p(2,1)=14P(X = 2, Y = 1) = p(2, 1) = \dfrac{1}{4}

Practice questions

4 questions

A bag holds four tickets numbered 11 to 44, and two are drawn at random one after the other without replacement. XX is the number of even tickets drawn, and Y=1Y = 1 if the first ticket is even and Y=0Y = 0 otherwise.

Which table is the joint PMF of XX and YY?

Select the correct answer:

+ 3 more questions · unlocked with a subscription

Probabilities from a joint PMF

Explanation

For one random variable XX with PMF pp, the probability that XX takes a value in a set BB is the sum of the PMF over BB:

P(X∈B)=∑x∈Bp(x)P(X \in B) = \sum_{x \in B} p(x)

For two random variables, an event about the pair, such as {X+Y≤1}\{X + Y \le 1\}, is the event that (X,Y)(X, Y) takes a value in a set BB of pairs of values. We add the joint PMF over BB.

Probabilities from a joint PMF

Theorem

For discrete random variables XX and YY with joint PMF pp and any set BB of pairs of values,

P((X,Y)∈B)=∑(x,y)∈Bp(x,y)P((X, Y) \in B) = \sum_{(x, y) \in B} p(x, y)

When the joint PMF is laid out as a table, each pair in BB is a cell, so we mark the cells whose pair meets the condition and add them.

Example

In a football match, XX is the number of goals the home team scores and YY the number the away team scores. Each is 00, 11 or 22, with this joint PMF:

y=0y = 0y=1y = 1y=2y = 2
x=0x = 00.120.120.10.10.050.05
x=1x = 10.150.150.130.130.060.06
x=2x = 20.180.180.110.110.10.1

Find the probability that the home team wins.

Solution

The home team wins when it scores more goals than the away team, which is the event {X>Y}\{X > Y\}. We mark the cells whose pair has x>yx > y. A draw, with x=yx = y, is not a win, so the cells on the diagonal are left out:

B={(1,0),(2,0),(2,1)}B = \{(1, 0), (2, 0), (2, 1)\}

We add the joint PMF's cells for the pairs in BB:

P(X>Y)=∑(x,y)∈Bp(x,y)=p(1,0)+p(2,0)+p(2,1)=0.15+0.18+0.11=0.44\begin{align*} P(X > Y) &= \sum_{(x, y) \in B} p(x, y) \\[6pt] &= p(1, 0) + p(2, 0) + p(2, 1) \\[6pt] &= 0.15 + 0.18 + 0.11 \\[6pt] &= 0.44 \end{align*}

The home team wins with probability 0.440.44.

Practice questions

4 questions

A student sits two short tests, each marked 11, 22 or 33. XX is the mark on the first test and YY the mark on the second, with this joint PMF:

y=1y = 1y=2y = 2y=3y = 3
x=1x = 10.10.10.080.080.020.02
x=2x = 20.070.070.250.250.080.08
x=3x = 30.030.030.120.120.250.25

What is the probability that the student gets the same mark on both tests?

Select the correct answer:

+ 3 more questions · unlocked with a subscription

Memory is built by recalling, not by reading.

Every time you pull an answer from memory, the memory gets stronger. Reading doesn't do that. Nodeledge asks you questions on every step of every lesson, then asks again after days, weeks and months.

Get full access

£29/month or £249/year · 30-day money-back guarantee

See the learning path