Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Bayes' Theorem






Probability After Information


Probability does not stay fixed when new information appears. What we believe about a situation often changes once evidence is observed, data is collected, or a condition becomes known. Bayes' theorem captures this process in a precise and consistent way.

At its core, Bayes' theorem describes how probabilities should update when we move from what we believed before seeing evidence to what we should believe after. It connects prior knowledge with new information and explains how both should be combined rather than treated separately.

This idea is not an add-on to probability theory. Bayes' theorem sits at the intersection of conditional probability, total probability, and independence, tying them together into a single update mechanism. The sections that follow show how this connection works and why Bayes' theorem plays such a central role in probabilistic reasoning.

Key Terms

Conditional ProbabilityP(AB)P(A \mid B), the quantity Bayes' theorem inverts
Probability Measurethe function PP underlying all terms in the formula
Disjoint Setspartition elements must be disjoint
Eventthe observed evidence AA and the hypotheses BjB_j

See All Probability Definitions


How Information Changes Probability


Bayes' theorem appears in situations where we observe something directly, but care about something that is not directly visible. We see evidence, data, or outcomes, while the underlying cause or explanation remains uncertain.

In many problems, the probability of observing evidence given a cause is easier to assess than the probability of the cause given the evidence. This asymmetry creates a gap: we know how likely the evidence is under different scenarios, but we want to reason in the opposite direction.

Bayes' theorem provides the bridge between these two perspectives. It shows how information flows from what we can observe to what we want to infer, allowing probabilities to be updated in a principled and consistent way.

Bayes' Theorem Explained in Words


Bayes' theorem describes how to update the probability of a situation once new information is taken into account. It explains how what we believed before should be adjusted after an observation is made.

The idea is simple in principle. We start with an initial assessment of how likely different possibilities are. We then consider how compatible each possibility is with what we observed. Finally, these assessments are combined and rescaled so that the updated probabilities remain consistent.

This verbal description captures the essence of Bayes' theorem before any symbols appear. The formula that follows is simply a precise way to express this update process using conditional probability.

Connection to Conditional Probability


Bayes' theorem is built entirely from conditional probability. It does not introduce a new type of probability or a separate rule. Instead, it reorganizes conditional probabilities to answer a different kind of question.

Conditional probability tells us how likely one event is when another has occured already. Bayes' theorem takes this idea and reverses the direction: it relates the probability of a cause given an observation to the probability of observing that outcome given the cause.

Because of this, Bayes' theorem cannot be understood in isolation. It is a direct consequence of how conditional probability works, and its meaning becomes clear only when conditioning is already familiar.

Bayes' Theorem Notation

Notation

Bayes' Theorem Notation

