Two-Way Tables

Two questions at once, and margins that agree.

Two questions about the same people

Fourteen children answer two questions: are you a girl or a boy, and do you walk to school or ride? A two-way table records both answers at once. It has a row for each answer to the first question and a column for each answer to the second.

Each child belongs in exactly one cell, the one where their row meets their column. A girl who walks is counted in the girls row and the walk column. The table shows that 5 girls walk, 3 girls ride, 4 boys walk and 2 boys ride. Each cell counts one combination of answers.

walkridegirls53boys42

The cell where the girls row meets the walk column holds 5: five children are girls who walk.

Totals along the rows and down the columns

Add along a row to count everyone who gave that answer to the first question. The girls row holds 5 + 3 = 8 girls, and the boys row holds 4 + 2 = 6 boys. Each row total is written at the end of its row.

Add down a column in the same way to count everyone who gave that answer to the second question. The walk column holds 5 + 4 = 9 children who walk, and the ride column holds 3 + 2 = 5 who ride. Each column total is written at the foot of its column.

walkridetotalgirls538boys426total9514

The girls row totals 5 + 3 = 8. The columns total downward: 5 + 4 = 9 walk and 3 + 2 = 5 ride.

The grand total

The corner where the totals row meets the totals column holds the grand total: everyone in the table. Add the row totals, 8 + 6 = 14, or add the column totals, 9 + 5 = 14. The two ways must agree, because each one counts every child exactly once.

This is a check on the whole table. If the row totals and the column totals add up to different numbers, a cell or a total has been miscounted.

walkridetotalgirls538boys426total9514

The corner holds 14: the row totals give 8 + 6 = 14 and the column totals give 9 + 5 = 14.

Finding a missing cell

The cells in a row add up to the row total, so a single missing cell is the row total minus the cells you can see. Suppose the number of boys who walk is hidden. The boys row totals 6 and 2 boys ride, so 6 − 2 = 4 boys walk.

The column gives a second way to the same cell: 9 children walk and 5 of them are girls, so 9 − 5 = 4. When both ways give the same number, the cell is right.

walkridetotalgirls538boys?26total9514

The boys row totals 6 and 2 boys ride, so the hidden cell is 6 − 2 = 4.

Completing a table from a few facts

A question often gives only some of the numbers. Suppose you are told that 14 children were asked, that 8 are girls, that 9 walk, and that 5 girls walk. Five of the nine numbers in the table, cells and totals together, are missing.

Look for a row or a column with only one gap, and fill it by subtraction. The girls row has one gap: 8 − 5 = 3 girls ride. The totals column has one gap: 14 − 8 = 6 boys. The walk column has one gap: 9 − 5 = 4 boys walk. Now the boys row has one gap: 6 − 4 = 2 boys ride. Last, the ride column totals 3 + 2 = 5.

Each number you find can leave another row or column with only one gap, so keep going until the table is full, then check the grand total both ways: 8 + 6 = 14 and 9 + 5 = 14. A row with two gaps cannot be filled yet; come back to it once a column has filled one of them.

A proportion within a row

A two-way table answers questions about part of a group. What fraction of the girls walk? The whole is now the girls, not all 14 children, so divide by the girls row total: 5/8 = 62.5% of the girls walk.

Of the boys, 4/6 = 2/3 ≈ 66.7% walk. More girls than boys walk, 5 against 4, but a larger share of the boys walk, because there are fewer boys. To compare two groups of different sizes, compare their proportions, not their counts.

Read the question to find its whole. “What fraction of the children who walk are girls?” takes the walk column total as the whole: 5/9. “What fraction of all the children are girls who walk?” takes the grand total: 5/14.

Worked example: Museum Visitors in a Two-Way Table with Five Missing Cells, and a Proportion Within a Row

