Bayesian Updating

Prior → Likelihood → Posterior — the Beta-Binomial conjugate model

Flips n =0
Heads k =0
Post. mode =-
Post. mean =-
95% CI =-
1
1
0.60
med

What It Demonstrates

Bayes' theorem tells us how to update beliefs when new evidence arrives. For a coin with unknown bias p, the Beta distribution Beta(α, β) is a natural prior — it lives on [0, 1] and encodes pseudocounts of (H, T) outcomes. After observing k heads in n flips, the conjugate update is exact:

Prior Beta(α, β) + k heads, n−k tails → Posterior Beta(α+k, β+n−k)

No integration, no approximation — only two numbers change. This conjugacy is why the Beta-Binomial model is the textbook workhorse for proportion inference.

The simulation shows three curves: prior (your initial belief), posterior (updated belief after flips), and a vertical marker for the true p you set.

How to Use

Did You Know?

Bayesian updating is at the heart of spam filters, medical testing (PPV vs NPV), GPS receivers, and modern machine learning. The 95% credible interval shown here has a clean interpretation: "There is a 95% probability (given the data and prior) that p lies within this range" — unlike a frequentist confidence interval, which keeps the parameter fixed and varies hypothetical samples.