Okay, let's look at the formula for Bayes' Theorem and derive it step-by-step.
Bayes' Theorem Formula
The standard formula for Bayes' Theorem is:
P(A|B) = [P(B|A) * P(A)] / P(B)
Where:
- P(A|B): This is the posterior probability. It's the probability of event A occurring given that event B has occurred.
- P(B|A): This is the likelihood. It's the probability of event B occurring given that event A has occurred.
- P(A): This is the prior probability. It's the independent probability of event A occurring (before considering event B).
- P(B): This is the evidence or marginal probability. It's the independent probability of event B occurring. It must be non-zero (P(B) ≠ 0).
Derivation of Bayes' Theorem
Bayes' Theorem is derived directly from the definition of conditional probability.
-
Definition of Conditional Probability: The probability of event A occurring given that event B has occurred (P(A|B)) is defined as the probability of both A and B occurring (the joint probability, P(A ∩ B)) divided by the probability of B occurring (P(B)).
- P(A|B) = P(A ∩ B) / P(B) --- (Equation 1)
-
Reverse Conditional Probability: Similarly, the probability of event B occurring given that event A has occurred (P(B|A)) is defined as the probability of both B and A occurring (P(B ∩ A)) divided by the probability of A occurring (P(A)).
- P(B|A) = P(B ∩ A) / P(A) --- (Equation 2)
-
Joint Probability Symmetry: The probability of both A and B occurring is the same regardless of the order: P(A ∩ B) = P(B ∩ A).
-
Rearrange for Joint Probability: We can rearrange both Equation 1 and Equation 2 to isolate the joint probability:
- From Equation 1: P(A ∩ B) = P(A|B) * P(B)
- From Equation 2: P(B ∩ A) = P(B|A) * P(A)
-
Equate the Expressions: Since P(A ∩ B) = P(B ∩ A), we can set the right-hand sides of the rearranged equations equal to each other:
- P(A|B) * P(B) = P(B|A) * P(A)
-
Solve for P(A|B): To get Bayes' Theorem, divide both sides by P(B) (assuming P(B) is not zero):
- P(A|B) = [P(B|A) * P(A)] / P(B)
This completes the derivation.
Expanded Form (using the Law of Total Probability):
Sometimes, P(B) is not known directly. It can be calculated using the Law of Total Probability if we consider event A and its complement (not A, often written as A'). Since A and A' are mutually exclusive and exhaustive (one of them must happen), we can express P(B) as:
P(B) = P(B ∩ A) + P(B ∩ A')
P(B) = P(B|A) * P(A) + P(B|A') * P(A')
Substituting this into the denominator of Bayes' Theorem gives the expanded form:
P(A|B) = [P(B|A) * P(A)] / [P(B|A) * P(A) + P(B|A') * P(A')]
In essence, Bayes' Theorem provides a way to update our belief or probability about an event (A) after observing new evidence (B). It mathematically connects the probability of A given B to the probability of B given A, along with the prior probabilities of A and B.