Connect via MCP →

Enter Calculation

Enter up to three partition events. Leave a row blank to ignore it. The B probabilities should sum to 1 for a valid partition.

Formula

Advertisement

Results

Total Probability P(A)
0.34
probability
Term P(A|Bᵢ)·P(Bᵢ)
B₁ 0.1
B₂ 0.12
B₃ 0.12
Sum of P(Bᵢ) 1

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)\).

Sample space partitioned into three regions overlapping with event A
The partition B1, B2, B3 splits the sample space, and event A is composed of its intersections with each part.

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.

Advertisement
Tree diagram branching into partition events then into event A
A probability tree showing each branch P(Bi) multiplied by P(A|Bi), summed to give P(A).

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.

Last updated: