Course contentsShow
← Data Science
Lesson 90 of 2,1453. Probability FoundationsFree lesson

The Law of Total Probability

Partitioning the sample space to compute probabilities through exhaustive, mutually exclusive scenarios.

The Law of Total Probability

What you'll learn: How to break down complex probability problems by dividing the sample space into smaller, easier-to-handle pieces.


The Core Idea

Sometimes calculating the probability of an event directly is difficult. The Law of Total Probability lets you split the sample space into separate, non-overlapping scenarios (a partition), calculate the probability within each scenario, and then add them up to get your answer.

Think of it like asking "What's the probability it will rain tomorrow?" Instead of tackling that directly, you break it down by weather pattern: "If it's cloudy (Scenario A), there's a 70% chance of rain. If it's clear (Scenario B), there's a 10% chance. Cloudy happens 40% of the time, clear 60%." Now you can compute the overall probability by weighing each scenario.

How It Works

You need:

  1. A partition of the sample space: mutually exclusive, collectively exhaustive events (B₁, B₂, ..., Bₙ)
  2. The probability of your target event A given each scenario: P(A|B₁), P(A|B₂), etc.
  3. The probability of each scenario: P(B₁), P(B₂), etc.

Then: P(A) = P(A|B₁)·P(B₁) + P(A|B₂)·P(B₂) + ... + P(A|Bₙ)·P(Bₙ)

Why It Matters

This law is foundational because it connects conditional probabilities (learned earlier with the general multiplication rule) with partitions (which you've just studied). It transforms hard problems into manageable chunks by leveraging scenarios you already understand.

Key Takeaway: The Law of Total Probability lets you compute an event's probability by partitioning the sample space into exhaustive, mutually exclusive scenarios and summing the weighted contributions from each.