Bayes' Theorem
Let A and B be two events such that P(A|B) denotes the probability of the occurrence of A given that B has occurred and denotes the probability of the occurrence B of given that A has occurred, then:
$$ P(A|B)=\frac{P(B|A)P(A)}{P(B)}$$
$$ P(A|B)=\frac{P(B|A)P(A)}{P(B|A)P(A)+P(B|A^c)P(A^c)}$$