A hat contains 100 coins, 99 of them are guaranteed to be fair and 1 that has a $\frac{1}{2}$ chance to be double-headed. A coin is randomly chosen at random and flipped 7 times. If it landed heads each time what is the probability that one of the coins is double-headed?
My approach:
Apply Bayes:
P(A) = the probability of it being double-headed.
P(B) = the probability of making 7 heads.
$P(A|B) = \frac{P(A)P(B|A)}{P(B)}$
$P(A) = \frac{1}{100}\frac{1}{2} = \frac{1}{200}$
$P(B|A) = 1$
$P(B) = (\frac{1}{2}(\frac{1}{100}1 + \frac{99}{100}\frac{1}{2^7}) + \frac{1}{2}\frac{100}{100}\frac{1}{2^7} = \frac{327}{25600}$
$P(A|B) = \frac{\frac{1}{200}}{\frac{327}{25600}} = \frac{128}{327} \approx 39.14\%$
What you have computed is the probability that the coin you randomly chose is double-headed.
The problem statement asks you to find the probability that one of the coins is double-headed. The double-headed coin does not need to be the one you chose.
Before you chose the coin and flipped it seven times, the chance that one of the coins was double-headed was $1/2.$ You are less likely to get seven heads in your first seven flips if there is no double-headed coin in the hat, so the fact that the coin landed heads seven times should make it more likely that there is a double-headed coin. That is, your answer should be greater than $1/2.$