12G

Conditional probability

Reduced sample spaces, the formula P(A | B) = P(A ∩ B) / P(B), the general product rule, independence, and two-way tables.

New information changes probabilities. If you know a die landed on a prime, the chance it's odd is no longer $\tfrac12$. Conditional probability is the precise way to update a probability once you know something has happened.

A reduced sample space

$P(A \mid B)$ is read "the probability of $A$ given $B$". Once you know $B$ happened, the outcomes outside $B$ are gone. $B$ becomes the new sample space, and only the part of $A$ inside $B$ still counts.

For the die: given a prime, the sample space shrinks to $\{2, 3, 5\}$, and the odd ones are $\{3, 5\}$. So $P(\text{odd} \mid \text{prime}) = \dfrac23$.

Conditional probability
$$P(A \mid B) = \frac{P(A \cap B)}{P(B)} \qquad\text{so}\qquad P(A \cap B) = P(B) \times P(A \mid B)$$

The second form is the product rule for stages that are not independent. It is exactly what you did along the branches of a tree in 14F: the second branch's probability is a conditional probability.

Example 1●●

Two dice are rolled and the sum is $9$. Find the probability that at least one die shows a $6$.

$B = \{(3, 6), (4, 5), (5, 4), (6, 3)\}$: four outcomes.
Reduce the sample space to the outcomes with sum 9.
$(3, 6)$ and $(6, 3)$: two outcomes.
Of those, the ones containing a 6.
$P(\text{a } 6 \mid \text{sum } 9) = \dfrac24 = \dfrac12$

Two-way tables

A two-way table makes conditional probability a matter of choosing the right row or column. "Given" tells you which row or column becomes the whole.

Plays sportNo sportTotal
Year 11362460
Year 12283260
Total6456120
Example 2●●

A student is chosen at random from those in the table. Find (a) $P(\text{sport} \mid \text{Year 11})$ (b) $P(\text{Year 11} \mid \text{sport})$.

(a) $\dfrac{36}{60} = \dfrac35$
Given Year 11: only the Year 11 row counts, total 60.
(b) $\dfrac{36}{64} = \dfrac{9}{16}$
Given sport: only the sport column counts, total 64.

Reversing a tree

Example 3●●●

In 14F Example 2, $3\%$ have a condition, the test is positive for $90\%$ of those with it and $8\%$ of those without, and $P(+) = 0.1046$. Find the probability that a person who tests positive actually has the condition.

$P(C \cap +) = 0.03 \times 0.9 = 0.027$
The path 'has it, then positive' gives P(C ∩ +).
$P(C \mid +) = \dfrac{0.027}{0.1046} \approx 0.258$
Divide by the probability of what we're given: a positive test.
Only about $26\%$ of positive results are true positives, because the condition is rare.

Independence

To test, calculate both sides of $P(A \cap B) = P(A) \times P(B)$. Equal means independent. For the die with $A = $ even and $B = \{1, 2, 3, 4\}$: $P(A \cap B) = P(\{2, 4\}) = \dfrac13$ and $P(A)P(B) = \dfrac12 \times \dfrac23 = \dfrac13$. They are independent.

Your turn

$P(A) = 0.5$, $P(B) = 0.4$ and $P(A \cup B) = 0.7$. Find $P(A \mid B)$, and decide whether $A$ and $B$ are independent.

Show the working

$P(A \cap B) = 0.5 + 0.4 - 0.7 = 0.2$. Then $P(A \mid B) = \dfrac{0.2}{0.4} = 0.5$. Since $P(A \mid B) = P(A) = 0.5$, they are independent. (Check: $0.5 \times 0.4 = 0.2$.)

Flashcards
$P(A mid B)$
$\dfrac{P(A \cap B)}{P(B)}$
General product rule
$P(A \cap B) = P(B) \times P(A \mid B)$
Test for independence
$P(A \cap B) = P(A) \times P(B)$
Practice
  1. $P(A \mid B) =$

  2. $P(A \cap B) = 0.12$ and $P(B) = 0.4$. Find $P(A \mid B)$.

  3. A die is rolled and shows a prime number. The probability that it is odd is:

  4. Two dice are rolled and the sum is $8$. Find the probability that it was a double.

  5. Using the two-way table in this section, find $P(\text{sport} \mid \text{Year 12})$, correct to 3 decimal places.

  6. Using the same table, find $P(\text{Year 12} \mid \text{no sport})$, correct to 3 decimal places.

  7. Events $A$ and $B$ are independent exactly when:

  8. $A$ and $B$ are independent, with $P(A) = 0.5$ and $P(B) = 0.4$. Find $P(A \cup B)$.

  9. Exam style: $2\%$ of people have a condition. A test is positive for $95\%$ of those with it and $10\%$ of those without. Find the probability that a person who tests positive has the condition, correct to 3 decimal places.

  10. Exam style: $P(A) = 0.3$, $P(B \mid A) = 0.5$ and $P(B \mid \overline{A}) = 0.2$. Find $P(A \mid B)$, correct to 3 decimal places.

Formula sheet