Posterior Probability – Flipping a Coin with Beta Distribution as Conjugate Prior

beta distributionconjugate-priorposterior

Suppose, I toss a fair coin n = 10 times and get 7 heads and 3 tails. The probability of fair coin is p = 0.5. Now, that the beta distribution is a conjugate prior of the binomial likelihood. I used the probability density function equation for beta distribution, as given in Wikipedia (https://en.wikipedia.org/wiki/Beta_distribution). I can't seem to understand what values of alpha and beta should I use. The alpha – 1 is the number of heads and beta – 1 is the number of tails. Now assuming a uniform prior distribution U(0,1) or Beta(1,1). I calculate the posterior probability as 1. Is my answer right?.

And what will be the solution if my coin is biased, suppose p = 0.7 (instead of p = 0.5).

Best Answer

First of all, you already know the coin is fair hence the next throw will have a 50% chance of head and 50% of tail. If you know the coin is fair, the posterior distribution is p = 0.5.

Now, what if you do not know if the coin is fair or not fair and you only see a sequence of 7 heads and 3 tails. Assume Head = 1 and Tail = 0.

Then you can use a prior of beta (1,1). This means you start believing the coin is fair. Then you see the draws, you update the binomial. Look online this is a conjugate distribution and the posterior will be Beta(1 + 7, 1 + 3). The mean is 8/12 = 0.66. Is states that your prior belief that the coin is fair was slightly tilted toward a biased coin favoring heads. Note you start believing 0.5, you see 0.7 in the data and you end up updating to a 0.66.