Study and Productivity

How to Use Two-Way Tables for Conditional Probability

Learn to complete two-way tables from totals, read joint, marginal and conditional probabilities, and check whether two events are independent.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
How to Use Two-Way Tables for Conditional Probability

How to Use Two-Way Tables for Conditional Probability

Two-way tables turn probability into counting. Exam boards love them because one table can test arithmetic, fractions, conditional probability and independence in a single question. This guide works through a typical example and shows how the free two-way table calculator can check each step.

What a two-way table is

A two-way table, also called a contingency table, counts people or things by two categorical variables at once. Rows might be how students travel to school (walk, bus, car) and columns their year group. Each cell holds a count, and the final row and column hold totals. The bottom right cell is the grand total.

Completing a partial table

Exam questions often give only some of the numbers. The key fact is that each row and each column adds up to its total. Look for a row or column with only one missing value and work it out; then look again, because that new value may complete another line.

Example: Year 9 has 32 walkers, 25 bus users and an unknown number of car users; Year 10 has 18 walkers, an unknown number of bus users and 14 car users. The walk row totals 50, the bus row 61 and the car row 31. From the rows, Year 10 bus users are 61 − 25 = 36 and Year 9 car users are 31 − 14 = 17. Then the column totals are 74 and 68, and the grand total 142. The calculator fills these gaps in the same order and lists each step, so you can compare it with your working.

Joint, marginal and conditional probability

Pick one student at random.

  • A joint probability involves both variables: P(walks and Year 9) = 32 ÷ 142.
  • A marginal probability involves one variable and uses a total from the margin: P(walks) = 50 ÷ 142 ≈ 0.352.
  • A conditional probability restricts you to one row or column: P(walks given Year 9) = 32 ÷ 74 ≈ 0.432.

The phrase "given that" always tells you which total to divide by. If it is "given Year 9", use the Year 9 column total. Mixing up the totals is the most common error, so say aloud which group you are restricted to before dividing.

Row and column percentages

Relative frequencies are counts divided by a total, and the choice of total changes the meaning. Row percentages show how each row splits across the columns; column percentages show how each column splits across the rows. The calculator switches between counts, percentages of the grand total, row percentages and column percentages, and draws stacked bars so you can compare the rows visually.

Checking independence

Two events are independent if knowing one does not change the probability of the other. In table terms, P(A given B) should equal P(A). Here P(walks given Year 9) is 0.432 while P(walks) is 0.352, so walking and being in Year 9 are not independent in this sample. In a real study you would use a chi-square test to decide whether such a difference could be chance; the calculator lists the expected counts that test needs.

The addition rule

For "A or B" questions, add the probabilities and subtract the overlap so it is not counted twice: P(A or B) = P(A) + P(B) − P(A and B). In a two-way table you can also just add up the cells in row A and column B, counting the shared cell once.

Practice

The practice tab generates small tables and asks for totals, joint probabilities as fractions and conditional probabilities as decimals, with the method shown after each answer.

Limits

The probabilities describe picking one person from this table. They describe a wider population only if the table comes from a random sample, and comparing proportions is not the same as a significance test. The calculator handles tables up to six rows and six columns.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages