Learn AI.
Build AI Systems · ORIGINAL LEARN AI LESSON

Update beliefs from evidence.

Use sensor frequencies to distinguish detection from posterior probability and test how base rates and repeated evidence change a belief.

By the end: Compute a posterior from a complete frequency table, handle impossible evidence explicitly, and explain when two readings justify multiplying conditional likelihoods.

01 · TRY

Start with something concrete.

A sensor detects 90% of faulty parts, but faults are rare and healthy parts sometimes trigger alarms. Before accepting an alarm as proof, count the healthy parts that could also have caused it.

Try the interactive model ↓
02 · PREDICT
Before you experiment

A sensor detects 90% of faults. Does an alarm mean the part has a 90% chance of being faulty?

A sensor detects 90% of faults. Does an alarm mean the part has a 90% chance of being faulty?
03 · EXPERIMENT

Change one thing. Watch what follows.

  1. On rare faults, trace 100 faulty and 9,900 healthy parts into the four sensor outcomes.
  2. Keep sensor rates fixed and change the prior from 1% to 20%. Explain the changed alarm-group composition.
  3. Switch the observation to quiet and recompute the denominator using both quiet cells.
  4. Set equal detection and false-alarm rates. Check whether a possible reading changes the prior.
  5. Compare two conditionally independent alarms with a copied alarm; name the assumption behind multiplying likelihoods.
  6. Load the impossible-alarm case and explain why the posterior is undefined rather than zero. Export your comparison.

Loading this browser experiment…

04 · UNDERSTAND

Count where an alarm could come from

Imagine 10,000 manufactured parts. Suppose 1% are faulty: 100 faulty and 9,900 healthy. A sensor detects 90% of the faulty parts, so we expect 90 genuine alarms and 10 missed faults. It also alarms on 5% of the healthy parts: 495 false alarms and 9,405 correctly quiet parts.

Among the 585 alarms, only 90 come from faulty parts. The faulty fraction of the alarm group is 90 ÷ 585, about 15.38%. That is very different from the 90% detection rate. Both numbers are correct under the assumptions; they answer different questions.

These are authored probabilities and expected frequencies, not measurements of a deployed sensor. A finite real batch would vary, and the rates themselves would need evidence. Changing the imagined cohort size scales the expected counts without changing the proportions. At some settings an expected count is fractional; this does not mean someone observed a fraction of a part.

Name the three probabilities

The prior probability is the belief before this sensor reading. Here P(F) = 0.01, where F means “the part is faulty.” It describes the intended population. A rate measured in a factory’s repair queue might be a poor prior for parts freshly leaving production.

The likelihood describes how probable the observation is under a specified hidden state. If A means “alarm,” then P(A | F) = 0.90 is the detection rate. The vertical bar reads “given”: probability of alarm given a faulty part. P(A | H) = 0.05 is the false-alarm rate among healthy parts, where H means “healthy.” This two-state model assumes every part is in exactly one of F or H.

The posterior probability updates the hidden-state belief after seeing the evidence. P(F | A) asks for the faulty share of the alarm group. It is not P(A | F): the conditioning event and therefore the denominator have changed.

The lab’s first bar uses all 10,000 parts as its denominator. The second expands the selected reading group to a full-width bar. Its denominator is smaller and explicitly labelled. Compare proportions within each row; do not interpret equal drawn widths across rows as equal numbers of parts.

Multiply along a path, then normalize across explanations

An alarm can arise through two disjoint paths: faulty and detected, or healthy and falsely alarmed. Multiply the probability of each underlying state by the likelihood of an alarm in that state:

P(F,A)=P(F)P(A∣F)=0.01×0.90=0.009P(F,A)=P(F)P(A\mid F)=0.01\times0.90=0.009

Here P(F,A) is the joint probability of being faulty and producing an alarm. The healthy-alarm contribution is 0.99 × 0.05 = 0.0495. Add the two to obtain the total alarm probability, 0.0585. The posterior is the faulty contribution divided by that total:

P(F∣A)=P(F)P(A∣F)P(F)P(A∣F)+P(H)P(A∣H)P(F\mid A)=\frac{P(F)P(A\mid F)}{P(F)P(A\mid F)+P(H)P(A\mid H)}

Read this as: among all ways an alarm could happen, what share came from faulty parts? The numerator is 0.009; the denominator is 0.009 + 0.0495. The result is approximately 0.1538, or 15.38%. Dividing the expected counts 90 by 585 gives the same answer because the common cohort size cancels.

