Bayes' rule
Bayes’ rule expresses the probability of a hypothesis given positive-probability evidence as their joint probability divided by the evidence probability.
On this page 8 sections
01Change the reference group#
Bayes' rule answers how plausible a hypothesis is after observing evidence. It reverses a conditional probability by carefully changing the reference group. The chance of evidence within a hypothesis need not equal the chance of that hypothesis within the evidence.
Write for the hypothesis and for the evidence. If and , then the joint probability is . This is the share satisfying both conditions.
If , that joint share occupies of the evidence group. Dividing by the evidence probability makes the whole evidence group the new denominator.
02Prior, likelihood, posterior#
The multiplication rule gives . The definition of conditioning then gives
The prior describes the hypothesis before this evidence. The likelihood measures how probable the evidence would be under it. The posterior describes the hypothesis within the observed evidence group.
P(H)=0.4, P(E | H)=0.5, P(E)=0.25. Find P(H | E).
Show answer and explanation
0.2 / 0.25 = 0.8.
03See the denominator directly#
In 1000 records, 100 satisfy a hypothesis and 90 of those show the evidence. If 300 records show evidence overall, the posterior is . The evidence rate within the hypothesis is . The numerators match; the reference groups differ.
Among 200 uniform records, 50 have H. Within H, the E rate is 0.4. Exactly 40 records have E. Find P(H | E).
Show answer and explanation
20 H-and-E records out of 40: 0.5.
All routes to the evidence belong in , including evidence without . Computing this total from a partition uses the earlier total-probability rule. A posterior above one flags inconsistent supplied probabilities or a calculation error.
04Read the update#
If , the factors cancel and the posterior equals the prior. The evidence does not change this hypothesis's probability. A zero likelihood gives posterior zero when total evidence is positive.
P(H)=0.25, P(E | H)=0.8, P(E)=0.5. “P(H | E)=0.8.” Repair it.
Show answer and explanation
Joint 0.2; divide by 0.5: 0.4.
When , this finite-event ratio is undefined. Within its stated assumptions, Bayes' rule combines prior probability with evidence fit. It does not let a high likelihood erase a very small prior automatically.
Multiply prior by likelihood, then divide by all evidence. The two conditional directions use different denominators.
- Reverse a conditional using the full evidence total.
Sources & further reading
- [1]Pishro-Nik, Introduction to Probability: 1.4.3 Bayes Rule ↗www.probabilitycourse.com · Article
- [2]Dive into Deep Learning, §2.6 Probability and Statistics ↗d2l.ai · Article