Skip to content
Probability Calculator
Menu

Law of Total Probability

Updated · exact formulas, double precision

P(B) = P(B | A₁)·P(A₁) + P(B | A₂)·P(A₂) + … + P(B | Aₙ)·P(Aₙ)

The law of total probability finds the chance of an event by splitting the world into cases (A₁, A₂, …) that don't overlap and cover every possibility, then adding the chance of B in each case weighted by how likely that case is.

How to use the law of total probability

  1. Choose cases that don't overlap and together cover everything (each part comes from exactly one machine).
  2. Write the probability of each case, P(Aᵢ). They must add up to 1.
  3. Write the probability of B within each case, P(B | Aᵢ).
  4. Multiply in each row and add the results.

Example: defective parts from three machines

MachineShare of partsDefect rateContribution
A50%1%0.005
B30%2%0.006
C20%5%0.010
Total100%0.021

So 2.1% of all parts are defective.

Connection to Bayes' theorem

The total probability is the denominator in Bayes' theorem. If a part is defective, the chance it came from machine C is 0.010 ÷ 0.021 ≈ 47.6%, even though C makes only 20% of the parts. The conditional probability calculator does this for two cases. More rules are on the probability formulas page.

Questions people ask

What is the law of total probability?

P(B) = Σ P(B|Aᵢ)·P(Aᵢ) over non-overlapping cases that cover everything.

Sources

More probability calculators