# Does bayes theorm apply to this scenario?

You were given a coin which could be either coin A or B. The probability of getting heads for coin A is 0.5, while the probability of getting heads for coin B is 0.3.

You believe that the given coin is A with a probability of 0.9. You flipped the coin 5 times and obtained 1 head and 4 tails (Each flip is independent of each other). What is the probability that the given coin is coin A after seeing the 5 flips?

Step 1: The probability of getting the above sequence for A is 0.156 (0.5^5 * 5) and the probability for sequence B is 0.0938 (5 * 0.3 * 0.5^4)

Step 2: (0.9 * 0.16) / (0.9 * 0.156+0.1 * 0.0938) = 0.94%? - is this the answer?

I'm honestly not sure about step two, cause I can't really rationalize it. I have seen a similar problem being solved this way.

Could someone help me with the progression from step 1 onward would be great thanks

• 0.5^5 is not 0.16. Jan 29 at 11:29
• You need to get Step 1 right before you can do step 2. You should use the Binomial Distribution formula. The probability of getting 4 Heads and 1 Tails for coin A is 5 (to allow flexibility in which was tails) times 0.5^4 (for 4 heads) * 0.5 (for 1 tails), which is 5/32, which is 0.15625. The probability of getting 4 heads and 1 Tails for coin B is 5 (to allow flexibility in which was tails) times 0.3^4 (for 4 heads) * 0.7 (for 1 tails), which is 0.02835. Jan 29 at 11:48
• sorry, i have expanded on the decimals to make it clearer and included some missing letters. Missed out on the 5*0.5^5 Jan 29 at 13:08
• I suggest that you put numbers into the equation only at the end. Start with the equation with the usual symbols and a list of symbolic definitions. Manipulate the equation to solve for the symbol of interest and then put the numbers into it. That will let you much more easily check your work. Jan 29 at 20:37

Yes. Bayes theorem can be applied here. You look for $$P(A| 4H, 1T)$$
$$P(A| 4H, 1T) = \frac{P(A)*P(4H, 1T|A)}{P(4H, 1T)} = \frac{P(A)*P(4H, 1T|A)}{P(A)*P(4H, 1T|A) + P(B) * P(4H, 1T|B)}$$
In order to calculate $$P(4H, 1T|A)$$