StatisticsProbability Rules4 of 7
Probability Rules · 4

Conditional Probability and Two-Way Tables

We often need to find the probability of an event when we already know another piece of information is true.

1

How a Condition Shrinks the Universe

Suppose we track 100100 commuters heading to work and organize them into a two-way table by how they commuted (Took Train or Drove) and whether they arrived On Time or Late. We want to find the probability that a randomly chosen commuter was late once we already know they took the train.

On Time\text{On Time}
Late\htmlClass{lc-blue}{\text{Late}}
Total\text{Total}
Took Train\htmlClass{lc-violet}{\text{Took Train}}
5050
10\htmlClass{lc-blue}{10}
60\htmlClass{lc-violet}{60}
Drove\text{Drove}
2020
2020
4040
Total\text{Total}
7070
3030
100100
How a Condition Shrinks the Universe
On TimeLateTotal\hspace{2.44177em}\mathclap{\text{On Time}}\hspace{4.8835500000000005em}\mathclap{\text{Late}}\hspace{4.06962em}\mathclap{\text{Total}}
Took Train\text{Took Train}
Drove\text{Drove}
Total\text{Total}
100 commuters100\ \text{commuters}

When no extra information is given, every commuter in the table could be picked, so the whole group of 100\condition{100} stays on the bottom of the fraction:

Probability\displaystyle \text{Probability} =The group we care aboutThe whole universe\displaystyle = \frac{\event{\text{The group we care about}}}{\condition{\text{The whole universe}}}
P(Late)=30100=30%,P(Drove and Late)=20100=20%\displaystyle \begin{aligned}\text{P}(\event{\text{Late}}) &= \frac{\event{30}}{\condition{100}} = \share{30\%}, \\[6pt] \text{P}(\event{\text{Drove and Late}}) &= \frac{\event{20}}{\condition{100}} = \share{20\%}\end{aligned}

Once we are told the commuter took the train, we find the probability by looking only at that single row:

Text solution:

So a train rider has about a 16.7%\share{16.7\%} chance of arriving late, compared to 30%\share{30\%} for a commuter chosen from the whole table.

2

Flipping the Condition

Now let's see what happens when two questions use the exact same categories, Took Train and Late, but swap which one we already know: what is the chance a commuter was late if they took the train, versus the chance they took the train if they were late?

Flipping the Condition
On TimeLateTotal\hspace{2.25394em}\mathclap{\text{On Time}}\hspace{4.507890000000001em}\mathclap{\text{Late}}\hspace{4.2574499999999995em}\mathclap{\text{Total}}
Took Train\text{Took Train}
5050
1010
6060
Drove\text{Drove}
2020
2020
4040
Total\text{Total}
7070
3030
100100
If Train, chance Late?\text{If }\htmlClass{lc-violet}{\text{Train}}\text{, chance }\htmlClass{lc-blue}{\text{Late}}\text{?}
If Late, chance Train?\text{If }\htmlClass{lc-violet}{\text{Late}}\text{, chance }\htmlClass{lc-blue}{\text{Train}}\text{?}

Both questions look at the same overlap cell of 10\event{10} commuters who took the train and arrived late, but they compare those 1010 people against different universes on the bottom:

If Train, chance Late(only the Train row):Train and LateTotal Train=1060≈16.7%If Late, chance Train(only the Late column):Train and LateTotal Late=1030≈33.3%\displaystyle \begin{aligned} &\text{If Train, chance Late} \\ &\text{(only the Train row):} \\[4pt] &\quad \frac{\event{\text{Train and Late}}}{\condition{\text{Total Train}}} = \frac{\event{10}}{\condition{60}} \approx \share{16.7\%} \\[14pt] &\text{If Late, chance Train} \\ &\text{(only the Late column):} \\[4pt] &\quad \frac{\event{\text{Train and Late}}}{\condition{\text{Total Late}}} = \frac{\event{10}}{\condition{30}} \approx \share{33.3\%} \end{aligned}

So only 16.7%\share{16.7\%} of train riders arrived late, whereas 33.3%\share{33.3\%} of the late commuters came from the train.

