How Bayes’ rule updates a belief
Follow a factory’s components into faulty, not-faulty and flagged groups; change sensor assumptions to see why the denominator matters.
Reviewed 2026-10-23
How common was a fault before we looked?
A flagged component might be faulty. Begin with how common faults were before checking, then follow the evidence.
A stipulated factory example, not measured data. Exact counts and labeled groups carry the calculation; no independence assumption is made for repeated sensor checks.
Notes and sources for this step
A prior is a starting probability
The prior describes uncertainty before the new evidence arrives. Here it comes from the assumed defect rate for components in the population being checked.
Use the right population
A factory-wide defect rate might be a poor starting point for a known damaged batch. The base rate must fit the situation in which the evidence is being interpreted.
An illustrative factory
All rates in this example are stipulated and stable. Real sensor performance and defect rates need measurement; sampling uncertainty can affect the result.
Apply each sensor rate to the right group.
Apply detection to faulty parts and false alarms to not-faulty parts. The two rates start with different populations.
A stipulated factory example, not measured data. Exact counts and labeled groups carry the calculation; no independence assumption is made for repeated sensor checks.
Notes and sources for this step
The condition comes after the bar
P(flag | faulty) means the probability of a flag given that the component is faulty. The vertical bar reads 'given'.
A common reversal
A 90% detection rate does not mean 90% of flagged components are faulty. P(flag | faulty) and P(faulty | flag) ask different questions.
Count what the sensor misses
A 90% detection rate also means 10% of faulty components are missed. A 5% false-alarm rate means 95% of sound components are correctly left unflagged.
Follow 10,000 components through the check.
Separate the population, apply each rate to its own group, then gather all components that share the observed flag.
A stipulated factory example, not measured data. Exact counts and labeled groups carry the calculation; no independence assumption is made for repeated sensor checks.
Notes and sources for this step
Apply each rate to its own group
The detection rate applies to the 100 faulty components, while the false-alarm rate applies to the 9,900 sound components. Mixing up those denominators changes the answer.
Why false flags outnumber true flags
The sound group is 99 times larger than the faulty group. A small fraction of that large group can exceed a large fraction of the rare group.
Counts clarify the denominator
The question asks about a component that has already been flagged. The relevant pool is therefore the 585 flags, rather than all 10,000 components or the 100 faulty ones.
Update inside the pool of flags.
The posterior is the updated probability. Restrict attention to every flagged component, then count how many of those are faulty.
A stipulated factory example, not measured data. Exact counts and labeled groups carry the calculation; no independence assumption is made for repeated sensor checks.
Notes and sources for this step
This is the posterior
The posterior is the updated probability after considering the evidence. The flag raises the defect probability from 1% to about 15.38%, while leaving substantial uncertainty.
Bayes’ rule in this example
P(faulty | flag) = P(flag | faulty) × P(faulty) ÷ P(flag). Here it is (0.90 × 0.01) ÷ [(0.90 × 0.01) + (0.05 × 0.99)].
Evidence can matter without proving the claim
Most flagged components are sound in this example, but the flag is still informative: a fault is much more likely after a flag than it was beforehand.
Change the setting. Recalculate the evidence.
Change the prior, detection rate, or false-alarm rate. Watch both the outcome counts and the probability among flags change.
A stipulated factory example, not measured data. Exact counts and labeled groups carry the calculation; no independence assumption is made for repeated sensor checks.
Notes and sources for this step
A higher base rate changes the result
If 10% of components were faulty with the same sensor, 900 of 10,000 would be genuine flags and 450 false flags. Then 900 ÷ 1,350 = 66.67% of flags would indicate faults.
Fewer false alarms also help
At the original 1% defect rate, reducing the false-alarm rate to 1% gives 90 genuine flags and 99 false flags. Then 90 ÷ 189 ≈ 47.62% of flags would indicate faults.
Repeated evidence needs care
Two flags from the same sensor are not automatically independent pieces of evidence. Applying an independence-based calculation to strongly related checks can exaggerate confidence.
Choose the right pool in a new case.
Apply the same reasoning to different counts. Name the group selected by the evidence before calculating.
In a new population of 10,000 components, a check produces 200 flags: 40 are faulty and 160 are not faulty. Which calculation gives the chance of a fault given a flag?
- 40 ÷ (40 + 160)
- 40 ÷ 10,000
- 160 ÷ (40 + 160)
Read the answer
The evidence selects all 200 flags. Forty of those are faulty, so the conditional chance is 40 ÷ 200 = 20%.
Notes and sources for this step
Let the condition choose the denominator
The condition “given a flag” restricts attention to flagged cases. Within that pool, count the cases satisfying the claim, here faulty. The same logic applies even when the numerical rates and starting population change.
Keep the questions distinct
The chance of a flag among faulty parts and the chance of a fault among flagged parts use different denominators. Bayes’ rule connects these questions; it does not make them interchangeable.
Filter by evidence. Count the target cases.
Start with the right population, apply evidence rates within each group, and divide target cases by all cases matching the evidence.
Stable illustrative rates. A useful signal changes a probability without proving a claim; correlated repeated checks need a separate model.
Notes and sources for this step
Why the prior remains important
A rare underlying condition can produce fewer genuine positives than a small false-positive rate acting on a much larger not-faulty group. The relevant base rate must fit the situation being checked.