Baye's Formula

Just found this helpful as I was struggling to understand this (as I cannot remember the formula). http://en.wikipedia.org/wiki/Bayes’_theorem and thought that it might be helpful to others as well. Extract from the above link: Suppose there are two bowls full of cookies. Bowl #1 has 10 chocolate chip cookies and 30 plain cookies, while bowl #2 has 20 of each. Fred picks a bowl at random, and then picks a cookie at random. We may assume there is no reason to believe Fred treats one bowl differently from another, likewise for the cookies. The cookie turns out to be a plain one. How probable is it that Fred picked it out of bowl #1? Intuitively, this should be greater than half since bowl #1 contains the same number of cookies as bowl #2, yet it has more plain. We can clarify the situation by rephrasing the question to "what’s the probability that Fred picked bowl #1, given that he has a plain cookie?” The event A is that Fred picked bowl #1, and the event B is that Fred picked a plain cookie. To compute P(A|B), we first need to know: P(A), or the probability that Fred picked bowl #1 regardless of any other information. Since Fred is treating both bowls equally, it is 0.5. P(B), or the probability of getting a plain cookie regardless of any other information. Since there are 80 total cookies, and 50 of them are plain, the probability of selecting a plain cookie is 50/80 = 0.625. P(B|A), or the probability of getting a plain cookie given Fred picked bowl #1. Since there are 40 cookies in bowl #1 and 30 of them are plain, the probability is 30/40 = 0.75. Given all this information, we can compute the probability of Fred having selected bowl #1 given that he got a plain cookie by substitution: P(A|B) = (0.50 * 0.75) / 0.625 = 0.6

See the tree you will see the light!

yeah man dont make this harder than it needs to be, ,learn the tree and move on