Bayesian vs Frequentist
One coin, one question: what is its bias? Answer it two ways on the same flips, a confidence interval that earns its 95% over repeated samples and a Bayesian posterior that says how probable each bias is.
Bayesian vs Frequentist
A coin has some unknown bias p toward heads. You flip it and watch two schools answer the same question from the same data. The frequentist treats p as one fixed number and reports an interval whose 95% is a property of the procedure. The Bayesian treats p as uncertain, carries a distribution, and reports an interval you can read as a direct probability. Change the hidden bias, add flips, and watch the two intervals tell their different stories about the same data.
Same data, both intervals on one axis
p axis: 0 (always tails) to 1 (always heads)The curve is the Bayesian posterior density over p. The dashed curve is the prior you started from. The shaded band under the curve is the 95% credible interval. The flat bar just below the axis is the frequentist 95% interval. The green dashed line is the true p; the solid blue line is the point estimate p̂ = heads / n.
p is fixed, the interval is random
The bias p is one fixed unknown constant; it has no probability distribution. Probability lives in the long-run frequency of the procedure. The 95% confidence interval is a recipe: if you repeated the whole experiment forever, about 95% of the intervals it produces would cover the true p. Wilson inverts the score test and keeps coverage near nominal even at small n, which is why it is preferred.
p is uncertain, described by a distribution
Start with a Beta(α, β) prior. Because the Beta is conjugate to the binomial likelihood, the update is exact and free: heads add to α, tails add to β, giving the posterior Beta(α+0, β+0). The 95% credible interval holds 95% of the posterior probability, so here you may say plainly: given this prior and this data, there is a 95% probability that p lies inside it.
Repeated sampling, the honest demonstration
Fix the true p, then draw many fresh independent experiments of size n = 20 and build a 95% interval for each. The confidence statement is not about any single interval; it is about this stack. Roughly 95% of the intervals should cover the true p (the green line). The ones in red miss it. That coverage is the entire content of the word confidence.
They often nearly coincide. With a flat Beta(1,1) prior and plenty of data, the Bayesian credible interval and the frequentist Wilson interval land almost on top of each other. The numbers agree because the likelihood dominates and the prior has washed out.
They diverge with small n or a strong prior. Early on, or under the believes-fair Beta(20,20) prior, the posterior is pulled toward 0.5 and its interval separates from the frequentist one. Add flips and watch the prior's pull fade as the data takes over.
They never mean the same thing. The credible interval is a statement about p given your data:95% of the posterior probability sits inside it. The confidence interval is a statement about the procedure: over endless repeated samples, 95% of the intervals it builds would cover the fixed true p. You cannot say a single confidence interval has a 95% chance of containing p, that probability is already either 0 or 1, you just do not know which.