Day 5 · How Many Heads¶
Edited by Charles
Probability · Bayes’ theorem · Conditional expectation
Original question on OpenQuant
Problem¶
Choose one of three coins uniformly at random. Their probabilities of heads are \(1/3\), \(2/3\), and \(1\). The selected coin produces two heads. Keeping the same coin, what is the expected number of heads in the next twelve flips? Flips are independent conditional on the selected coin.
Core idea
Two observed heads make the coins with higher head probabilities more likely. Update the coin probabilities before calculating the expectation.
Short solution¶
1. Calculate the likelihood of two heads. Let \(H_2\) denote the observation.
| Coin | Heads probability | \(P(H_2\mid\text{coin})\) |
|---|---|---|
| A | \(1/3\) | \(1/9\) |
| B | \(2/3\) | \(4/9\) |
| C | \(1\) | \(1\) |
2. Apply Bayes' theorem. Equal prior probabilities cancel when normalizing:
3. Average the future head probability.
If \(N\) counts heads in the next twelve flips, then \(E[N\mid p,H_2]=12p\). Taking the posterior average gives:
Answer
Watch out
Do not retain the original equal coin probabilities after observing two heads. The requested count excludes the two flips already observed.
Why multiplying by twelve is valid
Each future flip has conditional head probability \(6/7\) given \(H_2\). Linearity of expectation adds those twelve probabilities. It does not require the future flips to be independent after averaging over the unknown coin; the shared coin actually makes them dependent under that mixture.