Bayes' rule.

Comprehensive study notes, diagrams, and exam preparation for Bayes' rule..

Bayes' rule

Definition

Bayes' rule is a mathematical formula used to find a conditional probability by reversing the direction of known information.

Where:

  • = probability of event given that event has occurred
  • = probability of event given that event has occurred
  • = prior probability of
  • = total probability of

A more complete version is:

This is especially useful when event can happen for more than one reason.


Main Content

1. Conditional Probability and Reversing Information

  • Conditional probability means the probability of one event happening given another event has already happened. For example, means the chance of rain if the sky is cloudy.
  • Bayes' rule is important because it allows us to reverse the conditioning. Often we know more easily than . Bayes' rule helps convert one into the other.

To understand why this matters, suppose:

  • = a person has a disease
  • = a test comes back positive

Doctors often know:

  • how likely a positive test is if someone is sick, , but they really want:

  • how likely someone is sick if the test is positive,

These two probabilities are not the same. Bayes' rule gives the correct relationship between them.

A useful way to think about it is:

This means the new probability depends on:

  • the earlier belief,
  • the strength of the evidence,
  • and the need to normalize by the total probability of the evidence.

2. Prior, Likelihood, and Posterior

Prior probability

  • is the belief about an event before observing new data. It represents background knowledge or initial expectation. For example, if only 1 out of 1000 people have a rare disease, then that 0.1% is the prior.

Likelihood

  • measures how likely the observed evidence is under a given hypothesis. In a medical test, if a sick person has a 99% chance of testing positive, then the likelihood is very high for the disease hypothesis.

These two combine to form the posterior probability, which is the updated belief after considering the evidence.

Bayes' rule can be remembered as:

Prior

  • : what we already think

Evidence

  • : what we observe

Posterior

  • : what we conclude after updating

Example: If a disease is very rare, even a highly accurate test may produce many false positives compared with true positives. So a positive result does not automatically mean the disease is likely. Bayes' rule balances:

  • the rarity of the disease,
  • the accuracy of the test,
  • and the meaning of a positive result.

This is why Bayes' rule is often surprising to people: it shows that base rates matter. A test can be accurate and still not guarantee a high probability of disease if the condition itself is uncommon.


3. Total Probability and Real-Life Interpretation

  • The denominator in Bayes' rule, , is the total probability of the observed evidence. It ensures that the final probability is properly scaled and lies between 0 and 1.
  • Often, is found using the law of total probability, especially when evidence can arise from multiple causes.

If event can happen either because happened or because did not happen, then:

This means we add up all possible ways the evidence can occur.

Example: Medical Test

Suppose:

  • 1% of people have a disease:
  • Test sensitivity:
  • False positive rate:

We want , the probability of disease given a positive test.

Using Bayes' rule:

So even with a positive result, the probability of actually having the disease is only about 16.67%.

This shows why Bayes' rule is essential in real situations: it prevents overconfidence based only on test results.

Visual Intuition

Prior belief + new evidence -> Updated belief

Rare disease
   |
   v
Positive test
   |
   v
Not always "likely disease"
because false positives also matter

Bayes' rule is not just a formula; it is a framework for thinking logically under uncertainty.


Working / Process

1. Identify the hypothesis and evidence

  • Decide what event you want to find the probability of.
  • Let that event be , and the observed evidence be .
  • Example: = person has disease, = test is positive.

2. Collect the probabilities needed

  • Find the prior probability .
  • Find the conditional probability .
  • Find the probability of evidence under the alternative, , if needed.
  • Use the law of total probability to calculate .

3. Apply Bayes' rule and interpret the result

  • Substitute values into the formula:

  • Simplify carefully.

  • Interpret the answer as an updated probability, not just a mechanical result.
  • Check whether the result makes sense in context.

Step-by-step example

Suppose:

First calculate:

Then:

So the updated probability of given is 0.4.

This process shows that evidence can increase or decrease belief depending on how strongly it supports the hypothesis compared with other possible explanations.


Advantages / Applications

Improves decision-making under uncertainty

Bayes' rule helps make rational choices when information is incomplete. It is used in risk assessment, forecasting, and planning.

Widely used in medical diagnosis and testing

It helps doctors interpret test results correctly by accounting for disease prevalence and test accuracy.

Foundation of modern machine learning and AI

Bayesian methods are used in spam filtering, classification, prediction, and probabilistic reasoning.

Useful in everyday reasoning

It helps people think more carefully about evidence, avoiding mistakes caused by ignoring base rates.

Supports updating beliefs as new data arrives

This is valuable in science, finance, weather prediction, and experimental analysis.

Helps compare competing explanations

When multiple causes can explain the same evidence, Bayes' rule identifies which is more plausible.


Summary

  • Bayes' rule updates probability using new evidence.
  • It connects prior belief, likelihood, and posterior probability.
  • It is especially useful when interpreting evidence in uncertain situations.

  • Important terms to remember

  • Prior
  • Likelihood
  • Posterior
  • Conditional probability
  • Total probability