Interactive Explainer
MLE vs MAP, on a Coin Flip
Frequentists and Bayesians have argued for a century. On a single coin, both estimates are one number you can compute. Slide the prior, flip some coins, and watch the estimate drift from MLE (data-only) toward MAP (data + prior).
The setup
A coin has unknown bias $p$. You flip it $N$ times and observe $h$ heads, $t = N - h$ tails. The likelihood is $\mathcal{L}(p) = p^h (1-p)^t$. MLE peaks at $\hat p_{\text{MLE}} = h/N$.
Put a $\text{Beta}(\alpha, \beta)$ prior on $p$. Posterior is $\text{Beta}(\alpha + h,\ \beta + t)$ — same family, just add the counts. MAP peaks at the mode of that Beta.
The widget
Interactive sliders for $\alpha$, $\beta$, true $p$, and $N$ go here.
Plots: likelihood, prior, posterior on the same axis.
Read-out: MLE, posterior mean, MAP, KL(posterior ‖ prior).
Status: scaffold. Implementation pending.
What to look for
- Small $N$ · prior wins. Posterior sits close to the prior. MAP $\neq$ MLE.
- Large $N$ · data wins. Posterior collapses around $h/N$. MAP $\to$ MLE.
- Wrong prior · slow correction. A strong Beta(50, 50) prior pulls MAP toward 0.5 even when the true bias is 0.8.