You have a pile of 1000 coins. 1 of the coins is an unfair coin and has heads on both sides. The remaining 999 coins are fair coins. You randomly select a coin from the pile and flip it 10 times. The coin lands heads all 10 times. Calculate the probability that the coin you selected is the unfair coin.
We can calculate the probability that the selected coin is the unfair coin, given that it landed heads all 10 times, using Bayes' theorem.
The formula for Bayes' theorem in this scenario is:
\[ P(U \mid H) = \frac{P(H \mid U) \cdot P(U)}{P(H \mid U) \cdot P(U) + P(H \mid F) \cdot P(F)} \]
where \( P(U \mid H) \) is the probability that the selected coin is the unfair coin given that it landed heads all 10 times, \( P(H \mid U) \) is the probability of getting 10 heads in a row with the unfair coin, \( P(U) \) is the probability of selecting the unfair coin, \( P(H \mid F) \) is the probability of getting 10 heads in a row with a fair coin, and \( P(F) \) is the probability of selecting a fair coin.
Let: \( P(U) = \frac{1}{1000} \) be the probability of selecting the unfair coin, \( P(F) = \frac{999}{1000} \) be the probability of selecting a fair coin, \( P(H \mid U) = 1 \) be the probability of getting 10 heads in a row with the unfair coin, and \( P(H \mid F) = \left( \frac{1}{2} \right)^{10} \) be the probability of getting 10 heads in a row with a fair coin.
Then, plugging these values into Bayes' theorem, we get a result of 50.62%.
Try adjusting the parameters to see how the probability changes: