Data & ComputingProbability

Bayes' Theorem

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.

Understand the formulaReview the study guideOpen the full walkthrough

This public page keeps the study guide visible while the app adds premium walkthroughs, practice, and saved tools.

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.

Remember it

Memory Aid

Phrase: A given B is B given A, times A on top, B down to stay.

Visual Analogy: A detective finding a fingerprint: the guilt (A|B) depends on the match's accuracy (B|A) and the suspect's history (A), divided by the total fingerprint pool (B).

Exam Tip: If P(B) isn't provided, you must calculate it using the Law of Total Probability: P(B) = P(B|A)P(A) + P(B|not A)P(not A).

Why it makes sense

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

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)

Posterior P(A|B)
Likelihood P(B|A)
Prior P(A)
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.
1

Start from conditional probability:

Conditional probability is the probability of both events occurring divided by the probability of the condition.

2

Write the same intersection the other way:

Rearranging P(B A)= gives this expression for the intersection.

3

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)

Where it shows up

Real-World Context

Updating disease probability after a test.

Avoid these traps

Common Mistakes

  • Swapping P(A|B) and P(B|A).
  • Forgetting to divide by P(B).

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.

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.