Think First

In your class, some students play sport AND music, some play only one, and some play neither. How would you organise this information in a table so it's easy to count each combination?

Two-Way Tables

A two-way table is a powerful tool for organising data about two categorical variables at once. Each cell counts how many people or items fall into both categories. Totals in the margins reveal the full picture.

Music No Music Total Sport No Sport Total 35 45 80 25 15 40 60 60 120

What You'll Master

  • Read and interpret a two-way table to find joint, marginal, and conditional frequencies
  • Complete a two-way table when some cells are missing, using row and column totals
  • Calculate relative frequencies as fractions and percentages
  • Find conditional probabilities from a two-way table (e.g. given plays sport, find P(also plays music))
  • Describe patterns and draw conclusions from two-way table data

Words You Need

Two-Way TableA table that cross-classifies data across two categorical variables simultaneously
Row TotalThe sum of all cells in a single row — shown in the margin on the right
Column TotalThe sum of all cells in a single column — shown in the margin at the bottom
Grand TotalThe total of all values in the table — appears in the bottom-right corner
Joint FrequencyA cell count — the number meeting both conditions (e.g. Sport AND Music)
Marginal FrequencyA row or column total — the count for one category regardless of the other
Relative FrequencyA count expressed as a fraction or percentage of the total

⚠ Spot the Trap

Every row total must equal the sum of its cells. Every column total must equal the sum of its cells. And the grand total must equal both the sum of all row totals AND the sum of all column totals. If these don't match, you have made an error somewhere. Always check: row totals + column totals = grand total.

Structure of a Two-Way Table

Rows represent one categorical variable (e.g. Sport / No Sport). Columns represent another (e.g. Music / No Music). Each cell holds the count of people who belong to both categories.

  • The margins (edges) show totals for each row and column
  • Row total = sum of all cells in that row
  • Column total = sum of all cells in that column
  • Grand total = sum of all row totals = sum of all column totals

The grand total always equals the total number of people surveyed. Use it as your denominator when calculating relative frequencies.

Reading a Two-Way Table — Worked Example

120 students were surveyed about sport and music participation:

MusicNo MusicRow Total
Sport354580
No Sport251540
Col Total6060120

From the table: 35 students play both sport AND music. 80 students play sport (regardless of music). 60 students play music (regardless of sport). Grand total = 120.

Calculating Relative Frequencies

Relative frequency = $\dfrac{\text{count}}{\text{grand total}}$, expressed as a fraction, decimal, or percentage.

From our table (grand total = 120):

  • $P(\text{Sport AND Music}) = \dfrac{35}{120} \approx 0.292 = 29.2\%$
  • $P(\text{Sport}) = \dfrac{80}{120} \approx 0.667 = 66.7\%$
  • $P(\text{Music}) = \dfrac{60}{120} = 0.5 = 50\%$
  • $P(\text{Neither}) = \dfrac{15}{120} = 0.125 = 12.5\%$

Row Percentages — Conditional Distributions

Sometimes we want to compare within a row. This gives a conditional distribution — the percentage breakdown for people who share one characteristic.

Of those who play sport (row total = 80):

$P(\text{Music} \mid \text{Sport}) = \dfrac{35}{80} = 43.75\%$

Of those who do NOT play sport (row total = 40):

$P(\text{Music} \mid \text{No Sport}) = \dfrac{25}{40} = 62.5\%$

Interesting! Students who don't play sport are more likely to play music than those who do. This is the kind of insight two-way tables reveal.

Common Pitfalls

  • Using the wrong denominator — for conditional probability, use the row or column total, not the grand total
  • Forgetting to check that row totals and column totals both sum to the grand total
  • Reading the wrong cell — make sure you identify both the row and column for the cell you want
  • Confusing joint frequency (a cell) with marginal frequency (a row/column total)

Copy This Into Your Book

Two-Way Table — key formulas:

$$\text{Relative frequency} = \frac{\text{cell count}}{\text{grand total}}$$

