A contingency table organises data about two features, such as grade and library use. It gives probabilities straight from the counts and is the standard way to test whether two events are independent.
Two-way contingency tables
Rows show one feature, columns another, and the margins show totals.
Example. 120 learners in Grades 10 and 11 were asked whether they use the library.
- Grade 10: yes 24, no 36, total 60
- Grade 11: yes 16, no 44, total 60
- Totals: yes 40, no 80, grand total 120
Read probabilities by dividing by the grand total:
Fill in missing cells using row and column totals first.
Using tables to test independence
Events and are independent if .
Example. Using the table above:
These are not equal, so grade and library use are dependent in this sample.
Finding an unknown for independence. Set up with the unknown in the table and solve.
Key terms
Contingency table
A two-way table of counts for two categorical features.
Marginal total
A row or column total.
Grand total
The total of all the counts in the table.
Common mistakes
Dividing by a row total instead of the grand total.
Testing independence with counts rather than probabilities.
Rounding probabilities before comparing them, which can hide a difference.
Leaving out the conclusion after the calculation.
Practice questions
Reveal steps one at a time, then tick the marks you earned.
Question 1
4 marks total
120 learners were asked whether they use the school library. 60 are in Grade 10 and 60 in Grade 11. 24 Grade 10 learners and 16 Grade 11 learners use the library.
(a) Complete a contingency table with all totals. (3)
(b) Calculate . (1)
Worked solution
Hidden - try the question first
Question 2
5 marks total
Use the table from Question 1. Are being in Grade 10 and using the library independent events? Show all calculations.
Worked solution
Hidden - try the question first
Question 3
6 marks total
A café records drink orders:
- Male: coffee , tea 30
- Female: coffee 40, tea 60
Determine the value of for which being male and ordering coffee are independent events.
Worked solution
Hidden - try the question first
Question 4
8 marks total
An insurer studied 200 drivers. 30% of the drivers had an accident in the past year. 60 of the drivers are under 25, and 27 of them had an accident.
(a) Draw a contingency table. (3)
(b) Calculate . (1)
(c) Is having an accident independent of being under 25? Show calculations. (3)
(d) What would you advise the insurer? (1)
Worked solution
Hidden - try the question first
FAQs
How do I test independence with a contingency table?
Calculate and from the totals, multiply them, and compare with from the cell.
Which total do I divide by?
Divide by the grand total for probabilities of events in the whole group.
Do I need to write a conclusion?
Yes. State whether the events are independent or dependent, and why.