Bayesian analysis example: identifying a weighted coin

You have four "loonies" (Canadian one dollar coins - they have a loon on the tail face) in your pocket. Three of them are regular coins, but the fourth is a weighted coin which has an 80% chance of landing heads up. You cannot tell the coins apart on inspection. You take a coin out of your pocket at random and toss it - it lands heads up. What is the probability that the coin is the weighted coin?

Let's start by noting that the probability that the coin is weighted is either zero or one: it either is not the weighted coin or it is. The problem should really be phrased "What confidence do you have that the tossed coin is weighted?" since you are only dealing with the state of your knowledge. When you took the coin out of your pocket but before you had tossed it, you might reasonably have said you were 0.25 confident that the coin in your hand was weighted and 0.75 confident it was not weighted. Performing a Bayesian inference after observing one head from one toss:

Prior

p(fair) = 0.75

p(weighted) = 0.25

Likelihood

Posterior

You are now 65% (or so) confident the coin is fair and 35% confident that it is weighted, so your belief has not greatly changed by observing the coin toss.

Let's toss the coin another three times, and let's say you observed a head each time. Then, we would have:

Prior

p(fair) = 0.652..

p(weighted) = 0.348..

Likelihood