πŸ” Conditional Probability

GCSE Maths Β· Probability (P9)

Ages 15–16 Β· Foundation & Higher

← Back to topic overview
1 What "Given That" Means
A conditional probability is the probability of one event given that another has already happened. Knowing the extra information changes the situation β€” you are no longer looking at everybody, only at a smaller group.
Notation
$P(A \mid B)$  means  "the probability of $A$ given $B$"
The one idea you need
"Given that…" tells you to shrink the denominator
Count only within the group you have been told about
Worked Example 1 β€” Seeing the shrink

In a class of $30$ students, $12$ wear glasses. Of those $12$, $5$ are left-handed. A student is chosen at random.

β‘ $P(\text{wears glasses}) = \dfrac{12}{30} = 0.4$ β€” denominator is the whole class.
β‘‘$P(\text{left-handed} \mid \text{wears glasses}) = \dfrac{5}{12}$ β€” denominator is only the glasses-wearers.

The extra information "given that they wear glasses" has cut the group from $30$ down to $12$.

The order matters. $P(A \mid B)$ and $P(B \mid A)$ are usually different numbers. "The probability someone is a doctor given they went to university" is very different from "the probability someone went to university given they are a doctor".
2 Conditional Probability from a Two-Way Table

Two-way tables make conditional probability almost mechanical: the condition tells you which row or column to use as the denominator.

Worked Example 2 β€” Reading a table

The table shows $200$ people and whether they own a pet.

Owns a petNo petTotal
Adults$54$$66$$120$
Children$48$$32$$80$
Total$102$$98$$200$

Find (a) $P(\text{owns a pet})$, (b) $P(\text{owns a pet} \mid \text{child})$, (c) $P(\text{child} \mid \text{owns a pet})$.

β‘ (a) Whole table: $\dfrac{102}{200} = 0.51$
β‘‘(b) Given a child, use the children row: $80$ children, $48$ with pets.
β‘’$\dfrac{48}{80} = 0.6$
β‘£(c) Given a pet owner, use the pet column: $102$ owners, $48$ of them children.
β‘€$\dfrac{48}{102} = \dfrac{8}{17} = 0.471$ (3 d.p.)
Notice (b) and (c) use the same numerator, $48$, but different denominators. That is the whole point of conditional probability.
3 Conditional Probability from a Venn Diagram
ΞΎ = 50 F G 14 9 18 9 F = French, G = German. Total: 14 + 9 + 18 + 9 = 50 βœ“
Worked Example 3 β€” Using a Venn diagram

Using the diagram above, find (a) $P(F)$, (b) $P(F \mid G)$, (c) $P(G \mid F)$, (d) $P(F' \mid G')$.

β‘ (a) $F$ contains $14 + 9 = 23$ students. $P(F) = \dfrac{23}{50} = 0.46$
β‘‘(b) Given $G$: the German circle holds $9 + 18 = 27$ students, of whom $9$ also do French.
β‘’$P(F \mid G) = \dfrac{9}{27} = \dfrac{1}{3}$
β‘£(c) Given $F$: $23$ students, of whom $9$ also do German.
β‘€$P(G \mid F) = \dfrac{9}{23}$
β‘₯(d) Given not German: outside the $G$ circle there are $14 + 9 = 23$ students. Of these, those who also do not do French number $9$.
⑦$P(F' \mid G') = \dfrac{9}{23}$
The formal rule
$P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}$  β€” which is exactly "the overlap divided by the condition"
4 Conditional Probability on Tree Diagrams
On a tree diagram, the probabilities on the second set of branches are already conditional β€” they assume the first branch has happened. This is exactly what "without replacement" questions rely on.
Worked Example 4 β€” Reading a conditional off a tree

A bag has $5$ red and $3$ blue counters. Two are taken without replacement. What is the probability the second is red, given the first was red?

β‘ After removing one red, $4$ red remain out of $7$ counters.
β‘‘$P(\text{2nd red} \mid \text{1st red}) = \dfrac{4}{7}$

This number is written directly on the upper second-stage branch of the tree.

Worked Example 5 β€” Working backwards through a tree

A factory has two machines. Machine A makes $60\%$ of items, machine B makes $40\%$. $3\%$ of A's items are faulty and $7\%$ of B's are faulty. An item is chosen at random and found to be faulty. Find the probability it came from machine B.