On a test, write down the bottom of your fraction before you look for the top. The condition you already know comes right after phrases like "Given that...", "If...", "Of the people who...", or "Among those who...":

Conditional probability\displaystyle \text{Conditional probability} =OverlapCondition total\displaystyle = \frac{\event{\text{Overlap}}}{\condition{\text{Condition total}}}

Try switching between the whole table, the Took Train row, and the Late column below to see how the 10\event{10} commuters in the overlap stay on top while the total on the bottom changes.

Focusing on a single row or column changes the total on the bottom of the fraction, while the same overlap stays on top.
3

Conditional Probability Notation and Formula

Next, we need a short way to write conditional probability, and a way to calculate it when a problem only gives overall percentages instead of a table of counts, such as telling us that 10%\event{10\%} of commuters took the train and were late, and 60%\condition{60\%} of commuters took the train.

Conditional Probability Notation and Formula
P(Late∣Train)\displaystyle \text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) =  ?\displaystyle = \;?

In P(Late∣Train)\text{P}(\event{\text{Late}} \mid \condition{\text{Train}}), the vertical bar ∣\mid is read "given that" or "out of" (it is not a division sign). Whatever comes after the bar is the condition that becomes the new universe on the bottom:

P(Late∣Train⏟new universe)=Train and LateTotal Train=1060,P(Train∣Late⏟new universe)=Train and LateTotal Late=1030\displaystyle \begin{aligned} \text{P}\bigl(\event{\text{Late}} \mid \condition{\underbrace{\text{Train}}_{\text{new universe}}}\bigr) &= \frac{\event{\text{Train and Late}}}{\condition{\text{Total Train}}} \\[4pt] &= \frac{\event{10}}{\condition{60}}, \\[12pt] \text{P}\bigl(\event{\text{Train}} \mid \condition{\underbrace{\text{Late}}_{\text{new universe}}}\bigr) &= \frac{\event{\text{Train and Late}}}{\condition{\text{Total Late}}} \\[4pt] &= \frac{\event{10}}{\condition{30}} \end{aligned}

When we divide both the top and bottom counts by the grand total of 100100 commuters, each count turns into an overall probability out of the whole group:

P(Late∣Train)\displaystyle \text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) =1060\displaystyle = \frac{\event{10}}{\condition{60}} =1010060100\displaystyle = \frac{\event{\tfrac{10}{100}}}{\condition{\tfrac{60}{100}}} =0.100.60≈16.7%\displaystyle = \frac{\event{0.10}}{\condition{0.60}} \approx \share{16.7\%}

This gives the conditional probability formula for percentages and probabilities:

P(Late∣Train)\displaystyle \text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) =P(Late and Train)⏞overlapP(Train)⏟new universe\displaystyle = \frac{\event{\overbrace{\text{P(Late and Train)}}^{\text{overlap}}}}{\condition{\underbrace{\text{P(Train)}}_{\text{new universe}}}}
4

Building a Two-Way Table from Percentages

Dividing P(Late and Train)\event{\text{P(Late and Train)}} by P(Train)\condition{\text{P(Train)}} works in one step when a problem gives us both the overlap percentage and the condition's percentage. What if a word problem gives conditional percentages in one direction, and asks for the conditional probability flipped the other way around?

At a company, 20%20\% of employees work remotely. Of the remote workers, 80%80\% hit their sales target. Of the in-office workers, 50%50\% hit their sales target. If you pick a random employee who hit their target, what is the probability they work remotely, P(Remote∣Hit Target)\text{P}(\event{\text{Remote}} \mid \condition{\text{Hit Target}})?