Question A museum sorted the 150 visitors of one morning by where they live, local or tourist, and by the guide they took: an audio guide, a paper guide or no guide. 90 of the visitors were tourists. Of the local visitors, 18 took an audio guide and 30 took no guide. 24 tourists took a paper guide. In total, 63 visitors took an audio guide. (a) Complete the two-way table and find how many tourists took no guide. (b) What percentage of the local visitors took an audio guide? Compare it with the percentage of the tourists who did.

  1. 1.Begin with the Total column, which has one gap. The local visitors are 150 − 90 = 60.

    AudioPaperNoneTotalLocal18?3060Tourist?24?90Total63??150Local total: 150 − 90 = 60
    AudioPaperNoneTotalLocal18?3060Tourist?24?90Total63??150Local total: 150 − 90 = 60
    The Total column has one gap: 150 − 90 = 60 local visitors.
  2. 2.The Local row now has one gap: 60 − 18 − 30 = 12 local visitors took a paper guide. The Audio column has one gap: 63 − 18 = 45 tourists took an audio guide.

    AudioPaperNoneTotalLocal18123060Tourist4524?90Total63??150Local row: 60 − 18 − 30 = 12Audio column: 63 − 18 = 45
    AudioPaperNoneTotalLocal18123060Tourist4524?90Total63??150Local row: 60 − 18 − 30 = 12Audio column: 63 − 18 = 45
    The Local row and the Audio column each have one gap now: 60 − 18 − 30 = 12 and 63 − 18 = 45.
  3. 3.The Tourist row now has one gap: 90 − 45 − 24 = 21. The column totals follow: 12 + 24 = 36 paper guides, and 30 + 21 = 51 visitors with no guide.

    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Tourist row: 90 − 45 − 24 = 2112 + 24 = 36 and 30 + 21 = 51
    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Tourist row: 90 − 45 − 24 = 2112 + 24 = 36 and 30 + 21 = 51
    The Tourist row has one gap: 90 − 45 − 24 = 21. Then the column totals are 36 and 51.
  4. 4.(a) 21 tourists took no guide. Check with the Total row: 63 + 36 + 51 = 150.

    AudioPaperNoneTotalLocal18123060Tourist45242190Total63365115021 tourists took no guideTotal row: 63 + 36 + 51 = 150
    AudioPaperNoneTotalLocal18123060Tourist45242190Total63365115021 tourists took no guideTotal row: 63 + 36 + 51 = 150
    (a) 21 tourists took no guide. The Total row agrees: 63 + 36 + 51 = 150.
  5. 5.For the local visitors, the whole is the Local row total, 60. 1860 = 30% of the local visitors took an audio guide. For the tourists, the whole is 90, and 4590 = 50% took one.

    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Local: 18/60 = 30%Tourist: 45/90 = 50%
    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Local: 18/60 = 30%Tourist: 45/90 = 50%
    Each percentage is taken out of its own row total: 1860 = 30% and 4590 = 50%.
  6. 6.(b) 30% of the local visitors took an audio guide, compared with 50% of the tourists, so a tourist was more likely to take one.

    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Local: 18/60 = 30%Tourist: 45/90 = 50%
    AudioPaperNoneTotalLocal18123060Tourist45242190Total633651150Local: 18/60 = 30%Tourist: 45/90 = 50%
    (b) 30% of the local visitors took an audio guide, compared with 50% of the tourists.

Answer: (a) 21 tourists took no guide; (b) 30% of the local visitors, compared with 50% of the tourists

Common mistakes

  • Dividing the 18 local visitors by 150, which gives 12%. That is the percentage of all the visitors who were local and took an audio guide. The question asks about the local visitors only, so the whole is 60.
  • Trying to fill the Tourist row first. That row starts with two empty cells, so it cannot be found by one subtraction. Fill the rows and columns that have one gap, and the Tourist row is left with one gap after the Audio column is done.

More statistical displays problems, worked step by step →

Two yes-or-no questions

Thirty students are asked two questions: do you have a cat, and do you have a dog? Each answer is yes or no, so the table has four cells: a cat and a dog, a cat only, a dog only, and neither. You are told that 12 have a cat, 10 have a dog and 14 have neither.

Fill it as before. The no-cat row holds 30 − 12 = 18 students, and 14 of them have neither pet, so 18 − 14 = 4 have a dog but no cat. The dog column holds 10, so 10 − 4 = 6 have both a cat and a dog. Then 12 − 6 = 6 have a cat only.

There is a quicker way to the students with both. The students with at least one pet are 30 − 14 = 16. Adding the cat total and the dog total gives 12 + 10 = 22, which is 6 more than 16, because the 6 students with both are in the cat row and in the dog column, so they were counted twice. So the number with both is 22 − 16 = 6.

Looking ahead: a Venn diagram draws the same four groups as two overlapping circles inside a rectangle: the overlap of the circles is the students with both pets, and the space outside both circles is the students with neither.

dogno dogtotalcat6612no cat41418total102030

The 6 students with both pets sit in the cat row and in the dog column, so 12 + 10 = 22 counts them twice: 22 − 6 = 16 have at least one pet.

Worked example: Inclusion-Exclusion Principle (Venn Overlaps)

Question In a cohort of 120 primary school pupils: 75 pupils play badminton, 60 pupils play basketball, and 15 pupils play neither of these two sports. (a) How many pupils play both badminton and basketball? (b) What percentage of the pupils who play badminton do not play basketball?

  1. 1.Total inside the sports circles: 120 − 15 = 105 pupils.

    ?badminton 75basketball 60neither 15
    ?badminton 75basketball 60neither 15
    15 play neither, so 105 are inside the two circles.
  2. 2.Sum of both sports counts: 75 + 60 = 135.

    ?badminton 75basketball 60neither 15120 − 15 = 105 in the circles
    ?badminton 75basketball 60neither 15120 − 15 = 105 in the circles
    75 + 60 counts the overlap twice: 135.
  3. 3.The excess count represents the double-counted overlap: 135 − 105 = 30 pupils.

    ?badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    ?badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    (a) 135 − 105 = 30 play both.
  4. 4.(a) 30 pupils play both.

    30both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    30both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    (a) 135 − 105 = 30 play both.
  5. 5.Badminton only (without basketball): 75 − 30 = 45 pupils.

    4530both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    4530both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    Badminton only: 75 − 30 = 45.
  6. 6.Fraction of badminton players: 4575 = 35 = 60%.

    4530both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    4530both 30badminton 75basketball 60neither 15120 − 15 = 105 in the circles75 + 60 = 135: 30 counted twice
    (b) 45 of 75 is 60%.
  7. 7.(b) 60%.

Answer: (a) 30 pupils; (b) 60%

Common mistakes

  • Subtracting 135 from 120 directly, forgetting to exclude the 15 pupils who play neither sport.
  • Dividing 45 by the total cohort of 120 (37.5%) instead of by the badminton group of 75 (60%).

More logic and counting problems, worked step by step →

Practice Two-Way Tables in the app