β‘ $P(\text{A and faulty}) = 0.6 \times 0.03 = 0.018$
β‘‘$P(\text{B and faulty}) = 0.4 \times 0.07 = 0.028$
β‘’$P(\text{faulty}) = 0.018 + 0.028 = 0.046$
β‘£Given it is faulty, restrict to those $0.046$:
β‘€$P(\text{B} \mid \text{faulty}) = \dfrac{0.028}{0.046} = \dfrac{28}{46} = \dfrac{14}{23} = 0.609$ (3 d.p.)
The pattern: the numerator is the single path you want; the denominator is the sum of all paths that satisfy the condition.
Do not just read the branch. In Worked Example 5, $0.07$ is $P(\text{faulty} \mid \text{B})$, not $P(\text{B} \mid \text{faulty})$. Reversing a conditional always needs the calculation above.
5 Using Expected Frequencies

Conditional probability becomes much easier if you convert the probabilities into numbers of people first. Choose a convenient total and build a table.

Worked Example 6 β€” The medical test

$1\%$ of a population has a disease. A test is $90\%$ accurate for those who have it, and gives a false positive for $5\%$ of those who do not. A person tests positive. What is the probability they actually have the disease?

β‘ Take a population of $10\,000$ people.
β‘‘With the disease: $1\%$ of $10\,000 = 100$. Without: $9900$.
β‘’Of the $100$ with it, $90\%$ test positive: $90$ people.
β‘£Of the $9900$ without it, $5\%$ test positive: $495$ people.
Tests positiveTests negativeTotal
Has disease$90$$10$$100$
No disease$495$$9405$$9900$
Total$585$$9415$$10\,000$
β‘€Given a positive test, restrict to the $585$ positives.
β‘₯$P(\text{has disease} \mid \text{positive}) = \dfrac{90}{585} = 0.154$ (3 d.p.)

Only about $15\%$ β€” surprisingly low, because the disease is rare and there are far more false positives than true ones. This is why real screening programmes always retest.

6 Testing for Independence
Independence test
$A$ and $B$ are independent if  $P(A \mid B) = P(A)$
equivalently, if  $P(A \cap B) = P(A) \times P(B)$
In words: knowing that $B$ happened tells you nothing new about whether $A$ will happen.
Worked Example 7 β€” Are they independent?

In a group of $80$ people, $32$ play a musical instrument and $20$ speak a second language. Of these, $8$ do both. Are "plays an instrument" and "speaks a second language" independent?

β‘ $P(\text{instrument}) = \dfrac{32}{80} = 0.4$
β‘‘$P(\text{instrument} \mid \text{second language}) = \dfrac{8}{20} = 0.4$
β‘’These are equal, so the events are independent.

Check with the product rule: $P(\text{both}) = \dfrac{8}{80} = 0.1$, and $P(A) \times P(B) = 0.4 \times 0.25 = 0.1$ βœ“

7 Quick Reference

Notation

$P(A \mid B)$ is "$A$ given $B$".

The main idea

"Given that" shrinks the denominator to the stated group.

Two-way table

Use one row or one column total as the denominator.

Venn diagram

Overlap $\div$ the whole condition circle.

Formula

$P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}$.

Order matters

$P(A \mid B) \neq P(B \mid A)$ in general.

Trees

Second-stage branches are already conditional.

Reversing

Wanted path $\div$ sum of all paths meeting the condition.

Expected frequencies

Convert to counts out of $100$ or $10\,000$ β€” far easier.

Independent?

Check whether $P(A \mid B) = P(A)$.

8 Practice Questions
Question 1

In a class of $25$, $10$ play football. Of those, $4$ also play tennis. Find $P(\text{plays tennis} \mid \text{plays football})$.

β–Ά Show solution

Restrict to the $10$ footballers, of whom $4$ play tennis.

$P = \dfrac{4}{10} = 0.4$

Question 2

Use this table to find (a) $P(\text{male})$, (b) $P(\text{drives} \mid \text{male})$, (c) $P(\text{male} \mid \text{drives})$.

DrivesDoes not driveTotal
Male$45$$15$$60$
Female$35$$25$$60$
Total$80$$40$$120$
β–Ά Show solution

(a) $\dfrac{60}{120} = 0.5$

(b) Male row: $\dfrac{45}{60} = 0.75$

(c) Drives column: $\dfrac{45}{80} = 0.5625$

Question 3

A bag has $6$ red and $4$ green counters. Two are taken without replacement. Find $P(\text{2nd is green} \mid \text{1st is green})$.

β–Ά Show solution

After removing one green, $3$ green remain out of $9$ counters.

$P = \dfrac{3}{9} = \dfrac{1}{3}$

Question 4

A Venn diagram shows: only $A$ = $12$, both = $8$, only $B$ = $15$, neither = $5$. Find (a) $P(A \mid B)$, (b) $P(B \mid A)$.

β–Ά Show solution

