Reading history

Conditional Probability and Bayes’ Theorem

4 min read 1 views

Learn conditional probability, the multiplication rule, independent events, tree diagrams, the law of total probability and Bayes' theorem.

A medical test is 95% accurate, and it says you have a rare disease. How worried should you be? The answer is surprising, and it depends on conditional probability: the chance of something happening once you know something else has happened. This HSC lesson builds on basic probability. It covers the multiplication rule, independent events, tree diagrams, the law of total probability and Bayes’ theorem.

In this lesson you will learn

  • The meaning and formula of conditional probability
  • The multiplication rule and independent events
  • Drawing without replacement using tree diagrams
  • The law of total probability
  • Bayes’ theorem and why test results can mislead

You should know basic probability and counting.

Conditional Probability

P(A | B) means “the probability of A, given that B has happened”. Knowing B shrinks the set of possible outcomes to B.

Definition

P(A | B) = P(A ∩ B) / P(B), where P(B) > 0

Roll a fair die. Given the number is even, what is P(it is 6)?
B = {2, 4, 6}, A ∩ B = {6}
P(A | B) = (1/6)/(3/6) = 1/3

In a class of 40, 25 play cricket, 18 play football and 10 play both.
P(cricket | football) = 10/18 = 5/9

The Multiplication Rule and Independence

Rearranging the definition gives P(A ∩ B) = P(B) × P(A | B).

Events are independent if one happening does not change the chance of the other: P(A | B) = P(A). Then P(A ∩ B) = P(A) × P(B).

Toss a coin and roll a die (independent):
P(head and 6) = 1/2 × 1/6 = 1/12

Do not confuse independent with mutually exclusive. Mutually exclusive events cannot both happen, so P(A ∩ B) = 0.

Tree Diagrams

A bag holds 5 red and 3 blue balls. Two are taken out, one after the other, without replacement. The second probabilities depend on the first draw, so they are conditional.

5/83/84/73/75/72/7RBRP(R, R) = 20/56BP(R, B) = 15/56RP(B, R) = 15/56BP(B, B) = 6/561st ball2nd ball
Multiply along the branches:
P(R, R) = 5/8 × 4/7 = 20/56
P(R, B) = 5/8 × 3/7 = 15/56
P(B, R) = 3/8 × 5/7 = 15/56
P(B, B) = 3/8 × 2/7 = 6/56          (total 56/56 = 1 ✓)

P(one of each colour) = 15/56 + 15/56 = 30/56 = 15/28

The Law of Total Probability

If B₁, B₂, … split all outcomes into separate cases, then P(A) = P(B₁)P(A | B₁) + P(B₂)P(A | B₂) + … Add up the paths on the tree that lead to A.

Machine X makes 60% of a factory's bulbs, 2% of them faulty.
Machine Y makes 40%, 5% of them faulty.
P(faulty) = 0.6 × 0.02 + 0.4 × 0.05 = 0.012 + 0.020 = 0.032

Bayes’ Theorem

Bayes’ theorem

P(B | A) = P(B) × P(A | B) / P(A)

It turns a probability around: from “faulty, given machine X” to “machine X, given faulty”.

A bulb is faulty. What is the chance it came from machine X?
P(X | faulty) = 0.012 / 0.032 = 0.375

A disease affects 1% of people. A test is positive for 95% of people
who have it, but also for 5% of people who do not.
P(positive) = 0.01 × 0.95 + 0.99 × 0.05 = 0.0095 + 0.0495 = 0.059
P(disease | positive) = 0.0095 / 0.059 ≈ 0.16

Only about 16% of people who test positive have the disease. The disease is so rare that false alarms from the healthy 99% outnumber the true cases. That is why doctors often repeat a test before diagnosing.

Common Mistakes

  1. Confusing P(A | B) with P(B | A). They are usually different.
  2. Using the original numbers for the second draw when there is no replacement.
  3. Multiplying probabilities of events that are not independent without using conditional values.
  4. Treating “independent” and “mutually exclusive” as the same.

Practice Exercises

Exercise 1. Two cards are drawn from a pack of 52 without replacement. Find P(both are aces).

Show answer

4/52 × 3/51 = 12/2652 = 1/221.

Exercise 2. P(A) = 0.5, P(B) = 0.4 and P(A ∩ B) = 0.2. Are A and B independent?

Show answer

P(A) × P(B) = 0.2 = P(A ∩ B), so yes, they are independent.

Exercise 3. In the factory example, find the probability that a faulty bulb came from machine Y.

Show answer

0.020/0.032 = 0.625. (It must be 1 − 0.375.)

Frequently Asked Questions

Who was Bayes?

Thomas Bayes was an English minister and mathematician. His theorem was published in 1763, after his death. Today it is used in spam filters, medical diagnosis and machine learning.

What is the expected value?

The long-run average of a random quantity: add each value times its probability. For a fair die it is (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5.

Summary

  • P(A | B) = P(A ∩ B)/P(B); knowing B changes the chances.
  • P(A ∩ B) = P(B)P(A | B); for independent events it is P(A)P(B).
  • Tree diagrams: multiply along branches, add the paths you want.
  • Bayes’ theorem reverses a conditional probability; rare conditions make false positives common.

Next: Integration by Substitution.

Lessons are also marked complete when you click Next.

Leave a Reply

Your email address will not be published. Required fields are marked *