Two-way tables and conditional probability
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.
Two variables, one table
- A two-way table counts two things at once.
- Here: a part-time job, and passing all externals.
- 250 Year 12 students.
| Passed all | Did not | Total | |
|---|---|---|---|
| Part-time job | 54 | 36 | 90 |
| No job | 120 | 40 | 160 |
| Total | 174 | 76 | 250 |
Read the totals first
- Rows, then columns.
- Both must reach 250.
- job: 54 + 36 = 90row total
- no job: 120 + 40 = 160row total
- passed: 54 + 120 = 174column total
- did not: 36 + 40 = 76column total
- rows: 90 + 160 = 250grand total
- columns: 174 + 76 = 250consistent
Plain probabilities: out of everyone
- No condition: ÷ 250.
- "And" is a single cell.
- P(pass) = 174 ÷ 250out of everyone
- = 0.696
- P(job and pass) = 54 ÷ 250one cell
- = 0.216
- P(no job) = 160 ÷ 250a row total
- = 0.64
"Given" changes the total
- "Given a job" means: only look at the job row.
- The total becomes 90, not 250.
- P(pass | job) = 54 ÷ 90 = 0.6.
| Passed all | Did not | Total | |
|---|---|---|---|
| Part-time job | 54 | 36 | 90 |
| No job | 120 | 40 | 160 |
| Total | 174 | 76 | 250 |
Compare the two groups
- Each row, its own total.
- No job: passed more often.
- P(pass | job) = 54 ÷ 90job row: 90
- = 0.6
- P(pass | no job) = 120 ÷ 160
- = 0.75no-job row: 160
The reverse is a different question
- Only the pass column.
- Not 0.6: order matters.
- P(job | pass) = 54 ÷ 174pass column: 174
- = 0.31034…calculator
- = 0.31034 d.p.
- P(job | pass) ≠ P(pass | job)
Saying it in words
- 0.6: of the students with a job, 60% passed.
- 0.3103: of those who passed, 31% had a job.
- Different groups, different stories.
Finding the right total
- Underline the word after "given".
- That names the row or column you are in.
- Its total is your denominator.
What the table cannot say
- It shows passing and jobs are linked.
- It does not show a job causes failing.
- Other factors could explain both.
Where the marks are
- Achieved: probabilities from the table.
- Merit: conditional probabilities, chosen correctly.
- Excellence: interpreting them in context.
What to take away
- "Given" picks the total.
| No condition | divide by the grand total |
| "and" | one cell ÷ grand total |
| "given" | the given row or column total |
| Order matters | P(A | B) ≠ P(B | A) |
| Check | row and column totals agree |
Your turn: four questions
- Draw the two-way table first.
- Pause here and answer each one.
- Underline "given" in 2, 3 and 4.
| Question | |
|---|---|
| Data | Coffee: 72 poor, 108 good sleep. None: 24 poor, 96 good. |
| 1 | P(a randomly chosen adult sleeps poorly)? |
| 2 | P(sleeps poorly | drinks coffee)? |
| 3 | P(drinks coffee | sleeps poorly)? |
| 4 | P(sleeps well | no coffee)? |
Show answer
1. (72 + 24) ÷ 300 = 0.32. 2. 72 ÷ 180 = 0.4. 3. 72 ÷ 96 = 0.75. 4. 96 ÷ 120 = 0.8.
The answers: questions 1 and 2
- coffee: 72 + 108 = 180row total
- no coffee: 24 + 96 = 120row total
- poorly: 72 + 24 = 96column total
- check: 180 + 120 = 300grand total
- 1. P(poorly) = 96 ÷ 300out of everyone
- = 0.32
- 2. P(poorly | coffee) = 72 ÷ 180coffee row
- = 0.4
The answers: questions 3 and 4
- 3. P(coffee | poorly) = 72 ÷ 96poorly column
- = 0.75
- 4. P(well | no coffee) = 96 ÷ 120no-coffee row
- = 0.8
Is your child on track?
Take the free placement test