Alex Oberneyer

Interactive essays / 01

A belief should
move with evidence.

Turn an alarm into an updated belief. Explore base rates, likelihood ratios, and why repeating the same evidence does not make it stronger.

BAYESIAN INFERENCE2 SMALL EXPERIMENTSBASIC PROBABILITY · MATH EXPLAINED INSIDE

An alarm catches 90% of faults.
That does not mean 90% of alarms are faults.

01 / Count first

An alarm is a question.
Count the possible answers.

A factory uses an alarm to find faulty sensors. It catches 90% of faults. A sensor triggers the alarm. How confident should you be that it is faulty?

The missing facts matter: only 1% of sensors are faulty, and 5% of working sensors also trigger an alarm. A sensitive detector can still send more false alerts than true ones when faults are rare.

Start with 10,000 sensors. Follow each group into the alarm queue. Then ask: among the alarms, how many came from a fault?

Experiment 01

Change the population. Keep track of the denominator.

All counts are expectations in a hypothetical population of 10,000 sensors. Fractional counts are possible.

1%
0%100%
90%
0%100%
5%
0%100%
15.4%
FAULT PROBABILITY AFTER AN ALERT
True alertsFalse alerts

90 true alerts out of 585 total alerts.

100 tiles represent the alarm queue, rounded to whole percent. Exact expected counts are below.

Faulty sensors10090 trigger an alert
Working sensors9,900495 trigger an alert
Total alerts585True + false alerts
Faults missed100.1% of non-alerts are faulty

Try increasing the base rate to 20%. The detector has not improved. Its alerts now mean something different because it is testing a different population.

02 / Reverse the question

The denominator does the work.

Let F mean “faulty” and A mean “alarm.” The vertical bar means “given.” P(A | F) asks how often faulty sensors raise alarms. P(F | A) asks how often alarms indicate faults. These reverse the direction of the question.

P(F | A) = p × s / [p × s + (1 − p) × f]p = P(F), the prior fault probability; s = P(A | F), sensitivity; f = P(A | not F), the false-positive rate. All are probabilities from 0 to 1.

The numerator counts the fault-and-alarm cases. The denominator counts every route to an alarm. The quotient is the posterior: your updated probability after observing it.

At the starting settings, this is 0.009 / (0.009 + 0.0495), or 15.4%. The alarm is evidence for a fault: it moves the probability well above 1%. But “evidence for” does not mean “almost certain.”

What happens at zero or 100%?

If no alarms are possible under the model, conditioning on an alarm is undefined. The experiment says “Undefined,” rather than dividing by zero. If an alarm can only come from a fault, its posterior is 100%.

A prior of exactly zero rules a hypothesis out. Ordinary finite evidence cannot revive it. Use such certainty only when the model actually excludes that possibility.

03 / Update again

Evidence multiplies odds.

For several pieces of evidence, odds make the bookkeeping easier. A probability of 10% means odds of 1 to 9: one chance for the hypothesis for every nine against.

Posterior odds = prior odds × likelihood ratioOdds = p / (1 − p). Likelihood ratio = P(evidence | hypothesis) / P(evidence | alternative). Convert back with p = odds / (1 + odds).

Evidence is useful when it is more expected under one explanation than another. An unusual observation can be equally unusual under both, in which case it does not distinguish them.

Experiment 02

Let evidence accumulate.

A separate example starts with a 10% hypothesis probability. Each button adds one modeled observation.

Evidence three times as likely under the hypothesis multiplies its odds by 3. Evidence three times as likely under the alternative divides its odds by 3.

No observations yet.

0 of 20 observations used.

10.0%
UPDATED HYPOTHESIS PROBABILITY

Odds: 0.111 to 1

Start at 10%. Add an observation.

Multiplying these fixed ratios assumes observations are conditionally independent given each hypothesis. Three websites quoting one report are not three independent reports.

Three supporting observations take this example from 10% to 25%, then 50%, then 75%. One opposing observation cancels one supporting observation because their likelihood ratios are reciprocal, not because every argument deserves equal weight.

With dependent evidence, Bayes still works. The next likelihood must be conditioned on what you already know. Re-reading an identical result adds no new observation.

04 / Use with care

A model is part of the claim.

Bayesian inference connects a model to evidence. It does not supply the right model, trustworthy measurements, or the cost of being wrong.

Use it forAsk first
DebuggingWould this failure be more likely under a network problem or an application bug?
Scientific evidenceDo the competing models make different predictions? Could both be wrong?
PerceptionHow reliable is this sensory cue? The probability model alone does not establish a neural mechanism.
Taking actionWhat are the costs and benefits? A posterior is an input to a decision, not a decision rule.

The detector assumes stable error rates and a relevant prior population. A change in operating conditions can break that assumption. Estimate those quantities, track their uncertainty, and check predictions against new data.

Causal inference asks what would change under an intervention. A high posterior for an association does not establish that intervention’s effect. Information theory measures uncertainty and surprise; a surprising observation is not automatically strong evidence for your favorite explanation.

05 / Retrieve & transfer

What changed your mind?

Keep one idea

Evidence changes relative plausibility. Always keep the alternative explanation in the denominator.

Try answering before opening the explanations. Return another day and explain the mechanism without the page.

1. How can a useful alarm still be wrong most of the time?

With rare faults, a small false-positive fraction of a large working population can exceed the true alerts. In the starting example the alarm improves the probability from 1% to 15.4%, yet 495 of 585 alerts are false.

2. What if an observation is equally likely under both hypotheses?

Its likelihood ratio is 1, so the odds stay unchanged. Rarity alone does not determine how strongly evidence distinguishes hypotheses.

3. Transfer: five dashboards report the same sensor reading. Should you update five times?

No. If they merely repeat one reading, the later dashboards provide no additional evidence once the first is known. You need a model of their dependence before combining partly overlapping measurements.

4. Transfer: a detector works in the factory but fails outdoors. Is the prior the only problem?

No. Temperature or moisture may change sensitivity and false-positive rates as well as fault prevalence. Reusing the old likelihoods can make a precise posterior badly wrong.

Sources & scope

Follow the ideas back.

A two-hypothesis introduction. The detector uses known conditional rates; the accumulator uses fixed likelihood ratios and conditional independence. It does not estimate uncertain parameters or compare open-ended model families.

  1. MIT 18.05 · Bayesian Updating: Odds
    Odds, likelihood ratios, and the difference between stronger evidence and high posterior probability.
  2. David MacKay · Information Theory, Inference, and Learning Algorithms
    Chapter 2 develops probability and inference; chapter 3 connects inference to evidence and hypothesis testing.

These are original teaching examples, not empirical datasets. This page makes no network requests and stores no answers. Its experiments work offline once downloaded; navigation and source links need the corresponding files or a connection.