Building a Two-Way Table from Percentages
P(Remote)=20%\text{P}(\text{Remote}) = 20\%
P(Hit Target∣Remote)=80%\text{P}(\text{Hit Target} \mid \text{Remote}) = 80\%
P(Hit Target∣In-Office)=50%\text{P}(\text{Hit Target} \mid \text{In-Office}) = 50\%
P(Remote∣Hit Target)=  ?\text{P}(\text{Remote} \mid \text{Hit Target}) = \;?
Hit TargetMissedTotal\hspace{2.94265em}\mathclap{\text{Hit Target}}\hspace{5.32181em}\mathclap{\text{Missed}}\hspace{4.13223em}\mathclap{\text{Total}}
Remote\text{Remote}
In-Office\text{In-Office}
Total\text{Total}
100100
Hit Target\htmlClass{lc-violet}{\text{Hit Target}}
Missed\text{Missed}
Total\text{Total}
Remote\htmlClass{lc-blue}{\text{Remote}}
16\htmlClass{lc-blue}{16}
44
2020
In-Office\text{In-Office}
4040
4040
8080
Total\text{Total}
56\htmlClass{lc-violet}{56}
4444
100100

Text solution:

So about 28.6%\share{28.6\%} of the employees who hit their sales target work remotely, even though 80%\share{80\%} of remote workers hit their target.

5

Spotting Independence in a Two-Way Table

Two events are independent when knowing one happened tells you nothing about the chance of the other. Let's check our commuter table to see whether taking the train and arriving late are independent.

Spotting Independence in a Two-Way Table
On TimeLateTotal\hspace{2.25394em}\mathclap{\text{On Time}}\hspace{4.507890000000001em}\mathclap{\text{Late}}\hspace{4.2574499999999995em}\mathclap{\text{Total}}
Took Train\text{Took Train}
5050
1010
6060
Drove\text{Drove}
2020
2020
4040
Total\text{Total}
7070
3030
100100
Are Took Train and Late independent?\text{Are Took Train and Late independent?}

To test for independence, we compare the overall probability of arriving late across all 100\condition{100} commuters with the probability of arriving late when zoomed in on the 60\condition{60} train riders:

Whole table:P(Late)=30100=30%Zoomed in on Train:P(Late∣Train)=1060≈16.7%\displaystyle \begin{aligned} \text{Whole table:} & \\ \text{P}(\event{\text{Late}}) &= \frac{\event{30}}{\condition{100}} = \share{30\%} \\[12pt] \text{Zoomed in on Train:} & \\ \text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) &= \frac{\event{10}}{\condition{60}} \approx \share{16.7\%} \end{aligned}

Because zooming in on the Took Train row drops the chance of being late from 30%\share{30\%} to 16.7%\share{16.7\%}, how someone commutes changes their chance of arriving late, so taking the train and being late are not independent.

Try changing the split between On Time and Late inside the Took Train row below to see when the percentage bars for P(Late)\text{P}(\event{\text{Late}}) and P(Late∣Train)\text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) match.

Zooming in on the train row changes the chance of being late unless the train row has the exact same percentage of late commuters as the whole table.

Key concepts

Every conditional probability question builds the same fraction: the overlap where both events happen on top, divided by the new universe we are zooming in on at the bottom. First check whether there is a condition at all. If a question simply asks for P(Drove and Late)\text{P}(\event{\text{Drove and Late}}) with no "given," "if," "of the people who," or "among those who," do not shrink the universe; keep all 100\condition{100} people on the bottom (20100=20%\tfrac{\event{20}}{\condition{100}} = \share{20\%}).

When there is a condition, choose what to do based on what the problem gives you:

A two-way table of counts

Put the row or column total for the condition after the bar on the bottom first, and put the shared overlap cell on top. Flipping the condition keeps the overlap on top the same and swaps the universe on the bottom:

P(Late∣Train)=1060≈16.7%,P(Train∣Late)=1030≈33.3%\displaystyle \begin{aligned}\text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) &= \frac{\event{10}}{\condition{60}} \approx \share{16.7\%}, \\[6pt] \text{P}(\event{\text{Train}} \mid \condition{\text{Late}}) &= \frac{\event{10}}{\condition{30}} \approx \share{33.3\%}\end{aligned}

Overall overlap and condition percentages

When a problem already gives both percentages out of the whole group, divide them directly:

P(Late∣Train)\displaystyle \text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) =P(Late and Train)P(Train)\displaystyle = \frac{\event{\text{P(Late and Train)}}}{\condition{\text{P(Train)}}} =0.100.60≈16.7%\displaystyle = \frac{\event{0.10}}{\condition{0.60}} \approx \share{16.7\%}

Percentages within each group and a flipped question

