A lesson from Essential Probability & Statistics for ML
£29/month
£29/month£29/month or £249/year · 30-day money-back guarantee
Get full accessOur content is best on a larger screen
Slicing and renormalising
Suppose the random variable is if an email is spam and if not, and is the number of times the email contains the word "free". Knowing that an email is spam changes what we expect of , and their joint PMF holds that information.
So what is the distribution of once we know that ? With a two-way table of counts, we found a conditional probability by restricting to the known row and dividing by its total. With the joint PMF we do this to every cell in the row for , which gives a whole distribution of : the conditional distribution of given .
The diagram finds it for each value of in steps.
Here
Definition
For discrete random variables and , the conditional PMF of given is
for each value with . It gives the conditional distribution of given .
Likewise, the conditional PMF of given is
for each value with .
An online shop records a product's star rating , from to , and sets if the product is returned and otherwise. The joint PMF of and is:
Find the PMF of the star rating of a returned product, and the probability that a returned product has at least stars.
Solution
A returned product has , so we want the conditional PMF of given . The known value is a value of , so the slice is the column for . Its cells are , and , and its total is
We renormalise the slice by dividing each cell by :
As a table, the PMF of given is:
A returned product with at least stars is the event given . It holds for and , so we add those values of the conditional PMF:
So a returned product has at least stars with probability .
Practice questions
5 questions
A survey records the number of children in a household, from to , and the number of cars , from to . The joint PMF of and is:
What is the PMF of the number of cars in a household with children?
Select the correct answer:
+ 4 more questions · unlocked with a subscription
Rebuilding the joint from conditionals
Many pairs of random variables arise in two stages: first takes a value, then takes a value from its conditional distribution given that value.
We then know the pair through and the conditional PMFs of given each value of , rather than through its joint PMF. Can we recover the joint PMF from them?
We can. The multiplication rule for probabilities, , with and , gives every cell of the joint PMF:
In PMF notation, this is:
Theorem
For discrete random variables and ,
for each value with and every value . Likewise,
for each value with and every value .
So and the conditional PMFs determine the joint PMF, whereas the two marginal PMFs, in general, do not: the marginal PMF of is one distribution, whatever the value of , while the conditional PMFs give one for each value of .
A parcel goes by van () with probability , and otherwise by bike (). The number of days late , from to , has these conditional PMFs given each :
Find the joint PMF of and .
Solution
The parcel goes by bike whenever it does not go by van, so the marginal PMF of is
Each cell is , so we multiply each row of conditionals by the marginal of its own value of . For the van row, we multiply by :
For the bike row, we multiply by :
Writing the cells in a two-way table gives the joint PMF:
Each row adds to its marginal, and , so the cells add to .
Practice questions
4 questions
A cinema sets if a booking is made online, which happens with probability , and if it is made at the desk. The number of tickets in a booking, from to , has these conditional PMFs given each , with one entry missing:
| ? |
What is ?
Select the correct answer:
+ 3 more questions · unlocked with a subscription
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.