141. Bayes' Rule

141.1. Beyes’ Rule

𝑃(𝐴|𝐵)=𝑃(𝐵|𝐴)𝑃(𝐴)𝑃(𝐵)

Start with the multiplication rule in both directions:

𝑃(𝐴𝐵)=𝑃(𝐴)𝑃(𝐵|𝐴)𝑃(𝐴𝐵)=𝑃(𝐵)𝑃(𝐴|𝐵)

Set them equal:

𝑃(𝐴)𝑃(𝐵|𝐴)=𝑃(𝐵)𝑃(𝐴|𝐵)

Solve for 𝑃(𝐴|𝐵):

𝑃(𝐴|𝐵)=𝑃(𝐵|𝐴)𝑃(𝐴)𝑃(𝐵)

So Bayes’ Rule is the multiplication rule rearranged.

Start: Definition of conditional probability

𝑃(𝐴𝑖|𝐵)=𝑃(𝐴𝑖𝐵)𝑃(𝐵)
  1. Numerator: 𝑃(𝐴𝑖𝐵) (Multiplication Rule)

Using the multiplication rule:

𝑃(𝐴𝑖𝐵)=𝑃(𝐴𝑖)𝑃(𝐵|𝐴𝑖)

This expresses the joint probability as prior × likelihood

So the numerator comes directly from multiplying:

  1. Denominator: 𝑃(𝐵) (Total Probability Theorem)

If 𝐴1,,𝐴𝑛 form a partition, then the total probability theorem gives:

𝑃(𝐵)=𝑗=1𝑛𝑃(𝐵|𝐴𝑗)𝑃(𝐴𝑗)

This decomposes the probability of the “evidence” 𝐵 into all possible scenarios 𝐴𝑗

  1. Put numerator & denominator together

Substitute both results into the definition:

𝑃(𝐴𝑖|𝐵)=𝑃(𝐴𝑖)𝑃(𝐵|𝐴𝑖)𝑗=1𝑛𝑃(𝐵|𝐴𝑗)𝑃(𝐴𝑗)

Interpretation

So Bayes’ Rule is literally:

Posterior=Likelihood×PriorTotal Evidence
Example

Identifying Source of a Defective Part

A company sources a critical component from three suppliers:

  • Supplier A_1: 50% of parts

  • Supplier A_2: 30% of parts

  • Supplier A_3: 20% of parts

Each supplier has a different defect rate:

  • 𝑃(𝐵|𝐴1)=0.01

  • 𝑃(𝐵|𝐴2)=0.03

  • 𝑃(𝐵|𝐴3)=0.05

Here:

  • 𝐴𝑖: part comes from supplier i

  • 𝐵: part is defective

1. Total Probability Theorem: What is the overall defect rate?

We compute

𝑃(𝐵)=𝑖=13𝑃(𝐵|𝐴𝑖)𝑃(𝐴𝑖)

Plug in numbers:

𝑃(𝐵)=0.01(0.50)+0.03(0.30)+0.05(0.20)=0.005+0.009+0.010=0.024

Overall defect rate = 2.4%

2. Multiplication Rule: Joint probability from each supplier

  • Supplier 1:
𝑃(𝐴1𝐵)=𝑃(𝐴1)𝑃(𝐵|𝐴1)=0.50×0.01=0.005
  • Supplier 2:
𝑃(𝐴2𝐵)=𝑃(𝐴2)𝑃(𝐵|𝐴2)=0.30×0.03=0.009
  • Supplier 3:
𝑃(𝐴3𝐵)=𝑃(𝐴3)𝑃(𝐵|𝐴3)=0.20×0.08=0.016

This term appears in the numerator of Bayes’ Rule.

3. Bayes’ Rule: If a part is defective, what is the probability it came from supplier 3?

𝑃(𝐴3|𝐵)=𝑃(𝐴3)𝑃(𝐵|𝐴3)𝑃(𝐵)

Substitute:

𝑃(𝐴3|𝐵)=0.200.050.024=0.0100.0240.4167

About a 41.7% chance the defective part came from supplier 3.

Even though supplier 3 supplies only 20% of parts, it becomes the most likely source of a defect because its defect rate is highest.