Two-Way Tables Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Two-Way Tables.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

A table that displays frequencies for two categorical variables simultaneously, organized with one variable in rows and the other in columns. It shows joint frequencies (individual cells), marginal frequencies (row/column totals), and enables calculation of conditional frequencies.

Imagine surveying students about their favorite sport AND their grade level. A two-way table is like a grid: grades go down the side, sports go across the top, and each cell tells you how many students are in that specific combination. The totals on the edges (margins) tell you the overall counts for each category.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Two-way tables organize data by two categories to reveal relationships. Joint frequencies are the inner cells. Marginal frequencies are the totals. Conditional frequencies answer 'given one category, what proportion falls in another?'

Common stuck point: Distinguishing joint, marginal, and conditional frequencies. Joint = one specific cell. Marginal = row or column total. Conditional = cell divided by its row or column total (not the grand total).

Sense of Study hint: Read across rows for one variable and down columns for the other. Compute marginal totals by summing rows and columns. For conditional distributions, divide each cell by its row or column total.

Common Mistakes to Watch For

Before you work through the examples, skim the mistake guide so you know which shortcuts and sign errors to avoid.

Worked Examples

Example 1

medium
A two-way table shows: Smoker/Cancer=30, Smoker/No-Cancer=70, Non-smoker/Cancer=20, Non-smoker/No-Cancer=180. Calculate marginal and joint proportions, and find P(Cancer|Smoker) vs P(Cancer|Non-smoker).

Solution

  1. 1
    Total: 300 people; Smokers=100, Non-smokers=200
  2. 2
    Joint: P(\text{Smoker} \cap \text{Cancer}) = 30/300 = 0.10
  3. 3
    Marginal: P(\text{Cancer}) = 50/300 = 0.167; P(\text{Smoker}) = 100/300 = 0.333
  4. 4
    P(\text{Cancer}|\text{Smoker}) = 30/100 = 0.30; P(\text{Cancer}|\text{Non-smoker}) = 20/200 = 0.10

Answer

P(\text{Cancer}|\text{Smoker}) = 0.30 vs. P(\text{Cancer}|\text{Non-smoker}) = 0.10. Smokers have 3ร— higher cancer rate.
Two-way tables organize joint and conditional probabilities. Marginal probabilities are row/column totals divided by grand total. Conditional probabilities are cell frequencies divided by row (or column) totals. Comparing P(Cancer|Smoker) to P(Cancer|Non-smoker) reveals the association.

Example 2

hard
From a 2ร—2 table: Group/Outcome frequencies: A-Success=40, A-Fail=10, B-Success=25, B-Fail=25. Test independence using the chi-square approach and calculate the relative risk.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
A two-way table: Left-handed/Male=12, Left-handed/Female=8, Right-handed/Male=88, Right-handed/Female=92. Find the marginal proportion of left-handers and P(Left-handed|Male).

Example 2

hard
Construct a two-way table from this information: 200 students surveyed; 120 prefer online learning; 80 prefer in-person. Of online learners: 90 passed. Of in-person learners: 55 passed. Complete the table and find whether learning mode and passing are independent.

Background Knowledge

These ideas may be useful before you work through the harder examples.

probabilityfractionsratios