 # Bayes Theorem Formula

Bayes’ Theorem formula is an important method for calculating conditional probabilities. It is used to calculate posterior probabilities. Bayes’s theorem describes the probability of an event, based on conditions that might be related to the event.

For instance, a patient is observed to have a certain symptom, and Bayes’ formula can be used to compute the probability that a diagnosis is correct, given that observation. In simple words, suppose a doctor is interested in whether a person has cancer, and knows the person’s age. If cancer is related to age, then, using Bayes’ theorem, the person’s age can be used to access more accurate probability that the patient have cancer.

Bayes’ theorem is named after Thomas Bayes, who first provided an equation that allows new evidence to update beliefs.

$\large P(B|A) = \frac{P(A|B) P(B)}{P(A)}$
$\large P(A|B) = \frac{P(B|A) P(A)}{P(B)}$

Where,
P(A/B) is the probability of A if we already know that B has occurred and is known as likelihood.
P(B) is known as prior probability and P(B/A)is posterior probability.

### Solved Examples

Question 1: Calculate P(B/A) if P(A/B) = 0.25, P(A) = 0.4 and P(B) = 0.5 using Bayes theorem.
Solution:
Given,
P(A/B) = 0.25
P(A) = 0.4
P(B) = 0.5
Using Bayes Theorem Formula
P(B|A) = $\frac{P(A|B) P(B)}{P(A)}$
P(B|A) = 0.25 $\times$ 0.500.4