What is the law of total probability?
The law of total probability lets you find the overall probability of an event A by breaking the sample space into a set of mutually exclusive, exhaustive events (a partition) B₁, B₂, …, Bₙ. If you know how likely each Bᵢ is and how likely A is within each Bᵢ, you can recombine them into a single, unconditional probability \(P(A)\).
How to use this calculator
Enter the probability of each partition event \(P(B_i)\) and the corresponding conditional probability \(P(A|B_i)\). You can use up to three events; leave a row blank (zero) if you only need two. The calculator multiplies each pair and sums the products to give \(P(A)\). It also checks that your \(P(B_i)\) values add up to 1, which is required for a valid partition.
The formula explained
The core equation is $$P(A) = \sum P(A|B_i)\cdot P(B_i)$$ Each term \(P(A|B_i)\cdot P(B_i)\) is the joint probability \(P(A \cap B_i)\): the chance that both A happens and you are in scenario Bᵢ. Because the Bᵢ are mutually exclusive and cover all possibilities, adding these joint probabilities gives the total chance of A regardless of which scenario occurs.
Worked example
Two factories supply parts. Factory 1 makes 60% of parts with a 2% defect rate; Factory 2 makes 40% with a 5% defect rate. The chance a random part is defective is $$P(A) = 0.02\cdot 0.60 + 0.05\cdot 0.40 = 0.012 + 0.020 = 0.032$$ or 3.2%.
FAQ
Must \(P(B_i)\) sum to 1? Yes. The events must form a partition of the sample space, so their probabilities must total 1; the calculator warns you if they do not.
Can the conditional probabilities exceed 1? No. Every probability, including each \(P(A|B_i)\), must lie between 0 and 1.
How is this related to Bayes theorem? The law of total probability supplies the denominator \(P(A)\) used in Bayes theorem when reversing conditional probabilities.