When we ask a group of people two questions at once, a two-way table organizes their answers into a grid so we can see how the categories overlap and find probabilities.
1
Reading a Two-Way Table
A two-way table splits a group by one question across the rows and a second question down the columns, separating the overlap counts inside the grid from the single-category totals outside on the margins.
Joint and Marginal Frequencies in a Two-Way Table
Adding the inner overlap boxes across any row or down any column gives that category's marginal total, and both the row totals and the column totals add up to the whole room in the bottom-right corner:
When a two-way table gives you only a few entries and leaves the rest blank, how do we find all the missing numbers?
Finding Missing Numbers in a Two-Way Table
Text solution
Fill in the Sport row and Instrument columnThe Sport row is only missing one number, so subtract from the row total of 50 to find the overlap, then add down the Instrument column.
Sport andInstrumentInstrument total=50−35=15=15+12=27
Fill in the Total column and No Sport rowSubtract the 50 sport players from the 80 total students to get the No Sport row total, then subtract across the No Sport row.
No Sport totalNo Sport andNo Instrument=80−50=30=30−12=18
Add the No Instrument column and check the grand totalAdd down the No Instrument column and check that the two column totals add up to 80.
No Instrumenttotal27+53=35+18=53=80
So all nine boxes of the table are filled, with 27 instrument players and 53 non-instrument players totaling 80 students.
3
Conditional Probability: Shrinking the Universe
Now let's use the Coffee and Sleep table to find probabilities, starting with a person picked at random from the whole room and seeing how the fraction changes when we are given a clue about who was picked.
Conditional Probability: Shrinking the Universe
Text solution
Pick from the whole roomWhen anyone in the room can be chosen, the grand total of 100 goes on the bottom of the fraction, and the group we want goes on top.
P(Coffee)=whole roomCoffee row total=10060=60%P(Coffee and Rested)=whole roomoverlap box=10012=12%
Shrink the universe to the Coffee rowOnce we know the person drank coffee, the No Coffee row is crossed out, locking us into the 60 coffee drinkers on the bottom with 12 rested people inside that row on top.
Coffee row totalCoffee and Rested=6012=51=20%
So a person picked from the whole room has a 12% chance of being a rested coffee drinker, while a person we already know drank coffee has a 20% chance of being rested.
4
Swapping the Condition: Row vs. Column Universe
What happens when a question uses the exact same two categories, Coffee and Rested, but swaps which one is the clue we know and which one we are looking for?
Swapping the Condition: Row vs. Column Universe
Text solution
Lock into the Coffee rowWhen the clue is that the person drank coffee, the Coffee row total of 60 goes on the bottom and the overlap box of 12 goes on top.
Rested given Coffee=6012=51=20%
Lock into the Rested columnWhen the clue is that the person is rested, cross out the Tired column so the Rested column total of 30 goes on the bottom while the same overlap box of 12 stays on top.
Coffee given Rested=3012=52=40%
So both questions count the exact same 12 rested coffee drinkers on top, but 12 out of 60 coffee drinkers is 20%, while 12 out of 30 rested people is 40%.
In the Coffee and Sleep table, the overlap of 12 rested coffee drinkers stays on top of the fraction whether we pick from the whole room, the Coffee row, or the Rested column, while the denominator changes to match whichever universe the clue locks us into.
The same 12 rested coffee drinkers stay on top of the fraction, while changing the clue swaps which total goes on the bottom.
5
Conditional Probability Notation and Formula
Instead of writing out a full sentence for a conditional probability, we write a vertical bar ∣ to stand for the word "given."
Conditional Probability Notation and Formula
P(Rested∣Coffee)=?
The vertical bar ∣ is not a division sign; it reads "given" and separates what you are looking for from the clue you already know:
When a problem gives probabilities or percentages of the whole room instead of counts of people, dividing the probability of the overlap by the probability of the condition cancels the out-of-100 parts and gives the same fraction:
P(A∣B)=probability of condition BP(B)P(A and B)probability of the overlap=1006010012=6012
6
Word Problems Without a Table
Sometimes a problem gives you a paragraph of numbers with no table drawn, and we have to decide whether we can build the fraction right away or need to sketch a 2-by-2 grid first.
Conditional Probability Word Problems Without a Table
License:License and Job:70%25%
P(Job∣License)=?
First, here is the high school problem, where 70% of students have a driver's license and 25% have both a driver's license and a part-time job, and we want the probability that a student with a driver's license has a part-time job.
Text solution
Divide the overlap percentage by the given License percentageBecause the problem already gives us the universe after the bar (70% with a license) and the overlap (25% with both), we put them straight into the fraction.
P(Job∣License)=70%25%=0.700.25=7025=145
So a student with a driver's license has a 145 chance of having a part-time job.
Now for the field trip problem: out of 120 students, 70 brought a jacket, 45 brought an umbrella, and 30 brought both, and we want P(Umbrella∣No Jacket).
Text solution
Put the four given numbers into a 2-by-2 grid and subtract to find the No Jacket rowSubtract the 70 students who brought a jacket from the 120 total students to get the No Jacket row total, and subtract the 30 students with both from the 45 students who brought an umbrella to find the overlap.
No Jacket totalNo Jacket andUmbrella=120−70=50=45−30=15
Read the fraction off the No Jacket rowPut the No Jacket row total of 50 on the bottom and the 15 students in that row who brought an umbrella on top.
P(Umbrella∣No Jacket)=5015=103=30%
So 30% of the students who did not bring a jacket brought an umbrella.
7
Testing for Independence on a Two-Way Table
Two categories are independent when knowing that one happened does not change the probability of the other, so we can test for independence on a table by checking whether zooming into a row or column changes the percentage.
Testing for Independence on a Two-Way Table
Text solution
Find the probability in the whole roomOut of all 100 people in the room, 30 are rested.
P(Rested)=10030=30%
Zoom into the Coffee row and compare percentagesInside the Coffee row of 60 people, only 12 are rested.
P(Rested∣Coffee)=6012=20%
same percentage: independentP(A)=P(A∣B)changed percentage: dependentP(A)=P(A∣B)
Because zooming into the Coffee row changes the chance of being rested from 30% to 20%, drinking coffee and being rested are dependent.
With 60 coffee drinkers, 40 non-coffee drinkers, and 30 rested people in the room, how would those 30 rested people have to split between the two rows for the categories to be independent? The row percentage stays at the whole room's 30% only when 30% of the 60 coffee drinkers (18 people) and 30% of the 40 non-coffee drinkers (12 people) are rested.
Zooming into the Coffee row keeps the Rested percentage the same only when the rested people are split in the same ratio as the rows.
Key concepts
For someone picked at random, a probability from a two-way table is the number in the group you want divided by the total number you are picking from. Before you write a fraction, check whether the problem gives you a condition:
No condition given (whole-room universe)
When you pick at random from everyone, the grand total goes on the bottom. In our 100-person room, P(Coffee)=10060=60% uses the margin total, and P(Coffee and Rested)=10012=12% uses the inner overlap box, both over 100. Do not shrink the denominator unless a clue locks you into one group.
Condition given (shrunk universe)
In P(A∣B), read after the vertical bar first. Cross out everything outside B so the total for B goes on the bottom and the overlap of A and B goes on top:
P(Rested∣Coffee)=P(Coffee)P(Rested and Coffee)=6012=20%,whileP(Coffee∣Rested)=3012=40%
Word problems without a table
If the paragraph already gives you P(B) and P(A and B), divide them right away (70%25%=145). If the condition or the group you want is a "not" category missing from the text, like P(Umbrella∣No Jacket), put the four given numbers into a 2-by-2 grid and subtract to find the missing row or column first.
Testing for independence
Compare the probability in the whole room, P(A), with the probability zoomed into one row or column, P(A∣B). If the percentage changes (P(Rested)=30% vs. P(Rested∣Coffee)=20%), the categories are dependent; if the percentage stays the exact same (30% of the 60 coffee drinkers gives 0.30×60=18 rested coffee drinkers), they are independent.
8
Practice
1
A theater surveys 150 moviegoers on whether they bought popcorn and whether they bought a drink. Out of 90 people who bought popcorn, 54 bought a drink and 36 bought no drink. Out of 60 people who bought no popcorn, 26 bought a drink and 34 bought no drink. (a) If you pick one of the 150 surveyed moviegoers at random, what is the probability they bought both popcorn and a drink? (b) If you know the moviegoer bought popcorn, what is the probability they bought a drink?
Don't shrink the bottom to the 90 popcorn buyers yet, which would give 60%.
In (a), who is the total universe you are picking from? In (b), which group does the clue lock you inside?
In (a), we pick from all 150 surveyed moviegoers, with 54 in the overlap box who bought both (don't shrink the bottom to the 90 popcorn buyers yet, which would give 60%). In (b), knowing they bought popcorn locks us into the 90 popcorn buyers on the bottom (don't leave 150 on the bottom to get 36%, or use the 54+26=80 total drink buyers on the bottom to get 67.5%). (a) 15054=259=36%. (b) 9054=53=60%.
2
An animal shelter has 100 dogs grouped by age and coat length. Among 25 puppies, 20 have short hair and 5 have long hair. Among 75 adult dogs, 40 have short hair and 35 have long hair. That makes 60 short-haired dogs and 40 long-haired dogs in total. Find P(Short Hair∣Puppy) and P(Puppy∣Short Hair).
Watch out for putting the grand total of 100 on the bottom to get 20%, or swapping the two denominators to get 6020 and 2520.
Look after the vertical bar first in each question: what is the total for the Puppy group, and what is the total for the Short Hair group?
Both fractions have the same overlap of 20 short-haired puppies on top, and the category after the bar sets the denominator (watch out for putting the grand total of 100 on the bottom to get 20%, or swapping the two denominators to get 6020 and 2520). P(Short Hair∣Puppy)=2520=54=80%, and P(Puppy∣Short Hair)=6020=31≈33.3%.
3
A survey of 90 students asks whether they are in Chorus and whether they are in Band. You are given only four numbers: 40 students are in Chorus in total, 28 are in Chorus and No Band, 18 are in No Chorus and Band, and 90 students were surveyed in all. Fill in the missing table entries to find P(No Band∣No Chorus).
Don't take 4028=70% from the given Chorus numbers without drawing the grid, and don't divide 32 by the grand total of 90 to get 35.6%.
Put the four given numbers into a 2-by-2 grid: how many of the 90 students are in the No Chorus row in total, and how many of that row are in No Band?
In the Total column, the No Chorus row total is 90−40=50, and inside the No Chorus row, No Band is 50−18=32 (don't take 4028=70% from the given Chorus numbers without drawing the grid, and don't divide 32 by the grand total of 90 to get 35.6%). 5032=2516=64%.
4
At an airport, 60% of passengers check a bag, 45% of passengers have a window seat, and 15% of all passengers both check a bag and have a window seat. If you pick a passenger who checked a bag, what is the probability that they have a window seat?
Don't divide by the 45% with a window seat to get 45%15%≈33.3%, since 45% is the group we are asking about, not the given universe.
Which category is the clue you already know about the passenger, and what is the overlap percentage?
The clue we know is that the passenger checked a bag (60%), which goes on the bottom, and the 15% who both checked a bag and have a window seat goes on top (don't divide by the 45% with a window seat to get 45%15%≈33.3%, since 45% is the group we are asking about, not the given universe). 60%15%=6015=41=25%.
5
Out of 140 guests at a hotel, 90 used the pool. 60 guests ate the hotel breakfast, and 42 of those guests also used the pool. If you pick a guest who did NOT eat breakfast, what is the probability that they did NOT use the pool?
Don't use the 48 pool users who didn't eat breakfast on top to get 8048=60%, or subtract the 42 overlap guests from 140 to get 14098=70%.
Put the four numbers into a 2-by-2 grid with Breakfast / No Breakfast and Pool / No Pool, then subtract to fill in the No Breakfast row.
Putting the numbers in a grid gives 140−60=80 guests in the No Breakfast row, 90−42=48 guests in No Breakfast and Pool, and 80−48=32 guests in No Breakfast and No Pool (don't use the 48 pool users who didn't eat breakfast on top to get 8048=60%, or subtract the 42 overlap guests from 140 to get 14098=70%). 8032=52=40%.
6
A survey of 200 commuters records how they get to work and whether they arrive on time. Among 80 train riders, 68 arrive on time and 12 arrive late. Among 120 car drivers, 92 arrive on time and 28 arrive late. In total, 160 commuters arrive on time and 40 arrive late. Based on this table, are taking the train and arriving on time independent or dependent? Show the two probabilities you compare.
Find P(On Time) in the whole group of 200 commuters, then zoom into the 80 train riders to find P(On Time∣Train) and compare the two percentages.
In the whole group, P(On Time)=200160=80%, and zoomed into the Train row, P(On Time∣Train)=8068=85% (don't compare the counts 68 and 92 directly, or divide 68 by the grand total of 200 to get 34%). Because the percentage changes from 80% to 85%, the events are dependent.
7
A school surveys 150 students (90 upperclassmen and 60 underclassmen) on whether they prefer morning or afternoon classes. In total, 60 students prefer morning classes and 90 prefer afternoon classes. If being an upperclassman and preferring morning classes were independent, how many of the 90 upperclassmen would prefer morning classes?
Don't just split the 60 morning-class students in half to get 30, because the two rows have different totals of 90 and 60.
What percentage of the 150 surveyed students prefer morning classes, and what must that percentage be inside the row of 90 upperclassmen if the categories are independent?
In the survey, P(Morning)=15060=40%, so for the categories to be independent, 40% of the 90 upperclassmen must also prefer morning classes: 0.40×90=36 (don't just split the 60 morning-class students in half to get 30, because the two rows have different totals of 90 and 60). 36 upperclassmen.