Prior, likelihood and posterior
A is the proposed group membership and B the observation. The prior P(A) describes A before observing B; the likelihood P(B|A) describes the observation within A; the posterior P(A|B) describes A among observed B cases. Likelihood and posterior therefore use different denominators. Here likelihood is a conditional probability, not already a probability of the hypothesis.[2]
In the two-group model p=P(A), s=P(B|A), f=P(B|not A) and q=P(A|B). The denominator is the total probability of B.[2]
The two-group derivation using both event conditionals initially has 0<p<1. A parametrized model may additionally allow p=0 or p=1: the empty group’s parameter is then not an event conditional that can be calculated from events, and carries zero weight in the product. The posterior still requires e>0. Probabilities are dimensionless; 5% is inserted as 0.05.[1]
Why the denominator needs both groups
The events A∩B and not A∩B are disjoint and together form B. Their probabilities therefore add to e. The second denominator term is not an informal adjustment: it is precisely the observation contributed by the other group. With several exhaustive disjoint groups, sum over all of them. Dependent repeated signals cannot automatically be multiplied again using the same likelihoods.[2]
From q[ps+(1−p)f]=ps obtain qf=p[s(1−q)+qf]. Positive s and f ensure this unique inverse for 0≤q≤1.
With f=0 and s>0 every possible B case belongs to A: q=1 for all p>0. The posterior alone then does not determine a unique prior. With s=0, q=0 wherever e>0. The calculator therefore separates forward calculation, joint probability, evidence and the more restricted inverse for the prior. It evaluates a hypothetical probability model and does not claim an individual diagnosis.
Counting and recovering a prior
A rare manufacturing feature
- Given
- In an idealized stock 1% of parts have feature A. A sensor signals B for 90% of A parts and 5% of other parts.
- Find
- What fraction of signalled parts have A?
Form both signal weights and use their sum as the posterior reference group.
First form both signal routes.
Add the complete signal probability.
Form the desired proportion within B.
Result: The posterior is about 15.38%, and the total signal rate is 5.85%.
Check: In a proportional model stock of 10,000 parts there are 100 A parts giving 90 signals and 9,900 others giving 495 signals. The ratio 90/585=2/13 confirms the result. The complete two-way table has cells 90 for A and B, 10 for A and not B, 495 for not A and B, and 9,405 for neither. These are model counts, not an observed sample.
Which prior gives the specified posterior?
- Given
- s=0.8, f=0.1 and desired posterior q=2/3.
- Find
- Find p and check the forward calculation.
Use the uniquely invertible formula.
Insert the fractions and simplify.
Calculate both routes with this prior.
Result: A prior of 20% gives the desired posterior.
Check: The evidence 0.24 is positive and both route contributions are nonnegative. The posterior 2/3 exceeds the prior 1/5 because B is eight times as likely within A as outside it.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Five exercises on direction and base rates
Calculate · Foundation
p=0.2, s=0.7, f=0.1. Calculate evidence and posterior.
Show hint
Calculate ps and (1−p)f separately.
Learning goal: Use both denominator contributions.
Show solution and calculation
ps=0.14 and (1−p)f=0.08; e=0.22. q=0.14/0.22=7/11≈63.64%.
Check: 14 true and 8 other signals give the same ratio 14/22.
Error analysis · Foundation
Someone says: “s=90%, so 90% of all signals come from A.” What information is missing?
Show hint
Compare the reference groups.
Learning goal: Do not confuse likelihood with posterior.
Show solution and calculation
s=P(B|A) uses A parts as its denominator.
The desired P(A|B) uses all signals.
The prior and outside-A signal rate, or total evidence, are missing.
The first example disproves the claim with q=2/13 despite s=90%.
Rearrange · Application
s=0.75, f=0.25 and q=0.6. Find p.
Show hint
Use qf/[s(1−q)+qf].
Learning goal: Recover the prior uniquely.
Show solution and calculation
p=0.15/(0.30+0.15)=1/3.
Check: ps=1/4 and (1−p)f=1/6, giving (1/4)/(5/12)=3/5=0.6.
Interpret · Application
For p=0.4 and s=f=0 a posterior is requested. What happens?
Show hint
Check e first.
Learning goal: Distinguish zero probability from missing information.
Show solution and calculation
e=0.4·0+0.6·0=0.
The observation has probability zero in the model; 0/0 defines no posterior.
Neither 0% nor 50% follows from the formula.
Transfer · Challenge
A second signal C is observed after B. Can the same s and f always be reused?
Show hint
Which groups now contain the already observed B cases?
Learning goal: Use appropriate dependencies for further signals.
Show solution and calculation
No.
In general use P(C|A∩B) and P(C|not A∩B); the second-step prior is P(A|B).
Only appropriate conditional independence and identical signal laws make the new likelihoods equal to the original ones.
A signal repeated from the same stored measurement, for example, provides no independent extra information.
Check your understanding with the formula’s reference test.
7 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Which neighbouring formula answers which question?
Conditional probability first defines the change of denominator. Expected value then summarizes an already specified distribution by a mean. The Binomial distribution describes a fixed number of independent trials sharing p; it does not automatically require Bayes.
Sources for this explanation
Quanta · Updated November 1, 2026
- OpenStax Introductory Statistics 2e §3.3: multiplication, conditional ratio and independence
- Harvard Stat110 midterm review, pages3–4: total probability, Bayes and expectation
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Authored a full German-English article with an original explanation, two worked examples and five varied exercises.
Cite this reference page
Quanta. Bayes' Theorem. Updated November 1, 2026. https://quanta-study.de/en/formula-sheet/bayes-theorem
When citing a specific scientific statement, also cite the specialist source linked to that statement.