Total Probability Theorem Calculator

Enter the prior probabilities P(B₁), P(B₂), ..., P(Bₙ) for each partition event and their corresponding conditional probabilities P(A|B₁), P(A|B₂), ..., P(A|Bₙ) to compute the total probability P(A) using the Law of Total Probability. You can add up to 6 partition events. The calculator applies the formula P(A) = Σ P(A|Bᵢ)·P(Bᵢ) and shows each weighted term so you can see exactly how each partition contributes to the final result.

Select how many mutually exclusive and exhaustive partition events Bᵢ you have.

Probability of the first partition event. All P(Bᵢ) must sum to 1.

Probability of event A given that B₁ has occurred.

Probability of the second partition event.

Probability of event A given that B₂ has occurred.

Probability of the third partition event.

Probability of event A given that B₃ has occurred.

Used only when 4 or more partitions are selected.

Probability of event A given that B₄ has occurred.

Used only when 5 or more partitions are selected.

Probability of event A given that B₅ has occurred.

Used only when 6 partitions are selected.

Probability of event A given that B₆ has occurred.

Results

Total Probability P(A)

--

P(A) as Percentage

--

Sum of P(Bᵢ) — Should Equal 1

--

Weighted Term P(A|B₁)·P(B₁)

--

Weighted Term P(A|B₂)·P(B₂)

--

Weighted Term P(A|B₃)·P(B₃)

--

Results Table

More Math Tools

Frequently Asked Questions

What is the Law of Total Probability?

The Law of Total Probability states that if {B₁, B₂, ..., Bₙ} is a partition of the sample space (mutually exclusive and collectively exhaustive events), then for any event A: P(A) = P(A|B₁)·P(B₁) + P(A|B₂)·P(B₂) + ... + P(A|Bₙ)·P(Bₙ). It essentially decomposes the probability of A into weighted conditional probabilities across every possible scenario.

What does it mean for events to form a partition?

A set of events {B₁, B₂, ..., Bₙ} forms a partition of the sample space when two conditions are met: (1) the events are mutually exclusive — no two can occur simultaneously — and (2) they are collectively exhaustive — one of them must always occur. This means P(B₁) + P(B₂) + ... + P(Bₙ) = 1. The calculator checks this sum and flags it if your inputs don't add up to 1.

How do I use this Total Probability Theorem Calculator?

Select the number of partition events you have, then enter P(Bᵢ) — the prior probability for each partition — and P(A|Bᵢ) — the conditional probability of your event A given each Bᵢ. Make sure your P(Bᵢ) values sum to 1. The calculator instantly applies the formula and shows the total probability P(A), each weighted term, and a bar chart of contributions.

What is the difference between conditional probability and total probability?

Conditional probability P(A|B) gives the probability of event A given that a specific event B has already occurred. Total probability, on the other hand, combines multiple conditional probabilities across all possible scenarios (partition events Bᵢ) to compute the overall, unconditional probability P(A). Think of total probability as a weighted average of the conditional probabilities.

What happens if my P(Bᵢ) values don't sum to 1?

The Law of Total Probability requires the partition events to be exhaustive, so their probabilities must sum to exactly 1. If your values don't sum to 1, the calculated P(A) will be mathematically incorrect. The calculator displays the sum of your P(Bᵢ) inputs as a secondary output so you can verify this before trusting the result.

How is the Total Probability Theorem related to Bayes' Theorem?

Bayes' Theorem and the Law of Total Probability are closely linked. Bayes' Theorem uses the total probability P(A) — computed from the Law of Total Probability — as the denominator to update beliefs: P(Bᵢ|A) = P(A|Bᵢ)·P(Bᵢ) / P(A). In other words, you typically need the total probability calculation as a prerequisite for applying Bayes' Theorem.

Can I use this calculator for more than two partition events?

Yes. This calculator supports up to 6 partition events. Simply select the desired number from the dropdown and fill in the prior and conditional probabilities for each. The formula generalises naturally: P(A) = Σ P(A|Bᵢ)·P(Bᵢ) for all i from 1 to n, regardless of how many partitions you have.

What is a practical real-world example of the Law of Total Probability?

Suppose a factory has three machines (B₁, B₂, B₃) that produce 50%, 30%, and 20% of total output respectively. Each machine has a known defect rate: 2%, 5%, and 10%. The probability that a randomly chosen item is defective is P(Defective) = 0.02×0.5 + 0.05×0.3 + 0.10×0.2 = 0.01 + 0.015 + 0.02 = 0.045, or 4.5%. This is a classic application of the total probability theorem.