PROBABILITY AND SOLID GEOMETRY CHECKS

Checking a Bayes update through prior and posterior odds

A Bayes update can be checked by multiplying prior odds by a likelihood ratio. This guide works a toy model in which a prior of 0.2 and likelihoods of 0.8 and 0.2 lead to posterior odds of one to one.

Why check a Bayes update with odds

Bayes theorem in probability form involves a numerator, a denominator and a sum of two terms, and slips are easy to make. The odds form replaces that with one multiplication: posterior odds equal prior odds times the likelihood ratio. Running both forms on the same inputs gives two independent routes to the same posterior probability. If they disagree, one calculation has an error. The comparison is cheap and catches the usual mistakes, such as swapped likelihoods or a forgotten complement. It also builds intuition. In probability form the evidence term is easy to mistake for a constant, while in odds form the structure is plain: evidence either multiplies the odds up when the ratio is above 1, leaves them alone when it equals 1 or pushes them down when it is below 1. A ratio of exactly 1 means the signal carries no information about the categories.

The abstract setup

The model uses two categories and a signal. The prior probability of the first category is 0.2, so the second has 0.8. The likelihood of the signal given the first category is 0.8, and given the second it is 0.2. The Bayes theorem tool takes the prior, the likelihood and the alternative likelihood. It computes evidence = likelihood × prior + alternative × (1 − prior) and posterior = likelihood × prior / evidence. For these values, the evidence is 0.8 × 0.2 + 0.2 × 0.8 = 0.16 + 0.16 = 0.32, and the posterior is 0.16 / 0.32 = 0.5.

Converting probabilities to odds

Odds compare the favorable share with the unfavorable share. A probability of 0.2 gives parts of 0.2 and 0.8, which is one to four, since 0.2 / 0.8 = 0.25. The probability to odds converter returns the two parts, with favorable = p and unfavorable = 1 − p. A probability of 0.5 gives 0.5 and 0.5, which is one to one. Odds of a to b translate back to probability as a / (a + b). Moving between the two forms is arithmetic only and loses no information. Odds can be written as a ratio of whole numbers, 1 to 4, as a single number, 0.25, or as a fraction of the total, 0.2. The tool reports the last of these as two parts, and writing the parts as a pair is the clearest way to compare with the odds from the likelihood ratio. One caution: odds of 1 to 4 and a probability of 1 in 4 are different statements, since 1 to 4 corresponds to a probability of 0.2, not 0.25.

The likelihood ratio and the product

The likelihood ratio compares how probable the signal is under each category: 0.8 / 0.2 = 4. Multiplying the prior odds of 1 to 4 by 4 gives posterior odds of 4 to 4, which reduces to 1 to 1. Converting back, 1 / (1 + 1) = 0.5, the same posterior as the probability form. The ratio of 4 acts as a multiplier of 4 on the odds, which moves the odds from one to four up to one to one. The two forms agree because they are algebraically the same statement written differently.

A second example with a low prior

Let the prior be 0.01, the likelihood 0.9 and the alternative likelihood 0.05. The probability form gives evidence = 0.9 × 0.01 + 0.05 × 0.99 = 0.009 + 0.0495 = 0.0585 and a posterior of 0.009 / 0.0585 = 0.15385. In odds, the prior is 0.01 / 0.99, or 1 to 99, and the ratio is 0.9 / 0.05 = 18. The posterior odds are 18 to 99, which reduces to 2 to 11, and 18 / (18 + 99) = 0.15385. A signal that is 18 times more likely under one category still produces a modest posterior when the prior is small. The effect is the base-rate effect in its general form: a rare category stays fairly unlikely after one moderately strong signal, because the large group on the other side contributes many false signals even at a low rate. Here the second category supplies 0.0495 of the evidence and the first only 0.009, so most signals come from the larger group. This is an abstract arithmetic demonstration and not a statement about any real screening or detection process.

A stronger prior

Starting at a prior of 0.5, the odds are one to one. A signal with likelihood 0.6 under the first category and 0.2 under the second has a ratio of 3. The posterior odds are 3 to 1, which gives a probability of 0.75, and the probability form agrees: evidence = 0.6 × 0.5 + 0.2 × 0.5 = 0.4 and posterior = 0.3 / 0.4 = 0.75. When the prior odds are one to one, the posterior odds equal the likelihood ratio, which makes the ratio easy to read off directly.

Keeping the likelihood direction

Both likelihoods describe the probability of the same signal under each category. Reversing them, so that the ratio becomes 0.2 / 0.8 = 0.25 in the example, asks a different question and gives different odds. The reversed ratio of 0.25 would turn the prior odds of one to four into one to sixteen, a posterior probability of about 0.059 instead of 0.5. A common error is to treat the probability of the category given the signal as if it were the probability of the signal given the category. Writing each likelihood as P(signal | category) in full keeps the direction explicit. The tool takes the likelihoods as inputs and does not check that they were defined correctly, so the direction is your responsibility.

Updating more than once

Odds make repeated updates simple. If two signals are conditionally independent given the category, the posterior odds are the prior odds times the first ratio times the second. Starting at one to four, two signals with ratio 4 each give odds of 4 to 1, a probability of 0.8. Applying the probability form twice, using the 0.5 posterior as the new prior with the same likelihoods, gives the same 0.8. The independence assumption does the work here: if the signals are correlated, multiplying their ratios overstates the evidence.

What the toy model leaves out

The numbers are illustrative values for checking arithmetic. They do not describe any clinical test, eligibility rule or forecast, and the tool makes no claim about real-world probabilities. A real application needs a justified prior, likelihoods estimated from data and an argument that the model structure fits the situation. This page shows that the odds form and the probability form reconcile, which is a check on the algebra and says nothing about whether the inputs are right.

Reproduce the checks

Probability-form update

Open the Bayes Theorem Calculator and enter:

Prior probability of A
0.2
Probability of evidence given A
0.8
Probability of evidence given not A
0.2

Expected output:

Probability of evidence

0.32

Posterior probability of A

0.5

The two category contributions are equal.

Posterior odds parts

Open the Probability to Odds Converter and enter:

Event probability
0.5

Expected output:

Odds in favor: favorable part

0.5

Odds in favor: unfavorable part

0.5

Equal parts represent one-to-one odds.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks