# coin flipping question. Question about Bayes vs conditional probability formula.

A bag contains 5 coins. Four of them are fair and one has heads on both sides. You randomly pulled one coin from the bag and tossed it 5 times, heads turned up all five times. What is the probability that you toss next time, heads turns up. (All this time you don't know you were tossing a fair coin or not).

I tried doing this problem by hand again and I think I understand most important parts except this one very easy one. What is the difference here between Bayes vs Conditional prob?

rules: conditional probability formula is : P(A given B) = P(A and B) /P(B)

Bayes: P(A given B) = P(B given A) * A / P(B) (this can be expanded out I know)

Also, regardless of dependency, P(A and B) = P(A) * P(B given A) = P(B) * P(A given B)

So Bayes is just a more fleshed out version of conditional probability... used when P(B) isn't as simply stated as P(B).

My question... do we use Bayes when we can't use conditional probability because P(A and B) isn't simple. In the coin problem, we use Bayes because why exactly? Is it because A and B are dependent variables in the coin problem?

So this was what I was writing when this confused occurred to me: Let’s do this coin problem using Bayes: So first things’s first, this is a two step problem. We need to first figure out how likely the coin is an unfair coin given information of flipping 5 heads. Given that it’s heads 5 times, how likely is the coin unfair? Then you need to figure out, given the likelihoods of fair vs biased coin, the next coin flip's likelihood of heads.

P(A) = coin is biased

P(B) = coin is heads 5 times.

So let’s try to find P(A given B)

Remember P(A and B) = P(A) * P(B given A) = P(B) * P(A given B)

That’s true regardless of dependency. But we’re trying to find P(A given B) here. And P(B given A) is much easier to find... its just 1. So use P(B given A) when trying to calc P(A and B). Remember, we’re working with dependent variables here so you can’t just use P(A and B) or the conditional formula.

Bayes: P(A given B) = to P(B given A) * P(A) / P(B) = 1 * 1/5 / P(B)

P(B)= (1*1/5) + ((1/2)^5 (4/5)) =(1/5 + (1/32 * 4/5)) = (1/5 + (4/160)) = 9/40

So P(A given B) = (1/5) / (9/40) = 8/9

If conditional probabiltiy and Bayes are the same formula, why can't I do this problem using conditional formula?

P(A given B) = P(A and B) / P(B)

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

= 1/2 *9/40 / 9/40

What error in thinking am I making here? It seems like the conditional prob formula isn't taking account dependency... which is odd since the formula seems to be made to do that.

oh right... it's that P(A and B) = P(A) * P(B) only when the variables are independent. So it seems like that should always be the first question I ask. Or I can just always use P(A and B) = P(A) * P(B given A) or P (B) * P(A given B) because that's the equation to use regardless of dependence... right...stupid...

Perhaps my question is about independence. P(A and B) = P(A)*P(B) if and only if A and B are independent right? If the question involves dependent variables, you have to use P(A and B) = P(A) * P(B given A) or = P(B) * P(A given B) right? And usually the choice of which formula to use is apparent P(A) * P(B given A) or P(B) * P(A given B). Like... if you're trying to find P(A given B)... you can't use P(B) * P(A given B) to represent P(A and B).

Is everything I've written made sense?

-
In my experience, students who try to use the Bayes Formula, or what they think of as the Bayes Formula, have a higher probability of error than students who use the definition of conditional probability, and figure out $\Pr(A\cap B)$ and $\Pr(B)$. – André Nicolas May 16 '13 at 4:20
Did I make an error? Did everything I write out make sense? especially late 2 paragraphs? – Jwan622 May 16 '13 at 15:31
The comments of the last two paragraphs were not incorrect. How one approaches a particular problem depends on the problem, so I am uncomfortable with attempts at universal recipes. The conditional probability is indeed $8/9$, so the answer to the problem as put is $17/18$. – André Nicolas May 16 '13 at 17:40

You've done a great job. $P(A\cap B)=\frac{1}{5}$, because that is the probability that you have both selected the unfair coin and flipped 5 heads. $P(A)P(B)=\frac{1}{5}\frac{9}{40}=\frac{9}{200}$. Hence, you have proved conclusively that $A,B$ are not independent.
In fact, if $P(A|B)=\frac{P(A)P(B)}{P(B)}=P(A)$, that is exactly the intuitive understanding of independence; $A$ is equally likely to occur regardless of whether or not $B$ has occurred.