Bayes’ theorem describes the probability of an event based on prior knowledge of conditions that might be related to the event. If you know the conditional probability P(B|A), you can use Bayes’ rule to find out the reverse probability P(A|B).
Formula:
We will now understand the application of Bayes’ theorem through a demonstration:
Two bags contain red and green balls. The first bag contains two red and three green balls; the second bag contains five red and seven green balls. If a green ball is drawn from one of the bags, what is the probability that it was drawn from the first bag?
Solution:
P(1): Probability of choosing bag 1 = 1/2
P(2): Probability of choosing bag 2 = 1/2
P(G1): Probability of getting a green ball from bag 1 = 3/5
P(G2): Probability of getting a green ball from bag 2 = 7/12
Applying Bayes’ theorem to determine the probability of a green ball being drawn from bag 1, we get: (P(1) * P(G1))/(P(1) * P(G1) + P(2) * P(G2))
= ((1/2) * (3/5))/((1/2) * (3/5)) + ((1/2) * (7/12))
= 36/71
You can learn more about conditional probability and Bayes’ theorem here.