Bayes' theorem introduces no new marks — every symbol in it is already a conditional probability. What it adds is roles: the same P()P(\cdot) expressions read as prior, likelihood, evidence and posterior depending on where they stand, and the notation's whole job is keeping the bar's two directions from trading places. Every mark here is catalogued among the probability symbols.
The given-bar P(AB)P(A \mid B) and the joint P(AB)P(A \cap B) come from conditional probability notation, P()P(\cdot) itself from the probability function, the complement mark AcA^c from set operations, and the summation sign from sequence notation.
P(AB),  P(BA)P(A \mid B),\; P(B \mid A)
the probability of A given B — and of B given A
The same given-bar, standing in opposite directions: one conditions on the evidence, the other on the hypothesis. Bayes' theorem is the exchange rate between the two — it computes the direction you want from the direction you can measure.
CasesThe likelihood direction P(BA)P(B \mid A) is usually the computable one — a model says how the evidence behaves under each scenario; the posterior direction P(AB)P(A \mid B) is usually the question being asked. The formula below converts one into the other.
Do not confuseEach other — the transposed conditional, first row of the Common Mistakes table below. A test with P(positivedisease)=0.99P(\text{positive} \mid \text{disease}) = 0.99 says nothing by itself about P(diseasepositive)P(\text{disease} \mid \text{positive}), which can be small when the disease is rare; in courtroom form this is the prosecutor's fallacy.
P(A)P(AB)P(A) \to P(A \mid B)
from the prior of A to the posterior of A given B
One event, two probabilities: bare P(A)P(A) carries no bar — nothing assumed — and P(AB)P(A \mid B) is the same event re-measured once BB is in hand. "Prior" and "posterior" are positions relative to the evidence, not points in time.
CasesEvidence stacks on the right of the bar, P(AB1B2)P(A \mid B_1 \cap B_2), or arrives in rounds — each round's posterior serves as the next round's prior; hypothesis-flavored texts trade A,BA, B for H,EH, E (hypothesis, evidence) or H,DH, D (data), changing letters and nothing else.
Also writtenBayesian statistics writes the pair as densities over a parameter: π(θ)\pi(\theta) for the prior and π(θx)\pi(\theta \mid x) for the posterior, with the distribution families supplying the shapes; the objectivist school writes even the prior conditionally, P(AI)P(A \mid I), with II the background information.
Do not confuseA timestamp. In sequential use one and the same number is the posterior of this round and the prior of the next — the words name roles in a single application of the formula, not the order in which anything happened.
P(B)=jP(BAj)P(Aj)P(B) = \sum_j P(B \mid A_j)\,P(A_j)
the total probability of B, summed across all the hypotheses
The normalizer. Written compactly it is just P(B)P(B); expanded, it is the law of total probability doing denominator duty — every route to the evidence, weighted by its prior, so the posteriors across all hypotheses sum to one.
CasesCompact P(B)P(B) when the evidence's probability is known outright; the two-case split P(BA)P(A)+P(BAc)P(Ac)P(B \mid A)\,P(A) + P(B \mid A^c)\,P(A^c) when there is only a hypothesis and its complement; the indexed sum when a full partition A1,,AnA_1, \dots, A_n competes.
Also writtenNot at all: P(AB)P(BA)P(A)P(A \mid B) \propto P(B \mid A)\,P(A) — "posterior proportional to likelihood times prior" — postpones the division and normalizes at the end, the standard spelling in Bayesian computation.
Do not confuseAn independent input. P(B)P(B) is assembled from the same priors and likelihoods that fill the numerator — supplying it from elsewhere double-counts the evidence; omitting it leaves products that no longer sum to one, the Common Mistakes table's final row.
O(AB)=LR×O(A)O(A \mid B) = \mathrm{LR} \times O(A)
posterior odds equal the likelihood ratio times the prior odds
Bayes with the denominator cancelled: state the theorem for AA and for AcA^c and divide — P(B)P(B) drops out. Odds are the ratio O(A)=P(A)/P(Ac)O(A) = P(A)/P(A^c), and the likelihood ratio LR=P(BA)/P(BAc)\mathrm{LR} = P(B \mid A)/P(B \mid A^c) carries the entire weight of the evidence in one number.
CasesIndependent pieces of evidence multiply their ratios one after another — the cleanest spelling of sequential updating; two-hypothesis problems, a diagnosis against its absence, are its natural habitat.
Also writtenΛ\Lambda for the likelihood ratio in detection and engineering texts; the Bayes factor in statistical model comparison — the same ratio, renamed by tradition.
Do not confuseProbability on the wrong scale. O=3O = 3 means 3:13{:}1, i.e. P=3/4P = 3/4 — odds live on [0,)[0, \infty), probabilities on [0,1][0, 1], and feeding one into a slot expecting the other corrupts the update without any visible error.

Bayes' Theorem (The Formula)


Bayes' theorem expresses the update of probability in a single relation built from conditional probability:

P(AB)=P(BA)P(A)P(B)P(A \mid B) = \dfrac{P(B \mid A)\,P(A)}{P(B)}


Each part of the formula has a clear role.

The term P(A)P(A) represents the starting assessment before any information is known.

The term P(BA)P(B \mid A) measures how compatible the observation is with that situation.

The denominator P(B)P(B) ensures that the updated probabilities remain properly scaled.

