๐Ÿ“˜ Lesson 4 of 8 ยท Probability

๐Ÿ” Bayes' Theorem

Bayes' Theorem lets us reverse a conditional probability โ€” using what we know about P(B|A) to figure out P(A|B), which is invaluable when direct evidence is hard to obtain.

Course progress: 50%

01 Key Concepts

The Core Idea

Bayes' Theorem updates the probability of a cause (A) after observing some evidence (B).

Bayes' Theorem Formula

P(A|B) = [P(B|A) * P(A)] / P(B).

Law of Total Probability

When A has several possible non-overlapping cases (A1, A2, ...), P(B) = sum of P(B|Ai)*P(Ai) over all i โ€” needed to compute the denominator in Bayes' formula.

Prior vs. Posterior Probability

P(A) is the 'prior' belief before seeing evidence. P(A|B) is the 'posterior' belief after incorporating the evidence B.

Common Application

Medical testing: given a positive test result (B), find the true probability of having a disease (A), accounting for false positives and the disease's rarity.

02 Key Formulas

03 Solved Examples

Example 1 A disease affects 1% of a population. A test correctly detects it 90% of the time (true positive) and gives a false positive 5% of the time. Find P(has disease | tests positive).
  1. Let A = has disease, so P(A) = 0.01, P(A') = 0.99.
  2. P(positive|A) = 0.90, P(positive|A') = 0.05.
  3. Find P(positive) = P(positive|A)*P(A) + P(positive|A')*P(A') = 0.90*0.01 + 0.05*0.99 = 0.009 + 0.0495 = 0.0585.
  4. Apply Bayes: P(A|positive) = (0.90*0.01)/0.0585 = 0.009/0.0585.
Answer: Approximately 0.154, or about 15.4%
Example 2 Two factories supply light bulbs: Factory A makes 60% of bulbs with a 2% defect rate; Factory B makes 40% with a 5% defect rate. A random bulb is defective. Find P(it came from Factory B).
  1. P(A)=0.6, P(B)=0.4. P(defective|A)=0.02, P(defective|B)=0.05.
  2. P(defective) = 0.02*0.6 + 0.05*0.4 = 0.012 + 0.02 = 0.032.
  3. P(B|defective) = (0.05*0.4)/0.032 = 0.02/0.032.
Answer: 0.625, or 62.5%
Example 3 Explain in words what P(A|B) represents versus P(A) in Bayes' Theorem.
  1. P(A) is the prior probability โ€” our belief about A before any evidence.
  2. P(A|B) is the posterior probability โ€” the updated belief about A after learning that B occurred.
Answer: P(A) is the prior; P(A|B) is the updated (posterior) probability after observing evidence B

04 Practice Questions

1If P(A)=0.02, P(B|A)=0.8, P(B)=0.1, find P(A|B).
0.16
2A disease affects 2% of people; a test is 95% accurate for both positives and negatives. Set up P(B) using the law of total probability (do not solve fully).
P(B)=0.95*0.02 + 0.05*0.98
3Solve the previous P(B).
0.019 + 0.049 = 0.068
4What is a 'prior probability' in Bayes' Theorem?
The initial probability of an event before new evidence is considered
5What is a 'posterior probability' in Bayes' Theorem?
The updated probability after accounting for new evidence

๐Ÿ“„ Bayes' Theorem โ€” Downloadable Worksheet

10 questions with a full answer key. Grab the PDF to print, or try the interactive version in your browser.