Analyzing the Setup
Imagine you are standing in front of a mysterious box containing N coins. Some are fair, and some are biased. You reach in, pull out a coin, and toss it twice, observing a Head followed by a Tail.
We are tasked with finding the probability that the coin is fair. This is a classic application of Bayesian inference, where we use observed evidence to update our prior beliefs.
Defining the Evidence
We have N total coins, with m of them being fair. Consequently, the number of biased coins is N−m.
If we pick a coin at random, the prior probabilities are:
P(F)=Nm
P(B)=NN−m
The Two Paths
Let
E be the event of observing a Head followed by a Tail. If the coin is fair, the probability of this sequence is:
P(E∣F)=21×21=41
If the coin is biased, the probability of a Head is
32, which implies the probability of a Tail is
1−32=31. Thus, the probability of the sequence given the coin is biased is:
P(E∣B)=32×31=92
Bayes' Theorem as a Detective Tool
We use Bayes' Theorem to calculate the posterior probability
P(F∣E), which represents the probability the coin is fair given the evidence
E:
P(F∣E)=P(E∣F)P(F)+P(E∣B)P(B)P(E∣F)P(F)
This formula acts as a bridge between the 'cause' (the coin type) and the 'effect' (the observed tosses). The numerator represents the 'Fair' path, while the denominator represents the total probability of observing E across all possible coin types.
The Algebraic Cleanup
Substituting our known values into the theorem, we get:
P(F∣E)=41⋅Nm+92⋅NN−m41⋅Nm
Since
N1 is a common factor in every term, we cancel it out to simplify the expression:
P(F∣E)=4m+92(N−m)4m
To eliminate the fractions, we multiply the numerator and the denominator by
36, the least common multiple of
4 and
9:
P(F∣E)=9m+8(N−m)9m
The Final Revelation
Expanding the denominator, we obtain 9m+8N−8m, which simplifies to m+8N.
The final probability that the coin is fair is:
P(F∣E)=m+8N9m
This result is clean, logical, and perfectly derived from the evidence. You have successfully navigated the uncertainty of the box using the power of Bayesian inference.