Bayes' Theorem Formulas
🧠 Bayes' Theorem: Understanding Conditional Probability
Bayes' Theorem is a fundamental concept in probability theory that allows us to update the probability of an event based on new evidence. It's particularly useful for calculating the conditional probability of an event when we know the reverse conditional probability and other related probabilities.
📝 Conditional Probability Formulas
Before diving into Bayes' Theorem, it's crucial to understand the basic formulas for conditional probability:
Probability of A given B: The probability of event A occurring, given that event B has already occurred.
P(A∣B)=P(B)P(A∩B)Probability of B given A: The probability of event B occurring, given that event A has already occurred.
P(B∣A)=P(A)P(B∩A)
💡 Deriving Bayes' Theorem
Bayes' Theorem can be derived by equating the expressions for P(A∩B) and P(B∩A).
From the conditional probability formulas, we can express the probability of intersection:
P(A∩B)=P(A∣B)×P(B)
P(B∩A)=P(B∣A)×P(A)
Since P(A∩B)=P(B∩A), we can set these two expressions equal:
P(A∣B)×P(B)=P(B∣A)×P(A)To isolate P(A∣B), which is the core of Bayes' Theorem, we divide both sides by P(B):
P(A∣B)=P(B)P(B∣A)×P(A)
This is the basic formula of Bayes' Theorem. It allows us to calculate P(A∣B) if we know P(B∣A), P(A), and P(B).
🎯 Example 1: Numbers in a Bottle
Let's illustrate Bayes' Theorem with a simple example involving numbers.
🔢 Scenario Setup
Imagine a bottle containing pieces of paper with numbers.
Event A: Drawing numbers {1, 2, 3, 4, 5}
Event B: Drawing numbers {4, 5, 6, 7, 8, 9}
Our goal is to calculate P(A∣B) using Bayes' Theorem.
📊 Venn Diagram Visualization
A Venn diagram helps visualize the events and their intersection:
Intersection (A∩B): {4, 5} (common numbers)
Only A: {1, 2, 3}
Only B: {6, 7, 8, 9}
The sample space (all possible numbers) is {1, 2, 3, 4, 5, 6, 7, 8, 9}, which contains 9 unique numbers.
🧮 Calculating Individual Probabilities
To use Bayes' Theorem, we need P(A), P(B), and P(B∣A).
P(A) (Probability of Event A):
Event A has 5 numbers ({1, 2, 3, 4, 5}) out of 9 total possible numbers.
P(A)=95
P(B) (Probability of Event B):
Event B has 6 numbers ({4, 5, 6, 7, 8, 9}) out of 9 total possible numbers.
P(B)=96
P(B∣A) (Probability of B given A):
Conceptually, if A has already occurred, we are only considering the numbers in A ({1, 2, 3, 4, 5}).
Out of these 5 numbers, how many are also in B? Only {4, 5}, which are 2 numbers.
Therefore, P(B∣A)=52
✨ Applying Bayes' Theorem
Now, let's plug these values into the formula:
We can simplify by canceling the 5s in the numerator and then multiplying the top and bottom by 9:
So, the probability of A given B is 31.
✅ Confirming with Conditional Probability
We can confirm this result using the direct conditional probability formula:
P(A∩B): The intersection has 2 numbers ({4, 5}) out of 9 total. So, P(A∩B)=92.
P(B): We already found P(B)=96.
P(A∣B)=6/92/9=62=31.
Both methods yield the same result, demonstrating the validity of Bayes' Theorem.
🩺 Example 2: Medical Screening for Prostate Cancer
Bayes' Theorem is particularly useful in real-world scenarios like medical diagnostics.
📝 Problem Statement
A study shows:
12% of men develop prostate cancer.
A man with prostate cancer has a 95% chance of a positive test result.
A man without prostate cancer has a 6% chance of a false positive test result.
What is the probability that a man has cancer given that he has a positive test result?
🏷️ Defining Events and Probabilities
Let's define our events:
C: The man has cancer.
T+: The man has a positive test result.
C': The man does not have cancer.
Given probabilities:
P(C)=12%=0.12
P(T+∣C)=95%=0.95 (Probability of positive test given cancer)
P(T+∣C′)=6%=0.06 (Probability of positive test given no cancer - false positive)
We need to find P(C∣T+).
📊 Applying Bayes' Theorem for Medical Screening
The Bayes' Theorem formula for this problem is:
We have P(T+∣C) and P(C), but we need to find P(T+) (the overall probability of a positive test result).
🌳 Using a Tree Diagram to Find P(T+)
A tree diagram helps visualize the different paths to a positive test result:
Path 1: Has Cancer AND Positive Test
P(C)=0.12
P(T+∣C)=0.95
P(C∩T+)=P(C)×P(T+∣C)=0.12×0.95=0.114
Path 2: Does NOT Have Cancer AND Positive Test (False Positive)
P(C′)=1−P(C)=1−0.12=0.88
P(T+∣C′)=0.06
P(C′∩T+)=P(C′)×P(T+∣C′)=0.88×0.06=0.0528
The overall probability of a positive test result, P(T+), is the sum of probabilities of these two paths:
🧪 Final Calculation with Bayes' Theorem
Now we have all the components for Bayes' Theorem:
P(T+∣C)=0.95
P(C)=0.12
P(T+)=0.1668
This means there is approximately a 68.3% chance that a man has cancer given that he has a positive test result.
⚠️ Interpreting the Result
It's important to note that even with a positive test result, there's still a significant chance (approximately 1−0.683=0.317 or 31.7%) that the man does not have cancer. This highlights the importance of understanding false positives in medical testing and why further diagnostic steps are often necessary.
🔢 Alternative Method: Using a Hypothetical Population
Another way to approach this problem is by considering a hypothetical population (e.g., 10,000 men). This method often makes the probabilities more intuitive.
Let's assume a population of 10,000 men.
Men with Cancer:
12% of 10,000 = 0.12×10,000=1,200 men
Men without Cancer:
88% of 10,000 = 0.88×10,000=8,800 men
Now, let's look at test results within these groups:
Positive Test among Men with Cancer (T+∣C):
95% of 1,200 = 0.95×1,200=1,140 men (True Positives)
Negative Test among Men with Cancer (T−∣C): 5% of 1,200 = 60 men
Positive Test among Men without Cancer (T+∣C′ - False Positives):
6% of 8,800 = 0.06×8,800=528 men (False Positives)
Negative Test among Men without Cancer (T−∣C′): 94% of 8,800 = 8,272 men
📈 Calculating P(C∣T+) with Hypothetical Population
We want to find the probability that a man has cancer given a positive test result.
Total men with a positive test result:
True Positives (from cancer group) + False Positives (from no cancer group)
1,140+528=1,668 men
Men with cancer among those with a positive test result:
This is the number of True Positives: 1,140 men
Now, calculate the conditional probability:
Both methods (Bayes' Theorem formula and hypothetical population) yield the same result, confirming that there is approximately a 68.3% chance that a man has cancer given a positive test result. This demonstrates the power and practicality of Bayes' Theorem in understanding conditional probabilities in real-world contexts.

Ask anything
We've read this whole study set, so questions about it get the best answers.