Bayes’ Theorem
Conditional Probability forms the basis of Bayes’ Theorem.
The formula for Bayes’ Theorem
Let’s try to understand how do we derive the above formula,
Consider we have two events A and B.
And we have two conditions :
P ( A | B ) : probability of A given that B has already occurred and
P ( B | A ) : probability of B given that A has already occurred
The RHS of both the equations have the same meaning so we can equate the LHS of both the equations as well.
P(A|B).P(B) = P(B|A).P(A)
P(A|B) = P(B|A).P(A) / P(B)
This can be read as,
Probability of A given that B has already occurred is equals to
Probability of B given that A has already occurred multiplied by probability of A divided by probability of B.
The same equation can also be read as,
we need to find the probability of the hypothesis given that there exists some data or there have been observed some evidence
which is equals to
probability of the evidence considering the hypothesis to be true multiplied by the Prior probability.
Prior probability is the probability of hypothesis before observing the evidence.
Marginal is the probability of evidence.
Consider a practical example.
We have 52 cards in a deck.
What is the probability that my card is King given that it was a Face card.
To compute this particular question, we need to find other probabilities too.
Probability that the card is King and also a Face card too.