A curated transcript of the conversation (with Claude Code) that turned Tao's 2022 blog post “A Bayesian probability worksheet” — a Bayes-rule update laid out like a tax form — into an interactive applet for tao-web.
How to read this. As with the random-variable, zeta-process, and Kakeya transcripts, the aim is to record the process:
- Terence's messages are shown mostly verbatim (routine “looks good, continue” replies
folded into the narration; long messages trimmed with
[…]). - Claude's replies — the actual edits to two files,
bayes.js(a DOM-free Bayes-update core) andbayes.html(the app) — are replaced by short italic summaries.
The core was checked with a headless Node test-harness (growing to 54 checks) and the UI with a DOM-shim smoke test (62), including a brute-force verification that the interval arithmetic is exact. Nothing was published until the app was complete.
1. The idea, and one good instinct about ranges
Terence (opening):
I'd like a version of the Bayesian worksheet [from my 2022 post], where I had formatted it like a tax form. But on an applet one can format it with editable text fields (for the underlying variables) and non-editable text fields (for the derived variables), with the examples in the blog post serving as pre-populated examples. One thing that might be nice is for the ability to enter in ranges of numbers/probabilities in the entries (i.e., to use interval arithmetic), to get some sense of how sensitive Bayesian analysis is to changes in the hypotheses. […] do you have any other design suggestions?
Claude read the post to anchor on its actual twelve boxes (two hypotheses, their priors, the prior odds, the evidence, the two likelihoods, the likelihood ratio, and the posterior odds and probabilities), then proposed the extensions that ended up defining the app: linked inputs (edit a probability or its odds and the other follows); a natural-frequencies restatement to defuse the base-rate fallacy; an additive log-odds/decibans view; a sensitivity readout for the interval feature; and — the key mathematical observation — that because the posterior is monotone in each independent input, evaluating the endpoints gives the exact interval, not a conservative over-estimate.
Terence:
All sounds good to me. I also like the extra expansions and the linking of related inputs (either can be edited and the other updates automatically). It doesn't have to be faithful to the original, so add in the extensions (e.g., the ability to flip to odds instead of probabilities).
2. Stage 0 — the tested core
Claude wrote bayes.js: every quantity carried as an interval {lo, hi}, with
monotonicity-aware operations so a range in any box propagates to a tight range in the posterior. A
brute-force test sampled the input box densely and confirmed the reported bounds were exactly the true minimum
and maximum. The two worked examples from the post came out on the nose — a positive COVID test at a 2% prior
gives a 24.6% posterior; at a 50% prior, 94.1% — and the decibans identity (prior + evidence = posterior)
held to the last digit. Terence: “Numbers look reasonable.”
3. Stage 1 — the worksheet, and a talking summary
The app: the twelve numbered boxes, white for the inputs and shaded for the derived quantities, each showing its formula; a probability/odds toggle; and the linked prior trio, where editing P(H₀), P(H₁), or the prior odds updates the other two without clobbering the field being typed in. Validation reports a bad entry rather than silently clamping it.
Terence asked for two refinements:
The summary text currently just has the posterior odds/probability, but one can list the prior odds as well. One can also provide a natural-language summary of the situation, giving some qualitative assessment […] (that one is “very likely”, “somewhat likely”, etc.) and whether the likelihood increases, decreases, or stays roughly the same (with ranges one has to be more equivocal in this conclusion).
Claude added a plain-language reading beneath the numbers: “A priori, ‘Employee X has COVID’ is very unlikely… the evidence strongly raises the likelihood, leaving it unlikely.” When an input is a range the verdict turns equivocal on its own — and a later boundary fix made it precise: if the likelihood ratio can only touch 1 from below, it says the evidence “can only lower the likelihood, or leave it unchanged,” rather than a vague “could go either way.”
4. Stage 2 — which assumption is the answer resting on?
The headline feature: enter a range in any box and a sensitivity panel appears, sweeping each input across its range with the others held at their midpoints and drawing a sorted bar for each — so one sees at a glance that (for the ranged COVID case) the prior contributes 19 points of the posterior's spread, the false-positive rate 8, and the true-positive rate only 2. The panel names the dominant assumption and stays hidden until a range is actually present.
5. Stage 3 — two more ways to see the same update
Two collapsible views. Natural frequencies restates the update as whole-number counts — “Picture 1,000 cases; 20 are infected, 16 of them test positive, alongside 49 false positives, so 16 of 65 positives are real → 24.6%” — the classic cure for base-rate confusion. Weight of evidence puts the update in decibans on a number line, where Bayes' rule becomes addition: a prior dot, a posterior dot, and the evidence as the segment between them, the same +12 dB whatever the prior.
6. Filling the gallery with paradoxes
Terence wanted more than the COVID examples, and sent a stream of candidates — Monty Hall, the boy-or-girl paradox, Bertrand's box, the taxicab problem, the three prisoners, Simpson's paradox, the prosecutor's fallacy, and the Tuesday-boy variant.
Most fit the two-hypothesis worksheet beautifully, and Claude added them with per-example commentary — noting in passing that Monty Hall, Bertrand's box, and the three prisoners are literally the same update in disguise (equal priors, a likelihood ratio of two, a two-thirds answer). Two were declined on principle: the prosecutor's fallacy is the DNA example already, and Simpson's paradox is about a trend reversing under aggregation — not a single prior-to-posterior update — so forcing it into the worksheet would misrepresent it.
7. Sleeping Beauty, as a feature
Sleeping Beauty was the interesting hold-out: its halfer/thirder dispute has no agreed likelihood, so presenting it with a single “answer” would be dishonest. Terence turned that into a use of the interval feature:
Perhaps Sleeping Beauty could then be a showcase of the interval arithmetic feature, on which we give likelihoods as a range? […] Or present two different Sleeping Beauty models in the examples, with different parameters, leading to the two different conclusions.
Both, in the end. The entire dispute lives in one likelihood, P(E | Heads): halfers set it to 1
(waking is uninformative → 1/2), thirders to 0.5 (twice the awakenings under Tails → 1/3). The app ships all
three — a halfer preset, a thirder preset, and a “as a range” preset that enters that likelihood as
0.5–1 and reports the whole disputed span, 1/3 to 1/2, with the sensitivity panel pinning 100% of
the spread on that single assumption. The applet can display a philosophical disagreement without pretending
to settle it.
8. Finishing: sharing, and launch
Two last touches for a worksheet meant to be passed around: a “copy link” button that encodes the whole filled worksheet in the URL (the one deliberate URL-write the app's bounding-box rule allows) so a pre-filled example can be dropped straight into a blog post, and a “copy as text” export of the finished sheet. Then the launch audits — self-contained (no network, no CDN, strict Content-Security Policy), light/dark theme-aware, no page state touched outside the app's own box — and the applet went live.
The applet source is released under the MIT license; the mathematical content remains reserved.
Built with Claude Code (Opus 4.8). Based on Terence Tao, “A Bayesian probability worksheet” (2022).