Bayesian Updating Visualizer
Bayesian inference for a coin’s bias has an exact closed-form answer: a Beta prior multiplied by a Bernoulli likelihood gives a Beta posterior. Set the true bias (or hide it and play a guessing game), choose a prior with the α and β sliders or a preset — uniform, Jeffreys, optimistic, skeptical — then flip the coin ×1, ×10 or ×100. The posterior curve animates smoothly to its new shape after every batch, a strip records recent outcomes (heads orange, tails blue), and you can overlay the dashed prior and the scaled likelihood to see exactly how they multiply. Readouts give the posterior mean, MAP and a shaded 95% credible interval that tightens as evidence accumulates, and a toggle demonstrates that updating flip-by-flip and updating once with the whole batch land on the identical posterior.
Runs 100% in your browser — models are trained and computed locally on your device.
Read the full guide to this tool
Notes
- Conjugacy makes updating pure counting: Beta(α, β) plus h heads and t tails gives Beta(α + h, β + t), so α and β act as pseudo-counts of imagined prior flips.
- The posterior mean (α + h)/(α + β + h + t) is a weighted average of the prior mean and the sample frequency — the data outweigh the prior once h + t ≫ α + β.
- The credible interval width shrinks like 1/√n, and with enough flips any two priors that put nonzero density on the truth converge to the same posterior.
- Runs 100% in your browser — models are trained and computed locally on your device.