Two-way tables: 7 exam questions solved step by step
What this lesson covers
- A conditional probability restricts attention to one row or column of the table.
- P(A given B) and P(B given A) use different totals and are usually different.
Reading a two-way table
- Check the totals first.
- No condition: divide by the grand total.
- "Given": divide by that row or column total.
- Given percentages? Turn them into counts.
Question 1 · Achieved, in context
- A Cook Strait ferry survey of 200 passengers.
- Find P(seasick), and
- P(sat outside and was not seasick).
| Seasick | Not seasick | Total | |
|---|---|---|---|
| Inside | 18 | 102 | 120 |
| Outside | 8 | 72 | 80 |
| Total | 26 | 174 | 200 |
Q1: out of everyone
- No condition: ÷ 200.
- "And" is one cell.
- 120 + 80 = 26 + 174 = 200totals agree
- P(seasick) = 26 ÷ 200column total
- = 0.13
- P(outside and not seasick)
- = 72 ÷ 200one cell
- = 0.36
Question 2 · Achieved, in context
- The same ferry survey.
- A passenger who sat inside is chosen.
- Find P(seasick | inside).
| Seasick | Not seasick | Total | |
|---|---|---|---|
| Inside | 18 | 102 | 120 |
| Outside | 8 | 72 | 80 |
| Total | 26 | 174 | 200 |
Q2: given inside
- "Given inside": that row.
- The total becomes 120.
- inside row: 18 + 102 = 120reduced total
- P(seasick | inside) = 18 ÷ 120
- = 0.15
- 18 ÷ 200 = 0.09wrong total
- of those inside, 15% seasick
Try it: given inside the table
Question 3 · Merit, in context
- The same survey. A seasick passenger
- Is chosen. Find P(inside | seasick).
- Is it the same as P(seasick | inside)?
| Seasick | Not seasick | Total | |
|---|---|---|---|
| Inside | 18 | 102 | 120 |
| Outside | 8 | 72 | 80 |
| Total | 26 | 174 | 200 |
Q3: the other way round
- "Given seasick": a column.
- Order matters.
- seasick column: 18 + 8 = 26reduced total
- P(inside | seasick) = 18 ÷ 26
- = 0.69230…calculator
- = 0.69234 d.p.
- P(seasick | inside) = 0.15
- 0.6923 ≠ 0.15different totals
- of the seasick, 69% sat inside
Question 4 · Merit, in context
- A packhouse sorts 400 trays of avocados.
- 60% come from Orchard A.
- 5% of Orchard A's trays are rejected.
- 30 trays are rejected altogether.
- Complete the table. Pause and try it.
| Rejected | Passed | Total | |
|---|---|---|---|
| Orchard A | ? | ? | ? |
| Orchard B | ? | ? | ? |
| Total | 30 | ? | 400 |
Q4: complete the table
- Percentages to counts.
- Then subtract to fill gaps.
- A: 60% of 400 = 240
- B: 400 − 240 = 160
- A rejected: 5% of 240 = 12
- 5% of 400 = 205% of A only
- A passed: 240 − 12 = 228
- B rejected: 30 − 12 = 18
- B passed: 160 − 18 = 142
- passed: 400 − 30 = 370
- check: 228 + 142 = 370
Question 5 · Merit, in context
- The completed packhouse table.
- Find P(rejected | Orchard B).
- Compare with Orchard A in a sentence.
| Rejected | Passed | Total | |
|---|---|---|---|
| Orchard A | 12 | 228 | 240 |
| Orchard B | 18 | 142 | 160 |
| Total | 30 | 370 | 400 |
Q5: compare the orchards
- Each orchard, its own row.
- Answer in a sentence.
- P(rej | B) = 18 ÷ 160B row: 160
- = 0.1125
- P(rej | A) = 12 ÷ 240A row: 240
- = 0.05
- 0.1125 ÷ 0.05 = 2.25
- B: 2.25 times as likely
- P(B | rej) = 18 ÷ 30 = 0.6a different question
Try it: compare the groups
Question 6 · Excellence, in context
- A survey of 600 workers.
- 40% had the flu jab; 10% of those got flu.
- 22% of all the workers got flu.
- Find P(had the jab | got flu).
| Flu | No flu | Total | |
|---|---|---|---|
| Jab | ? | ? | ? |
| No jab | ? | ? | ? |
| Total | ? | ? | 600 |
Q6: build the table
- Every % to a count.
- Subtract to fill the rest.
- jab: 40% of 600 = 240
- jab and flu: 10% of 240 = 24
- flu: 22% of 600 = 132
- no jab: 600 − 240 = 360
- no jab and flu: 132 − 24 = 108
- jab, no flu: 240 − 24 = 216
- no jab, no flu: 360 − 108 = 252
- check: 216 + 252 = 468 = 600 − 132
Q6: given flu
- "Given flu": the flu column.
- Not the 10%.
- flu column total = 132reduced total
- P(jab | flu) = 24 ÷ 132
- = 0.181818…calculator
- = 0.18184 d.p.
- P(jab | flu) = 0.1that is P(flu | jab)
- P(flu | no jab) = 108 ÷ 360 = 0.3
- about 18% of flu cases had a jab
Question 7 · Excellence, in context
- A survey of 300 Year 12 students.
- Claim: "80% of late students had a phone
- In their room, so a phone in your room
- Makes you 80% likely to be late."
- Evaluate the claim. Pause and try it.
| Late | Not late | Total | |
|---|---|---|---|
| Phone in room | 60 | 140 | 200 |
| No phone | 15 | 85 | 100 |
| Total | 75 | 225 | 300 |
Q7: test the claim
- Work out both directions.
- Then compare the rows.
- P(phone | late) = 60 ÷ 75late column
- = 0.8the 80% is right
- P(late | phone) = 60 ÷ 200phone row
- = 0.3
- claim: P(late | phone) = 0.8swaps the order
- P(late | no phone) = 15 ÷ 100
- = 0.15
- 0.3 ÷ 0.15 = 2twice as likely
- linked, but not shown to cause
Try it: build, compare and flip
Common mistakes
- P(seasick | inside) = 18 ÷ 200 = 0.09"Given inside" means only the inside row, so divide by its total: 18 ÷ 120 = 0.15.
- P(jab | flu) = 0.1, because 10% of those with the jab got flu.0.1 is P(flu | jab). P(jab | flu) uses the flu column total: 24 ÷ 132 = 0.1818.
- Orchard A rejected = 5% of 400 = 20 traysThe 5% is of Orchard A's trays only: 5% of 240 = 12.
- 80% of late students had a phone in their room, so a phone makes you 80% likely to be late.That swaps the order: P(late | phone) = 60 ÷ 200 = 0.3, twice the 0.15 without a phone, and a survey cannot show cause.
The method that solved all seven
- "Given" picks the total; then say it in words.
| Step | How |
|---|---|
| No condition | divide by the grand total |
| "and" | one cell ÷ grand total |
| "given" | that row or column total |
| Order | P(A | B) ≠ P(B | A) |
| Percentages | turn them into counts first |
| In words | name the group, then compare |
Challenge
A Bay of Plenty orchard tests its kiwifruit vines for the vine disease Psa. 4% of the vines are infected. The test is positive for 90% of infected vines, but also for 5% of healthy vines. A vine tests positive. What is the probability it is really infected? A grower says "the test is 90% accurate, so a positive vine is 90% likely to be infected". Explain the error.
Hint
Imagine 5000 vines and build a two-way table: infected or healthy, against positive or negative. Then use the positive column.
Answer
P(infected given positive) = 180 ÷ 420 = 0.4286, about 43%. The 90% is P(positive given infected), the other way round. Healthy vines are so common that their 5% false positives (240) outnumber the true positives (180).
Step by step
- Take 5000 vines. 4% infected is 200 vines, so 4800 are healthy.
- 90% of the 200 infected test positive: 180. 5% of the 4800 healthy test positive: 240.
- So 180 + 240 = 420 vines test positive altogether.
- Given positive means use the positive column: 180 of those 420 are infected, 0.4286.
- The grower has swapped the condition: 90% is the chance of a positive given infected, not infected given positive.
Full working
- infected: 4% of 5000 = 200; healthy: 5000 − 200 = 4800row totals
- infected and positive: 90% of 200 = 180infected row
- healthy and positive: 5% of 4800 = 240healthy row
- positive column total: 180 + 240 = 420reduced total
- P(infected given positive) = 180 ÷ 420 = 0.428571…positive column
- = 0.42864 d.p.
- 0.9 is P(positive given infected)the order is swapped
- P(infected given positive) = 0.4286, about 43%, not 90%
At a Hamilton school, 48 Year 9 students catch the bus. Of all Year 9 students, 40% catch the bus. Of all the bus riders, 25% are in Year 9. Of the students not in Year 9, 30% catch the bus. How many students are at the school, and what is the probability that a student who does not catch the bus is in Year 9?
Hint
The 48 sits in one cell. Each percentage is that cell, or another cell, divided by a row or column total. Work out which total each one uses.
Answer
600 students. P(Year 9 given no bus) = 72 ÷ 408 = 317 ≈ 0.1765.
Step by step
- 40% of Year 9 students catch the bus and that is 48 students, so there are 48 ÷ 0.4 = 120 Year 9 students.
- 25% of bus riders are Year 9 and that is 48, so there are 48 ÷ 0.25 = 192 bus riders.
- So 192 − 48 = 144 bus riders are not in Year 9, and they are 30% of the non Year 9 students: 144 ÷ 0.3 = 480.
- Total: 120 + 480 = 600 students. Not on the bus: 600 − 192 = 408, of whom 120 − 48 = 72 are Year 9.
- Given no bus means the no-bus column: 72 ÷ 408 = 0.1765.
Full working
- Year 9 total = 48 ÷ 0.4 = 120P(bus given Year 9) = 0.4
- bus total = 48 ÷ 0.25 = 192P(Year 9 given bus) = 0.25
- bus, not Year 9 = 192 − 48 = 144bus column
- not Year 9 total = 144 ÷ 0.3 = 480P(bus given not Year 9) = 0.3
- school = 120 + 480 = 600grand total
- no bus = 600 − 192 = 408; Year 9, no bus = 120 − 48 = 72subtract
- P(Year 9 given no bus) = 72 ÷ 408 = 0.176470…no-bus column
- 600 students; P(Year 9 given no bus) = 317 ≈ 0.1765
A survey asked Year 12 students whether they ate breakfast and whether they felt tired in period 1. The table has one unknown, x, which appears twice. Ate breakfast: x tired, 100 not tired. No breakfast: 20 tired, x not tired. Surprisingly, students who ate breakfast were 3 times as likely to be tired as those who skipped it. Find x, then find P(ate breakfast given tired).
Hint
Write P(tired given ate breakfast) and P(tired given no breakfast) using x, each with its own row total. Set one equal to 3 times the other and solve the quadratic. Can a count be negative?
Answer
x = 100. P(ate breakfast given tired) = 100 ÷ 120 = 56 ≈ 0.8333.
Step by step
- The breakfast row total is x + 100 and the no-breakfast row total is x + 20.
- P(tired given breakfast) = x ÷ (x + 100) and P(tired given no breakfast) = 20 ÷ (x + 20).
- The first is 3 times the second, so cross-multiplying gives x(x + 20) = 60(x + 100).
- That is x² − 40x − 6000 = 0, which factorises to (x − 100)(x + 60) = 0. A count cannot be −60, so x = 100.
- The tired column is 100 + 20 = 120, so P(ate breakfast given tired) = 100 ÷ 120 = 0.8333.
Full working
- P(tired given breakfast) = x ÷ (x + 100)breakfast row
- P(tired given no breakfast) = 20 ÷ (x + 20)no-breakfast row
- x ÷ (x + 100) = 3 × 20 ÷ (x + 20)3 times as likely
- x(x + 20) = 60(x + 100)cross-multiply
- x² + 20x = 60x + 6000, so x² − 40x − 6000 = 0collect
- (x − 100)(x + 60) = 0−100 × 60 = −6000, −100 + 60 = −40
- x = 100 (x = −60 rejected)counts are not negative
- check: 100 ÷ 200 = 0.5 and 20 ÷ 120 = 16; 0.5 = 3 × 16holds
- tired column = 100 + 20 = 120reduced total
- x = 100; P(ate breakfast given tired) = 100 ÷ 120 = 56 ≈ 0.8333
Practise this
Report a mistake
More in AS 91267
Probability: when to add and when to multiply7 min
Two-way tables and conditional probability6 min
Probability trees from written information, forwards and backwards8 min
Expected value and expected numbers7 min
Relative risk: above 1, below 1, and evaluating a claim7 min
The normal distribution: probabilities and z-values8 min
Inverse normal: finding a value, the mean or the standard deviation8 min
Comparing distributions: shape, centre and spread7 min
Probability rules: 7 exam questions solved step by step10 min
Two-way tables: 7 exam questions solved step by step10 min
Probability trees: 7 exam questions solved step by step10 min
Expected value: 7 exam questions solved step by step10 min
Relative risk: 7 exam questions solved step by step9 min
Normal distribution: 7 exam questions solved step by step10 min
Inverse normal: 7 exam questions solved step by step10 min
Comparing distributions: 7 exam questions solved step by step10 minIs your child on track?
Take the free placement test