This formula does not introduce a new rule. It follows directly from the definition of conditional probability and the basic structure of probability theory. The table below pairs each symbol in the formula with its name and the role it plays in the update.
Symbol Name Role in the formula
P(A) Prior the starting probability of A before any evidence is taken into account
P(B|A) Likelihood how compatible the observation B is with the situation A
P(B) Normalization (total probability) the overall probability of B across all hypotheses; keeps the updated probabilities summing to 1
P(A|B) Posterior the updated probability of A after B is observed — the output of the formula

The Role of Total Probability


The denominator in Bayes' theorem is not arbitrary. It plays a precise role: it accounts for all the different ways the observed event could occur. This is exactly the idea captured by total probability.

When an observation can arise from several mutually exclusive situations, total probability combines their contributions into a single overall probability. Bayes' theorem uses this combined value to normalize the update, ensuring that the revised probabilities across all possibilities remain consistent.

Seen this way, Bayes' theorem is not complete on its own. Total probability is the mechanism that makes the update coherent, tying Bayes' theorem directly to how probability is distributed across cases.

Chain Rule Perspective


Bayes' theorem can also be understood as a rearrangement of joint probability. The chain rule expresses a joint event as a product of conditional probabilities taken in a particular order.

Bayes' theorem changes that order. It takes the same joint probability and factors it differently, allowing us to move from the probability of an observation given a situation to the probability of the situation given the observation.

This perspective removes any sense of mystery. Bayes' theorem is not an extra principle layered onto probability; it is a consequence of how joint probabilities can be decomposed and recombined.

When Independence Simplifies Bayes' Theorem


In some situations, the relationship between events is especially simple. When an observation does not depend on a particular situation, independence removes part of the Bayes' formula entirely.

If the observation behaves the same way regardless of whether a situation occurred, then knowing the situation adds no information about the observation. In this case, certain conditional terms collapse, and the update becomes much simpler.

This is powerful, but also risky. Independence assumptions can dramatically simplify reasoning, yet they must be justified. When independence is assumed without support, Bayes' theorem may produce results that look precise but are conceptually wrong.

Examples


1. Diagnostic reasoning
We observe an outcome and want to reason about its cause. Different situations could have produced what we saw, and Bayes' theorem weighs those possibilities according to both how plausible they were beforehand and how well they explain the observation.

2. Classification intuition
An item belongs to one of several categories, and we observe some of its features. Bayes' theorem updates the probability of each category by combining how common the category is with how typical the features are for that category.

3. When intuition fails
People often judge likelihoods by focusing only on how striking an observation is, ignoring how common the underlying situations are. Bayes' theorem corrects this by forcing both aspects to be considered together.

These examples show Bayes' theorem as a reasoning tool rather than a calculation trick. It organizes how probabilities should change when information arrives.

Common Mistakes


Bayes' theorem is often misapplied, not because the formula is difficult, but because its structure is misunderstood.

A frequent mistake is confusing P(AB)P(A \mid B) with P(BA)P(B \mid A). These two quantities describe different questions, and swapping them can completely change the interpretation of a result.

Another common error is ignoring the starting probabilities and focusing only on how well an observation fits a situation. This leads to conclusions that feel intuitive but are mathematically inconsistent.

Independence is also often assumed without justification. Treating terms as independent when they are not can simplify the formula while quietly breaking its meaning.

Finally, the normalization step is sometimes overlooked. Without accounting for all the ways an observation can occur, the updated probabilities cannot be interpreted correctly. The table below pairs each mistake with the correction that prevents it.
Mistake Correction
Confusing P(A|B) with P(B|A) these answer different questions; swapping them reverses the meaning of the result
Ignoring priors and focusing only on fit priors and likelihoods must both be weighed — base rates cannot be discarded just because the evidence is striking
Assuming independence without justification independence can simplify the formula, but treating dependent terms as independent quietly breaks the update
Skipping the normalization step without dividing by P(B) (or summing over all hypotheses), the posterior probabilities will not sum to 1 and cannot be interpreted correctly

Why Bayes' Theorem Matters


Bayes' theorem provides a principled way to revise probabilities when information changes. It formalizes how uncertainty should be updated rather than left to intuition or ad-hoc adjustments.

