LightMySky
En anglais

Conditional Probability from Tables and Venn Diagrams

Work out the probability of one event given that another has happened, by restricting attention to the row, column or region the condition allows.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Read a conditional probability from a two-way table using the total for the given group as the denominator
  • Find a conditional probability from a region of a Venn diagram
  • Explain in words how P(A given B) differs from P(B given A)

1 · Read

You have used totals in two-way tables. A conditional probability keeps only a given group. P(A given B), also written P(A|B), asks how likely A is among B cases. For uniform random selection, divide the count in both A and B by the count in B. Every case is equally likely to be selected. The given group must contain cases: division by zero is undefined.

Try it together

Choose a pupil uniformly at random.

GroupTennisNo tennisTotal
Girls3090120
Boys206080
Total50150200

Given girl, keep the girls row: P(tennis given girl) = 30/120 = 0.25. Given tennis player, keep the tennis column: P(girl given tennis player) = 30/50 = 0.6. Both calculations count the same 30 pupils in the numerator.

Girls:tennis30Girls: notennis90

A Venn diagram separates A only, both, B only and neither. Suppose A only has 12 cases, both has 8 and B only has 20. For uniform selection, P(A given B) uses all of B: 8 + 20 = 28 cases. Only the 8 overlap cases are also in A, so the probability is 8/28 = 2/7. Reversing the condition uses all of A: P(B given A) = 8/(12 + 8) = 0.4. Cases in neither set are excluded from both denominators.

Both A andB8B only20
These bars show the two separate counts inside B, not a Venn diagram. Add them for B's total, then use the overlap over that total.

Reversing the condition keeps the overlap but changes the given group. The answers can differ or be equal. Equal group totals give equal answers; an empty overlap gives zero in both directions when both groups have cases. You can recover an overlap count by multiplying a conditional probability by its given total. If B has 25 cases and P(A given B) = 0.2, the overlap contains 0.2 × 25 = 5 cases. Divide that count by A's total for the reverse probability.

Complete missing table counts before dividing. Add cells to find a row total, or subtract known cells from that total to find a missing cell. For P(not A given B), subtract the overlap from B's total to count favourable cases. A condition can allow several rows, such as Year 10 or Year 11. Add their row totals for the denominator and their favourable cells for the numerator.

Try it together

Some tables contain whole-group probabilities instead of counts. Divide the joint cell for both events by the total for the given event. If the probability of both A and B is 0.12 and B has probability 0.4, then P(A given B) = 0.12/0.4 = 0.3. Both entries must use the same whole-group scale.

Both: 0.12B total: 0.40.12 ÷ 0.4 = 0.3

A test's detection rate is P(positive given condition). It describes cases with the condition. P(condition given positive) describes the positive results instead. Knowing the detection rate and that the condition is rare does not determine the reverse probability. You also need information about positives among cases without the condition. If none of those cases test positive, every positive comes from a case with the condition.

Try it together

In a made-up inspection, 10 faulty parts and 40 sound parts test positive. Choose a part uniformly at random. Given positive, the group has 10 + 40 = 50 parts. P(faulty given positive) = 10/50 = 0.2. Here most positives are false alarms: the 40 sound parts outnumber the 10 faulty parts in the positive group.

Faultypositive10Soundpositive40

Circle the given group first, then divide the overlap by that group alone.

Lesson, questions and flashcards written for this dataset. Inspection examples use hypothetical data.

Readings and questions written for this dataset. Linked videos: 'Conditional probability and independence' by Khan Academy and 'Conditional probability with Bayes' Theorem' by Art of the Problem. Video licenses are unknown.

More to read

Using the row named by the condition

A school records year group and travel method.

YearCycleDo not cycleTotal
10162440
11213960
Total3763100

Choose a pupil uniformly at random. Given Year 10, the possible selections are the 40 pupils in that row. Sixteen cycle, so P(cycle given Year 10) = 16/40 = 0.4.

For P(do not cycle given Year 10), the given group stays the same. Use its 24 non-cyclists: 24/40 = 0.6. The answers add to 1 because these two travel categories cover every Year 10 pupil without overlap.

A missing total would be 16 + 24 = 40. A missing cycling count would be 40 - 24 = 16. Find any needed missing count before forming the conditional fraction.

Including the overlap in the given set

Suppose a Venn diagram has 14 cases in A only, 6 in both sets, 9 in B only and 11 in neither. Each region is separate. Cases in the overlap belong to both sets, but each case is counted once.

Choose a case uniformly at random. Given B, keep its two regions: both and B only. Their total is 6 + 9 = 15. Six of these cases also belong to A, so P(A given B) = 6/15 = 0.4.

Given A, keep A only and both instead. That total is 14 + 6 = 20, giving P(B given A) = 6/20 = 0.3.

Changing only the neither count changes neither calculation. Those cases are outside both given sets. An empty overlap would give probability zero if the given set still contained cases. An empty given set is different: its denominator would be zero, so the count-based conditional is undefined.

Comparing two questions about a test

In a hypothetical inspection of 500 parts, 25 are faulty. The inspection flags 20 faulty parts and 5 sound parts.

Among faulty parts, the flagged fraction is 20/25 = 0.8. This is P(flagged given faulty).

Among flagged parts, the faulty fraction is 20/(20 + 5) = 0.8. This is P(faulty given flagged). The questions use different groups, although these particular counts give equal answers.

Now change the sound-part flags from 5 to 80, leaving the faulty counts unchanged. The flagged group contains 20 + 80 = 100 parts. Its faulty fraction falls to 20/100 = 0.2. The detection fraction among faulty parts remains 20/25 = 0.8.

The reverse probability depends on flags among sound parts as well as detection among faulty parts. Saying faults are rare does not supply the missing false-positive information. These numbers describe a made-up inspection, not an actual test.

Finding the overlap before reversing direction

P(A|B) is another way to write P(A given B). For uniform selection from cases, its numerator counts both A and B, and its denominator counts all B cases.

Suppose B contains 40 cases and P(A|B) = 0.35. The overlap contains 0.35 × 40 = 14 cases. If A contains 28 cases, reversing the condition gives P(B|A) = 14/28 = 0.5. Recover the shared count before choosing the new denominator.

A table can contain whole-group probabilities instead of counts. If the joint cell is 0.15 and B's total is 0.5, then P(A|B) = 0.15/0.5 = 0.3. Both entries must refer to the same whole group.

A condition may include more than one table row. Add the allowed row totals for the denominator, and add the favourable cells within those rows for the numerator.

Explore more

2 · Watch

En anglais

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Where this leads

Jobs that lean on this skill. Follow one to see everything it is built on.

Then practise

17 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Conditional Probability from Tables and Venn Diagrams · Mathematics, ages 15 to 16 · LightMySky