When a problem gives conditional percentages in one direction (like 80%80\% of the 20%20\% remote workers and 50%50\% of the 80%80\% in-office workers) and asks for the flipped condition P(Remote∣Hit Target)\text{P}(\event{\text{Remote}} \mid \condition{\text{Hit Target}}), start a two-way table with 100100 people, fill the cells, and add the new condition column (1616+40=1656≈28.6%\frac{\event{16}}{\condition{16 + 40}} = \frac{\event{16}}{\condition{56}} \approx \share{28.6\%}).

Testing independence

Compare the overall probability with the conditional probability. If zooming in changes the percentage (P(Late)=30%\text{P}(\event{\text{Late}}) = \share{30\%} vs. P(Late∣Train)≈16.7%\text{P}(\event{\text{Late}} \mid \condition{\text{Train}}) \approx \share{16.7\%}), the events are not independent; if the percentage stays the exact same, they are independent.

6

Practice

1

A coffee shop tracks 200200 drink orders in a two-way table. Iced drinks: 5050 Small, 7070 Large, Total 120120. Hot drinks: 6060 Small, 2020 Large, Total 8080. Column totals: 110110 Small, 9090 Large, Grand Total 200200. Among the customers who ordered an iced drink, what is the probability they ordered a large?

Look at the phrase "Among the customers who ordered an iced drink." Which row or column is your new universe, and what is its total?

The condition "ordered an iced drink" uses the Iced row total of 120\condition{120} as the bottom of the fraction, with 70\event{70} in the Iced and Large overlap cell on top. Watch out for dividing by the grand total of 200\wrong{200} (which gives 70200=35%\tfrac{\event{70}}{\wrong{200}} = \wrong{35\%}, the overall probability of Iced and Large) or by the Large column total of 90\wrong{90} (which flips the condition to P(Iced∣Large)=7090≈77.8%\text{P}(\event{\text{Iced}} \mid \wrong{\text{Large}}) = \tfrac{\event{70}}{\wrong{90}} \approx \wrong{77.8\%}).
P(Large∣Iced)\displaystyle \text{P}(\event{\text{Large}} \mid \condition{\text{Iced}}) =70120≈58.3%\displaystyle = \frac{\event{70}}{\condition{120}} \approx \share{58.3\%}
2

A survey of club members records whether they play a sport and whether they play an instrument. Plays Sport: 1515 play an instrument, 2525 do not. No Sport: 3030 play an instrument, 1010 do not. Find both P(Instrument∣Sport)\text{P(Instrument} \mid \text{Sport)} and P(Sport∣Instrument)\text{P(Sport} \mid \text{Instrument)}.

The problem only lists the inside cells. Which two cells do you add together to get the total for the group after the bar in each part?

First add the cells in each group to find the row and column totals: Total Sport=15+25=40\condition{\text{Total Sport}} = 15 + 25 = \condition{40} and Total Instrument=15+30=45\condition{\text{Total Instrument}} = 15 + 30 = \condition{45}. Don't divide 15\event{15} by the 25\wrong{25} who do not play an instrument (giving 1525=60%\tfrac{\event{15}}{\wrong{25}} = \wrong{60\%}) or by the 30\wrong{30} who do not play a sport (giving 1530=50%\tfrac{\event{15}}{\wrong{30}} = \wrong{50\%}), and don't swap the two denominators:
P(Instrument∣Sport)=1515+25=1540=37.5%,P(Sport∣Instrument)=1515+30=1545≈33.3%\displaystyle \begin{aligned}\text{P}(\event{\text{Instrument}} \mid \condition{\text{Sport}}) &= \frac{\event{15}}{\condition{15 + 25}} = \frac{\event{15}}{\condition{40}} = \share{37.5\%}, \\[6pt] \text{P}(\event{\text{Sport}} \mid \condition{\text{Instrument}}) &= \frac{\event{15}}{\condition{15 + 30}} = \frac{\event{15}}{\condition{45}} \approx \share{33.3\%}\end{aligned}
3

In a town, 40%40\% of households own a dog, 25%25\% own a cat, and 10%10\% own both a dog and a cat. What is the probability that a randomly chosen household owns a cat, given that it owns a dog?