$$P(A \mid B) = \frac{\text{count of A and B}}{\text{row total for B}} \quad \text{(conditional — within a row)}$$

Check: all row totals sum to grand total. All column totals sum to grand total.

Using the Sport/Music table (Sport+Music=35, Sport+No Music=45, No Sport+Music=25, No Sport+No Music=15, Grand Total=120): How many students play sport but NOT music?

Using the same table: What is the row total for students who play sport?

What is the relative frequency of students who play both sport and music (to the nearest percent)?

Given that a student plays sport, what is the probability they also play music?

A two-way table has: No Sport row total = 40; No Sport + No Music = 15. What value belongs in the No Sport + Music cell?

Q6. Complete the two-way table below, then find one relative frequency.

80 students were asked if they have a pet (Yes/No) and if they prefer cats or dogs.
Pets+Cats = 18, Pets+Dogs = 27, No Pets+Dogs = 15, No Pets column total = 35, Grand Total = 80.

(a) Find the missing values to complete the table.
(b) Calculate P(has a pet AND prefers cats) as a percentage.

Q7. A two-way table shows 150 students surveyed about screen time and sleep:
High Screen + Good Sleep = 12, High Screen + Poor Sleep = 48, Low Screen + Good Sleep = 54, Low Screen + Poor Sleep = 36.

(a) Find P(High Screen AND Poor Sleep).
(b) Find P(Low Screen only — regardless of sleep).
(c) Find P(neither High Screen nor Poor Sleep) — i.e. P(Low Screen AND Good Sleep).

Q8. 200 students were surveyed on handedness (Left/Right) and preferred hand for sport.
Right-handed + Right sport = 140, Right-handed + Left sport = 20, Left-handed + Right sport = 10, Left-handed + Left sport = 30.

(a) Calculate all four row percentages (within each handedness group).
(b) Comment on any pattern you notice — is handedness linked to sport preference in this data?

Show Answers

Q6

No Pets total = 35; No Pets+Dogs = 15; so No Pets+Cats = 35 − 15 = 20.
Pets total = 80 − 35 = 45; Pets+Dogs = 27; Pets+Cats = 18 ✓ (18+27=45).
Cats total = 18+20 = 38. Dogs total = 27+15 = 42.
P(Pets AND Cats) = 18/80 = 22.5%.

Q7

Grand total = 12+48+54+36 = 150.
(a) P(High Screen AND Poor Sleep) = 48/150 = 32%.
(b) Low Screen total = 54+36 = 90; P(Low Screen) = 90/150 = 60%.
(c) P(Low Screen AND Good Sleep) = 54/150 = 36%.

Q8

Right-handed total = 160; row %: Right sport = 140/160 = 87.5%, Left sport = 20/160 = 12.5%.
Left-handed total = 40; row %: Right sport = 10/40 = 25%, Left sport = 30/40 = 75%.
Pattern: Right-handed students strongly prefer their right hand for sport (87.5%), while left-handed students strongly prefer their left hand for sport (75%). Handedness appears strongly linked to sport hand preference.

Stretch Challenge

200 people were surveyed on car ownership and public transport use.
PT + Car = 40, PT + No Car = 80, No PT + Car = 60, No PT + No Car = 20.

(a) Construct the complete two-way table with all row totals, column totals, and grand total.
(b) Find P(uses PT | has a car) — the conditional probability. Use the correct denominator.
(c) Find P(uses PT | no car) — conditional on having no car.
(d) Does having a car make someone less likely to use public transport? Justify your answer using the probabilities you calculated.

Rows = one variable; Columns = another
Cell = count for BOTH conditions
Row total + column total = grand total
Relative freq = cell ÷ grand total
Conditional = cell ÷ row/col total
Always verify: totals sum correctly

Badges This Lesson

Table Titan
Row Ranger
Column Commander
Relative Frequency Finder
Conditional Calculator
Data Organiser
← Previous Lesson 12 of 20 Next →