Suppose there are 10 coins laid out in front of you. All of the coins are fair (i.e. have an equal chance of heads or tails) except one, which flips to heads every time. You draw one coin at random and flip it 5 times. If each of the 5 flips results in heads, then the probability that this coin is fair can be written as ab, where a and b are coprime positive integers. What is the value of a+b?

50

50

This is a question from Brilliant dot org.

To solve this problem, we need to use Bayes' theorem. Bayes' theorem gives us a way to update our beliefs or probabilities about an event based on new evidence.

Let's define the events:
A: The chosen coin is fair.
B: We observe five consecutive heads when flipping the chosen coin.

We want to find the probability that the coin is fair (A) given that we observed five consecutive heads (B), which can be written as P(A|B).

According to Bayes' theorem, we can calculate P(A|B) as follows:

P(A|B) = (P(B|A) * P(A)) / P(B)

P(B|A) is the probability of observing five consecutive heads given that the coin is fair. Since the fair coin has an equal chance of flipping heads or tails, this probability is (1/2)^5 = 1/32.

P(A) is the probability that the chosen coin is fair. Since there are 10 coins in total and only one of them is unfair, the probability of choosing a fair coin is 9/10.

P(B) is the probability of observing five consecutive heads. We can calculate this by considering both scenarios: the chosen coin is fair and the chosen coin is unfair.

If the chosen coin is fair, the probability of getting five consecutive heads is (1/2)^5 = 1/32, as mentioned earlier.

If the chosen coin is unfair (always heads), then the probability of getting five consecutive heads is 1 because the coin will always flip heads.

Since we chose the coin at random, we need to consider both possibilities and weigh them based on the initial probabilities.

P(B) = P(B|A) * P(A) + P(B|not A) * P(not A)
= (1/32) * (9/10) + 1 * (1/10)
= 9/320 + 32/320
= 41/320

Now we can substitute these values back into Bayes' theorem:

P(A|B) = (P(B|A) * P(A)) / P(B)
= (1/32 * 9/10) / (41/320)
= 9/320 * 320/41
= 9/41

Therefore, the probability that the chosen coin is fair, given that we observed five consecutive heads, is 9/41.

The sum of the numerator and denominator is 9 + 41 = 50.

So the value of a + b is 50.