On this page
You flip a coin 10 times and get 7 heads. Is it biased? The quick answer, 7/10, ignores what you believed before and says nothing about how sure you should be. Bayesian updating with the beta distribution handles both, using only addition.
What is a Beta(a, b) prior on a coin's bias?
Call the coin's unknown probability of heads p. Before flipping, you describe your belief about p with a curve on 0 to 1, called the prior.
The beta distribution Beta(a, b) has density proportional to p^(a−1) × (1−p)^(b−1), and its mean is a/(a+b) (Wikipedia: Beta distribution). Beta(1,1) is flat: every bias from 0 to 1 is equally likely. That uniform prior was suggested by Thomas Bayes and adopted by Pierre-Simon Laplace, according to the same article. Bayes' essay was published in 1763, after his death (Fienberg, Bayesian Analysis, 2006).
A bigger a pulls the curve towards heads, a bigger b towards tails, and a bigger a + b makes it narrower, which means more confident.
Why is the posterior Beta(a+h, b+t)?
Bayes' theorem says the posterior is proportional to the likelihood times the prior:
Likelihood of h heads and t tails for a given p: proportional to p^h × (1−p)^t. The binomial coefficient does not depend on p, so it cancels.
Prior: p^(a−1) × (1−p)^(b−1).
Multiply them: p^(a+h−1) × (1−p)^(b+t−1).
That is the shape of Beta(a+h, b+t); scaled to have area 1, it is the posterior. Wikipedia's article on conjugate priors derives the same result and notes the posterior can serve as the prior for the next batch of data. A prior whose posterior stays in the same family is called conjugate; the article credits the term to Howard Raiffa and Robert Schlaifer.
Worked example: from Beta(1,1) to 7 heads in 10 flips
Start flat with Beta(1,1). The flips come out H H T H H H T H T H, which is 7 heads and 3 tails. Follow the belief as it moves:
Before any flip: Beta(1,1), mean 1/2.
After H: Beta(2,1), mean 2/3.
After H H: Beta(3,1), mean 3/4.
After H H T: Beta(3,2), mean 3/5.
After all ten: Beta(1+7, 1+3) = Beta(8,4), mean 8/12, about 0.667.
The diagram at the top draws both curves. The posterior peaks at 0.7 but is still wide: values of p from about 0.4 to 0.9 keep real weight. Ten flips move your belief; they do not settle it.
Posterior mean vs MLE: which number should you trust?
The maximum likelihood estimate (MLE) is h/n = 7/10 = 0.7, the value of p that makes the observed flips most likely. The posterior mean is (a+h)/(a+b+n) = 8/12, about 0.667.
With the Beta(1,1) prior, the posterior mean is Laplace's rule of succession, (s+1)/(n+2), and the posterior mode equals the MLE, s/n (Wikipedia: Beta distribution, Bayesian inference).
The gap matters most when data are scarce. Get 3 heads in 3 flips and the MLE says p = 1, a coin that can never land tails; the posterior mean from Beta(1,1) says 4/5.
The posterior mean is a weighted average of the prior mean and the MLE: w × a/(a+b) + (1−w) × h/n, with w = (a+b)/(a+b+n). Here w = 2/12, giving (2/12)(1/2) + (10/12)(7/10) = 8/12.
How strong is your prior? Read a and b as pseudo-counts
The conjugate prior article describes a and b as pseudo-observations: when you report the posterior mean, Beta(a, b) acts like a heads and b tails you have already seen (Wikipedia: Conjugate prior). So a + b measures how many flips your prior is worth.
Same data, 7 heads in 10 flips, three priors:
Beta(1,1), worth 2 imaginary flips: posterior Beta(8,4), mean 8/12, about 0.667.
Beta(10,10), "probably fair", worth 20 flips: posterior Beta(17,13), mean 17/30, about 0.567.
Beta(50,50), "I have tested this coin a lot", worth 100 flips: posterior Beta(57,53), mean 57/110, about 0.518.
With 70 heads in 100 flips, even the Beta(10,10) prior gives Beta(80,40), mean 80/120, about 0.667. Once real flips outnumber the pseudo-flips, the data lead.
How do you practise Bayesian updating?
Redo the worked example with a Beta(2,2) prior and check that the mean becomes 9/14.
Try 0 heads in 5 flips from Beta(1,1): the MLE is 0, the posterior mean 1/7.
If Bayes' theorem itself feels shaky, start with Bayes' theorem worked through a positive test result for 10,000 people, then the Class 12 probability guide to Bayes questions and common traps. For the next step in conditional thinking, see the tower rule for conditional expectation.
To revisit building blocks such as the binomial distribution, the Fermi Concept Library gives every concept in mathematics its own lesson and its place in the map. When you get stuck on a practice question, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