This update mechanism is central to learning from data, making decisions under uncertainty, and reasoning about hidden causes. It explains how observations influence beliefs without discarding prior structure or introducing inconsistencies.

Because of this, Bayes' theorem underlies a wide range of methods in statistics, data analysis, and probabilistic modeling. Wherever probabilities are revised in light of new information, Bayes' theorem is operating in the background, whether it is stated explicitly or not.

How Bayes' Theorem Fits into Probability


Bayes' theorem does not stand alone. It sits at a junction where several core probability ideas meet.

It relies on the axioms to ensure probabilities are assigned consistently. It is built directly from conditional probability. It uses total probability to account for all possible ways an observation can occur. In special cases, independence simplifies its structure and interpretation.

Seen this way, Bayes' theorem is not an isolated formula, but a structural link that connects many parts of probability into a single coherent update mechanism.

Connections to Other Probability Concepts


Bayes' theorem connects directly to many of the core ideas in probability and helps unify them into a single framework.

Conditional probability provides the basic mechanism Bayes' theorem reorganizes.
Total probability supplies the normalization that keeps updated probabilities consistent.
Independence identifies special cases where the update simplifies.
Chain rule explains Bayes' theorem as a rearrangement of joint probability.
Probability axioms guarantee that the update follows consistent rules.
Random variables and distributions extend Bayes' theorem beyond events to numerical outcomes.

Through these connections, Bayes' theorem acts as a bridge rather than an endpoint, linking foundational principles with practical probabilistic reasoning.

Where Bayes' Theorem Fits — At a Glance


Bayes' theorem is built from several familiar pieces of probability — conditional probability, total probability, the chain rule, independence, and prior knowledge — and contributes a specific update mechanism on top of each. The table below collects these adjacencies, naming what Bayes' theorem draws from each concept and what it adds in return.
Concept What Bayes' theorem draws from it What Bayes' theorem adds in return
Conditional probability the basic mechanism of conditioning on an event a way to reverse the direction of conditioning — from P(B|A) to P(A|B)
Total probability a way to express P(B) as a sum across mutually exclusive hypotheses the denominator that keeps the posterior coherent across all hypotheses
Chain rule a decomposition of the joint probability of A and B a re-factoring of that decomposition that exposes the inverse conditional
Independence cases where P(B|A) equals P(B) a structural simplification: the formula collapses and the update becomes trivial
Prior knowledge an initial assessment of how likely each hypothesis is a principled rule for revising that prior in light of evidence

Bayes' Theorem FAQ

What is the difference between prior and posterior probability?

+
Prior is the probability of a hypothesis before the evidence is taken into account; posterior is the same hypothesis re-measured once the evidence is in hand — P(A) becoming P(A | B). The words name positions relative to the evidence, not moments in time; nothing has to happen in any particular order for the labels to apply.Read more →

Why doesn't a 99% accurate test mean a 99% chance of having the disease?

+
Because 99% accuracy is P(positive | disease), the likelihood, while what you want is P(disease | positive), the posterior. They point in opposite directions. When the disease is rare, the few true positives are swamped by false positives drawn from a much larger healthy population, so the posterior stays small. Ignoring the base rate this way is the prosecutor's fallacy.Read more →

Where does the denominator P(B) in Bayes' theorem come from?

+
From the same priors and likelihoods that build the numerator. It is the law of total probability doing denominator duty: every route to the evidence, weighted by its prior. Supplying P(B) from elsewhere double-counts the evidence; omitting it leaves posteriors that no longer sum to one.Read more →

What is the odds form of Bayes' theorem?

+
Posterior odds equal the likelihood ratio times the prior odds. State Bayes for A and for Aᶜ, then divide: P(B) cancels, leaving no denominator to compute. Watch the scale — odds of 3 mean 3:1, so a probability of 3/4, not 3.Read more →

Can you apply Bayes' theorem more than once?

+
Yes — that is the standard way to handle several pieces of evidence. Apply the formula to the first observation, then use the resulting posterior as the prior for the next round; the same number is the posterior of one step and the prior of the next. In odds form, independent pieces of evidence simply multiply their likelihood ratios.Read more →