Silicon Logic
SL · 10 · Bayes
§ 10 · Sandbox · Probability Filed 2026.05

A positive test on a 99% accurate scan. Are you sick? Probably not.

Two circles, two events. Drag them apart, drag them through each other, and watch every conditional probability flicker live. Then flip to the medical-test mode, set a one-in-a-hundred disease, and stare at the grid: most of the positives are healthy. Bayes' theorem is not abstract — it's the only correct way to read a rare result on a good test.

drag a circle to move it  ·  drag the edge to resize  ·  watch the conditionals flip
A B A ∩ B
U  the rectangle
P(A)
area of A over the universe
P(B)
area of B over the universe
P(A ∩ B)
the lens, the overlap
P(A | B)
given B happened, how much is also A
P(B | A)
given A happened, how much is also B
Presets
Radius · A
140
Radius · B
140
Distance · centers
160
Independent if
P(A∩B) = P(A)·P(B)
Display

What you are looking at

§ 10 · Reading
I
A probability is just a fraction of a space. The rectangle is everything that could happen; the circles are the events. Their area is the chance.
II
A conditional probability narrows the universe. Move circle B over circle A and the universe is no longer the rectangle — it's just B. The fraction of B inside A is P(A | B).
III
In the medical mode, slide prevalence to 1% and the test to 99% / 99%. The grid has one sick person — and one false positive among the 99 healthy. A positive test means you are no more likely sick than well.
The mistake — treating P(+ | D) as if it were P(D | +) — is called the base-rate fallacy. Doctors get it wrong. Juries get it wrong. Everyone gets it wrong, until they've seen the grid.

How the simulation behaves

§ 10 · Method

In Venn mode, the canvas is the universe — U. The area of the rectangle is the denominator of every probability shown. Circle areas are π r², intersection area is the closed-form circular lens formula: two circular segments glued along the chord. No Monte Carlo; every number is exact for the geometry you see.

In medical mode, prevalence, sensitivity, and specificity define a 2×2 confusion table over exactly 100 people. Counts are rounded to whole people — the grid is meant to be countable, and the displayed probability comes straight from the counts you can see. Slide prevalence below 1% and the grid will show zero diseased people: that's the point. Many real diseases are rarer than the resolution of a 100-person grid, and that is exactly why an isolated positive test is so weak.

Show the math

The product rule, in two halves:

P(AB) = P(A | B) · P(B) = P(B | A) · P(A)

Set the two halves equal and divide. Out falls Bayes' theorem:

P(A | B) = P(B | A) · P(A) / P(B)

For a diagnostic test, with D = "you have the disease" and + = "the test is positive":

P(D | +) = P(+ | D) · P(D) / P(+)

The denominator P(+) is just the total share of positives — true positives plus false positives — and that is the key. A "99% accurate" test on a 1% disease has equal mass on each side of the slash. The fraction lands near 50%, not 99%.

P(D | +) = ( sens · prev ) / ( sens · prev + (1 − spec)(1 − prev) )