Bayesian Coin Tossing Demo

The graph shows three posteriors that result from three choices for the prior. The true probability of heads, pH, is indicated by a dashed vertical line.

Hyperparameters for three beta-distribution priors. Prior 1 is initially uniform. Prior 2 is concentrated near 0.5. Prior 3 is peaked near the ends.

Bayesian updating: each coin toss updates the posterior for pH. For a beta prior, observing H heads in N tosses gives another beta distribution with updated parameters α+H and β+N−H.

Controls: use Next to add tosses, Reset to return to zero tosses, New data to regenerate a random sequence, and the sliders to change the true coin probability and prior parameters.