Code tool

Law of Total Probability Calculator

Enter up to three mutually exclusive case probabilities and conditional event probabilities. Probabilities must be between 0 and 1 and case probabilities must sum to 1.

In-browser processingNo account requiredPrivacy details ↗

Enter rows as case probability, conditional event probability (one row per line; 2–3 rows).

A QUICK WALKTHROUGH

How to use this tool

  1. Enter 2 or 3 case probabilities and conditional event probabilities.
  2. Ensure case probabilities sum to 1 within rounding tolerance.
  3. Read the total event probability and posterior case probabilities.

Probability rules

Use decimal probabilities in [0,1]. Cases are mutually exclusive and exhaustive, so their probabilities must sum to 1 (within 1e−9). Up to three cases are accepted.

GOOD TO KNOW

Common questions

Can I enter percentages?

Convert percentages to decimals first, such as 25% = 0.25.

Does this predict an outcome?

No. It applies supplied probabilities only.