Bayes' theorem
In many scenarios, P(B) is calculated indirectly using the formula , which simply states that the probability of B is the sum of the conditional probabilities based on whether A has occurred or not.