The total evidence probability must be positive for this finite conditional-probability calculation. The denominator is not a numerical inconvenience to patch with an arbitrary small constant; it describes whether the selected observation can happen in the stated model.

Change the population before changing the sensor

Keep detection at 90% and false alarms at 5%, but change the prior fault rate to 20%. Out of 10,000 parts, we now expect 1,800 genuine alarms and 400 false alarms. The posterior becomes 1,800 ÷ 2,200, about 81.82%. The sensor’s conditional rates did not change. The population mix did.

This is why quoting detection performance alone can mislead a decision-maker. It leaves out both the base rate and the other way an alarm can arise. A posterior also does not automatically tell you what action to take. Inspection cost, missed-fault cost, available alternatives and the quality of the rate estimates belong in a separate decision problem.

Select a quiet reading next. Under the original rare-fault settings, the relevant cells are 10 missed faults and 9,405 healthy quiet parts. The posterior is 10 ÷ 9,415, about 0.106%. You must change the entire evidence group, not merely replace the numerator while keeping the alarm denominator.

Uninformative and impossible observations

If detection and false alarms are equal, a possible reading is equally likely in either hidden state. It supplies no information for distinguishing them, so the posterior stays at the prior. If alarms are more likely on healthy parts than on faulty ones, an alarm can lower the fault probability. “Alarm” is a label; the likelihoods determine the information it conveys.

Now set both alarm rates to zero and select an alarm. Both joint contributions are zero. There is no alarm group in this model, so its faulty share is undefined, not zero. If a real sensor produces an observation that the model says is impossible, investigate the model, rates, data pipeline or event description. Dividing zero by zero does not justify certainty about either state.

The endpoint priors 0 and 1 need the same care. A nonzero-likelihood observation cannot create positive posterior mass for a state assigned exactly zero prior mass. If the observation also excludes every state with positive prior mass, conditioning is undefined. Extreme prior assumptions can therefore be fragile.

Do two alarms provide two pieces of evidence?

The paired-reading control concerns the same part with an unchanged hidden state. Under conditional independence, one reading does not change the probability of the other after the true state is specified. The two readings have the same detection and false-alarm rates in this exercise.

For two independent alarms given a fault, the likelihood is 0.90 × 0.90 = 0.81. Given a healthy part, it is 0.05 × 0.05 = 0.0025. With the 1% prior, expected counts among 10,000 parts are 81 faulty double alarms and 24.75 healthy double alarms. The resulting posterior is about 76.60%.

This multiplication requires independence within both hidden-state groups. It does not imply the two readings are independent across a mixed population: they share information about the same hidden fault. Shared interference or correlated failure modes could also invalidate the assumed within-state independence.

Choose the exact-copy model instead. A duplicated alarm has the same joint likelihood as the first alarm, so its posterior remains 15.38%. The duplicated dashboard entry is not a second measurement. A first alarm followed by a quiet copy is impossible under this exact-copy model; the lab reports an undefined posterior instead of inventing a result. These are two deliberately different dependence assumptions, not competing claims about a measured device.

Practice, then audit the assumptions

The separate practice batch gives 16 alarms among 20 faulty parts and 49 among 980 healthy parts. Work from those counts before checking feedback. The question is the faulty fraction of all alarms, so choose the alarm-group denominator. A detection-rate calculation answers a different question.

For guided evidence, export rare/common population comparisons and explain each denominator. For implementation evidence, reconstruct the four cells, check that they sum to the cohort total, and test zero-probability, equal-likelihood and copied-reading cases without substituting a fabricated posterior. For a decision brief, state where a credible prior and sensor likelihoods would come from, which population they describe and why repeated records do or do not constitute new evidence.

Three temporary captures and a bounded note can be exported before leaving. They are public practice, not authenticated independent assessment. No model is trained, and no required path percentage changes. Human review and learner pilots remain pending.

05 · APPLY
Check your understanding

A monitoring dashboard displays the same alarm twice because the second record is a copy. How should this affect the posterior?

A monitoring dashboard displays the same alarm twice because the second record is a copy. How should this affect the posterior?
06 · CONTINUE

Take this idea with you.

Bayes rule normalizes the ways evidence can arise. Keep prior, likelihood and posterior distinct; impossible evidence and dependent readings require explicit treatment.

My work
Learn AI · Understand by doing.Loading local progress…Copyright (c) 2026 Mobi Weave, Inc. All rights reserved