$n(A) = 12 + 8 = 20$; $n(B) = 8 + 15 = 23$; total $= 40$.

(a) $P(A \mid B) = \dfrac{8}{23}$

(b) $P(B \mid A) = \dfrac{8}{20} = 0.4$

Question 5

$P(A) = 0.5$, $P(B) = 0.3$ and $P(A \cap B) = 0.15$. Are $A$ and $B$ independent?

β–Ά Show solution

$P(A) \times P(B) = 0.5 \times 0.3 = 0.15$

This equals $P(A \cap B)$, so yes, they are independent.

Check the other way: $P(A \mid B) = \dfrac{0.15}{0.3} = 0.5 = P(A)$ βœ“

Question 6

Of $150$ people surveyed, $90$ own a car. Of the car owners, $54$ also own a bike. Of the non-car-owners, $18$ own a bike. Find $P(\text{owns a car} \mid \text{owns a bike})$.

β–Ά Show solution

Bike owners altogether $= 54 + 18 = 72$.

Of these, $54$ also own a car.

$P = \dfrac{54}{72} = 0.75$

Question 7

Two machines make bolts. Machine X makes $70\%$ and $2\%$ of them are faulty; machine Y makes $30\%$ and $6\%$ are faulty. A bolt is faulty. Find the probability it came from machine X.

β–Ά Show solution

$P(\text{X and faulty}) = 0.7 \times 0.02 = 0.014$

$P(\text{Y and faulty}) = 0.3 \times 0.06 = 0.018$

$P(\text{faulty}) = 0.014 + 0.018 = 0.032$

$P(\text{X} \mid \text{faulty}) = \dfrac{0.014}{0.032} = 0.4375$

Question 8

Explain, with an example, why $P(A \mid B)$ is not usually the same as $P(B \mid A)$.

β–Ά Show solution

They use different denominators: one restricts to group $B$, the other to group $A$. Unless the two groups happen to be the same size, the answers differ.

Example: $P(\text{is a professional footballer} \mid \text{owns football boots})$ is tiny, because millions of people own boots.

But $P(\text{owns football boots} \mid \text{is a professional footballer})$ is essentially $1$.

Question 9

A bag contains $4$ white and $6$ black balls. Two are drawn without replacement.

(a) Find $P(\text{both white})$.   (b) Find $P(\text{2nd white})$.   (c) Find $P(\text{1st white} \mid \text{2nd white})$.

β–Ά Show solution

(a) $\dfrac{4}{10} \times \dfrac{3}{9} = \dfrac{12}{90} = \dfrac{2}{15}$

(b) Two paths give a white second ball:

WW: $\dfrac{4}{10} \times \dfrac{3}{9} = \dfrac{12}{90}$;  BW: $\dfrac{6}{10} \times \dfrac{4}{9} = \dfrac{24}{90}$

$P(\text{2nd white}) = \dfrac{12 + 24}{90} = \dfrac{36}{90} = \dfrac{2}{5}$

(c) $P(\text{1st white} \mid \text{2nd white}) = \dfrac{P(\text{WW})}{P(\text{2nd white})} = \dfrac{12/90}{36/90} = \dfrac{12}{36} = \dfrac{1}{3}$

Question 10

A screening test for a condition affecting $2\%$ of a population detects it correctly $95\%$ of the time. For people without the condition, it wrongly gives a positive result $8\%$ of the time.

(a) Using a population of $10\,000$, build a two-way table.   (b) Find $P(\text{positive test})$.   (c) Find $P(\text{has the condition} \mid \text{positive test})$.   (d) Comment on what this means for the usefulness of the test.

β–Ά Show solution

(a) With the condition: $2\%$ of $10\,000 = 200$; without: $9800$.

True positives: $95\%$ of $200 = 190$; so $10$ false negatives.

False positives: $8\%$ of $9800 = 784$; so $9016$ true negatives.

PositiveNegativeTotal
Has condition$190$$10$$200$
No condition$784$$9016$$9800$
Total$974$$9026$$10\,000$

(b) $P(\text{positive}) = \dfrac{974}{10\,000} = 0.0974$

(c) $P(\text{has condition} \mid \text{positive}) = \dfrac{190}{974} = 0.195$ (3 d.p.)

(d) Only about $20\%$ of people who test positive actually have the condition β€” four out of five positives are false alarms.

This happens because the condition is rare: even a small false-positive rate applied to the very large healthy group ($784$ people) swamps the true positives ($190$). The test is still useful as a first screen, since it catches $95\%$ of real cases, but a positive result must always be followed up with a more accurate second test.

Conditional Probability (P9) Β· GCSE Maths Revision Β· Created with MathJax