Bayes' Theorem
Probability based on prior knowledge.
This public page keeps the free explanation visible and leaves premium worked solving, advanced walkthroughs, and saved study tools inside the app.
Core idea
Overview
Bayes' Theorem is a mathematical formula used to determine the conditional probability of an event based on prior knowledge of conditions that might be related to the event. It describes how to update the initial probability of a hypothesis as more evidence or information becomes available.
When to use: Use this theorem when you need to calculate the probability of a cause given an observed effect, or when updating beliefs based on new data. It is essential in diagnostic testing, machine learning classification, and statistical inference where 'prior' probabilities are known.
Why it matters: It serves as the foundation for Bayesian statistics, which allows for dynamic learning from data. Its applications range from filtering spam emails and diagnosing rare diseases to refining autonomous vehicle navigation systems.
Symbols
Variables
P(A|B) = Posterior P(A|B), P(B|A) = Likelihood P(B|A), P(A) = Prior P(A), P(B) = Evidence P(B)
Walkthrough
Derivation
Derivation of Bayes' Theorem
Bayes’ theorem updates the probability of A after observing B and follows directly from the definition of conditional probability.
- A and B are events.
- P(B)>0.
Start from conditional probability:
Conditional probability is the probability of both events occurring divided by the probability of the condition.
Write the same intersection the other way:
Rearranging P(B A)= gives this expression for the intersection.
Substitute to obtain Bayes’ theorem:
This links the posterior P(A B) to the likelihood P(B A) and the prior P(A).
Note: P(B) can be expanded using the law of total probability when needed.
Result
Source: Edexcel A-Level Mathematics — Statistics (Probability)
Free formulas
Rearrangements
Solve for
Make Pab the subject
Pab is already the subject of the formula.
Difficulty: 1/5
Solve for
Make Pba the subject
Rearrange Bayes' Theorem to isolate the likelihood P(B|A).
Difficulty: 2/5
Solve for
Make Pa the subject
Rearrange Bayes' Theorem to isolate the prior probability P(A).
Difficulty: 2/5
Solve for
Make Pb the subject
Rearrange Bayes' Theorem to isolate the evidence P(B).
Difficulty: 3/5
The static page shows the finished rearrangements. The app keeps the full worked algebra walkthrough.
Visual intuition
Graph
The graph is linear because the posterior probability is directly proportional to the likelihood and prior probability when the marginal probability remains constant. As the independent variable representing the likelihood P(B|A) increases, the y-axis value increases at a constant rate, creating a straight line passing through the origin.
Graph type: linear
Why it behaves this way
Intuition
Imagine a Venn diagram where the total area represents the sample space. Event A and Event B are overlapping regions. Bayes' Theorem calculates the proportion of the area of Event B that is also covered by Event A
Signs and relationships
- P(B) in the denominator: The division by P(B) normalizes the product of the likelihood and prior probability (P(B|A)P(A), which equals P(A and B)) to convert it into a conditional probability P(A|B).
Free study cues
Insight
Canonical usage
Bayes' Theorem operates with probabilities, which are inherently dimensionless quantities expressed as numbers between 0 and 1.
Common confusion
A common confusion is incorrectly converting between decimal probabilities and percentages, or attempting to assign physical units to probability values.
Dimension note
All terms in Bayes' Theorem (P(A|B), P(B|A), P(A), P(B)) represent probabilities, which are dimensionless ratios. They quantify the likelihood of an event and are always values between 0 and 1.
Unit systems
One free problem
Practice Problem
In a clinical trial, a disease affects 1% of the population. A diagnostic test is 99% accurate for those who have the disease. If the total probability of any individual testing positive is 1.98%, what is the probability that an individual actually has the disease given a positive test result?
Solve for:
Hint: Multiply the probability of testing positive while sick by the probability of being sick, then divide by the total probability of testing positive.
The full worked solution stays in the interactive walkthrough.
Where it shows up
Real-World Context
Updating disease probability after a test.
Study smarter
Tips
- Always identify the 'prior' probability Pa before considering new evidence.
- Distinguish clearly between Pba (likelihood of evidence given the hypothesis) and Pab (probability of hypothesis given evidence).
- Ensure that the total probability of the evidence Pb is correctly calculated or provided.
Avoid these traps
Common Mistakes
- Swapping P(A|B) and P(B|A).
- Forgetting to divide by P(B).
Common questions
Frequently Asked Questions
Bayes’ theorem updates the probability of A after observing B and follows directly from the definition of conditional probability.
Use this theorem when you need to calculate the probability of a cause given an observed effect, or when updating beliefs based on new data. It is essential in diagnostic testing, machine learning classification, and statistical inference where 'prior' probabilities are known.
It serves as the foundation for Bayesian statistics, which allows for dynamic learning from data. Its applications range from filtering spam emails and diagnosing rare diseases to refining autonomous vehicle navigation systems.
Swapping P(A|B) and P(B|A). Forgetting to divide by P(B).
Updating disease probability after a test.
Always identify the 'prior' probability Pa before considering new evidence. Distinguish clearly between Pba (likelihood of evidence given the hypothesis) and Pab (probability of hypothesis given evidence). Ensure that the total probability of the evidence Pb is correctly calculated or provided.
References
Sources
- Wikipedia: Bayes' theorem
- A First Course in Probability by Sheldon Ross
- Wikipedia: Probability
- Sheldon Ross A First Course in Probability
- IUPAC Gold Book: Probability
- Edexcel A-Level Mathematics — Statistics (Probability)