Bayes’s theorem is a way of finding a probability when we have certain other probabilities. Bayes’s theorem is stated mathematically as the following equation:
Where A and B are events and P(B) ≠ 0,
P(A | B) is also a conditional probability: the likelihood of event A occurring given B is true.
P(B | A) is also a conditional probability: the likelihood of event B occurring given A is true.
P(A) and P(B) are conditional probabilities of observing A and B respectively.
Lets take an example from mathisfun.com . You can check other examples from this site.
Let us say P(Fire) means how often there is fire, and P(Smoke) means how often we see smoke, then:
P (Fire | Smoke) means how often there is fire when we can see smoke
P(Smoke | Fire) means how often we can see smoke when there fire
- dangerous fires are rare (1%) i.e. P(Fire)
- but smoke is fairly common (10%) due to barbecues i.e. P(Smoke)
- and 90% of dangerous fires make smoke i.e. P(Smoke | Fire)
Probability of dangerous fire when there is smoke:
P( Fire | Smoke) = P(Fire) x P(Smoke | Fire) / P(Smoke)
= 1 % x 90% / 10%
So, it is still worth checking out any smoke to be sure.
You can check other example from below link.