You already have the overlap percentage and the percentage for each single group. Which of the two single-group percentages comes after "given that" and goes on the bottom?

The condition "given that it owns a dog" puts P(Dog)=0.40\condition{\text{P(Dog)}} = \condition{0.40} on the bottom and the overlap P(Cat and Dog)=0.10\event{\text{P(Cat and Dog)}} = \event{0.10} on top. Be careful not to put the Cat percentage on the bottom (0.100.25=40%\tfrac{\event{0.10}}{\wrong{0.25}} = \wrong{40\%}, which finds P(Dog∣Cat)\text{P}(\event{\text{Dog}} \mid \wrong{\text{Cat}}) instead).
P(Cat∣Dog)\displaystyle \text{P}(\event{\text{Cat}} \mid \condition{\text{Dog}}) =P(Cat and Dog)P(Dog)\displaystyle = \frac{\event{\text{P(Cat and Dog)}}}{\condition{\text{P(Dog)}}} =0.100.40\displaystyle = \frac{\event{0.10}}{\condition{0.40}} =25%\displaystyle = \share{25\%}
4

A theater tracks 200200 moviegoers. Bought Popcorn: 3636 saw a comedy, 8484 saw an action movie, Total 120120. No Popcorn: 2424 saw a comedy, 5656 saw an action movie, Total 8080. Column totals: 6060 Comedy, 140140 Action, Grand Total 200200. Are seeing a comedy and buying popcorn independent? Show the probabilities you compare.

How does the overall percentage of moviegoers who saw a comedy across all 200200 people compare to the percentage who saw a comedy inside the Bought Popcorn row?

Compare the overall probability P(Comedy)\text{P}(\event{\text{Comedy}}) with the conditional probability P(Comedy∣Popcorn)\text{P}(\event{\text{Comedy}} \mid \condition{\text{Popcorn}}). Don't compare the raw counts (36\wrong{36} vs. 24\wrong{24}) and think they are dependent because 36≠24\wrong{36} \neq \wrong{24}, and don't divide 36\event{36} by 200\wrong{200} (18%\wrong{18\%}) instead of the Popcorn row total of 120\condition{120}:
P(Comedy)=60200=30%,P(Comedy∣Popcorn)=36120=30%\displaystyle \begin{aligned}\text{P}(\event{\text{Comedy}}) &= \frac{\event{60}}{\condition{200}} = \share{30\%}, \\[6pt] \text{P}(\event{\text{Comedy}} \mid \condition{\text{Popcorn}}) &= \frac{\event{36}}{\condition{120}} = \share{30\%}\end{aligned}
Because knowing someone bought popcorn leaves the probability of seeing a comedy unchanged at 30%\share{30\%}, the two events are independent (30%\share{30\%}).
5

At an airport, 30%30\% of flights are international and the rest are domestic. Of the international flights, 10%10\% are delayed. Of the domestic flights, 20%20\% are delayed. If you pick a random flight that is delayed, what is the probability it is an international flight?

Start a two-way table with 100100 total flights. Once you split the 100100 flights into international and domestic, how many flights inside each row are delayed?

Out of 100100 flights, 3030 are international (10%10\% of 30=330 = \event{3} delayed, 2727 on time) and 7070 are domestic (20%20\% of 70=1470 = 14 delayed, 5656 on time). Don't take 10%10\% and 20%20\% of 100100 directly (which gives 1010+20≈33.3%\tfrac{\wrong{10}}{\wrong{10 + 20}} \approx \wrong{33.3\%}), and don't divide the 3\event{3} delayed international flights by all 100\wrong{100} flights (which gives 3100=3%\tfrac{\event{3}}{\wrong{100}} = \wrong{3\%}) instead of the 3+14=17\condition{3 + 14} = \condition{17} total delayed flights.
P(International∣Delayed)\displaystyle \text{P}(\event{\text{International}} \mid \condition{\text{Delayed}}) =33+14\displaystyle = \frac{\event{3}}{\condition{3 + 14}} =317≈17.6%\displaystyle = \frac{\event{3}}{\condition{17}} \approx \share{17.6\%}