NCEA Level 2Two-way tablesAS 91267

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.
Key idea

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 allDid notTotal
Part-time job543690
No job12040160
Total17476250
Worked example

Read the totals first

  • Rows, then columns.
  • Both must reach 250.
  1. job: 54 + 36 = 90row total
  2. no job: 120 + 40 = 160row total
  3. passed: 54 + 120 = 174column total
  4. did not: 36 + 40 = 76column total
  5. rows: 90 + 160 = 250grand total
  6. columns: 174 + 76 = 250consistent
Worked example

Plain probabilities: out of everyone

  • No condition: ÷ 250.
  • "And" is a single cell.
  1. P(pass) = 174 ÷ 250out of everyone
  2. = 0.696
  3. P(job and pass) = 54 ÷ 250one cell
  4. = 0.216
  5. P(no job) = 160 ÷ 250a row total
  6. = 0.64
Key idea

"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 allDid notTotal
Part-time job543690
No job12040160
Total17476250
Worked example

Compare the two groups

  • Each row, its own total.
  • No job: passed more often.
  1. P(pass | job) = 54 ÷ 90job row: 90
  2. = 0.6
  3. P(pass | no job) = 120 ÷ 160
  4. = 0.75no-job row: 160
Worked example

The reverse is a different question

  • Only the pass column.
  • Not 0.6: order matters.
  1. P(job | pass) = 54 ÷ 174pass column: 174
  2. = 0.31034…calculator
  3. = 0.31034 d.p.
  4. P(job | pass) ≠ P(pass | job)
Key idea

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.
Key idea

Finding the right total

  • Underline the word after "given".
  • That names the row or column you are in.
  • Its total is your denominator.
Key idea

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.
Key idea

Where the marks are

  • Achieved: probabilities from the table.
  • Merit: conditional probabilities, chosen correctly.
  • Excellence: interpreting them in context.
Summary

What to take away

  • "Given" picks the total.
No conditiondivide by the grand total
"and"one cell ÷ grand total
"given"the given row or column total
Order mattersP(A | B) ≠ P(B | A)
Checkrow and column totals agree
Your turn

Your turn: four questions

  • Draw the two-way table first.
  • Pause here and answer each one.
  • Underline "given" in 2, 3 and 4.
Question
DataCoffee: 72 poor, 108 good sleep. None: 24 poor, 96 good.
1P(a randomly chosen adult sleeps poorly)?
2P(sleeps poorly | drinks coffee)?
3P(drinks coffee | sleeps poorly)?
4P(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.

Worked example

The answers: questions 1 and 2

  1. coffee: 72 + 108 = 180row total
  2. no coffee: 24 + 96 = 120row total
  3. poorly: 72 + 24 = 96column total
  4. check: 180 + 120 = 300grand total
  5. 1. P(poorly) = 96 ÷ 300out of everyone
  6. = 0.32
  7. 2. P(poorly | coffee) = 72 ÷ 180coffee row
  8. = 0.4
Worked example

The answers: questions 3 and 4

  1. 3. P(coffee | poorly) = 72 ÷ 96poorly column
  2. = 0.75
  3. 4. P(well | no coffee) = 96 ÷ 120no-coffee row
  4. = 0.8

Is your child on track?

Take the free placement test