zaro

What is the Law of Total Probability?

Published in Probability Theory 4 mins read

The Law of Total Probability is a fundamental rule in statistics that allows for the calculation of the probability of an unknown event by leveraging the known probabilities of several distinct, related events. It serves as a crucial bridge between conditional and marginal probabilities, providing a method to determine an overall probability when an event can occur through various mutually exclusive scenarios.

Understanding the Concept

At its core, the Law of Total Probability is applied when an event, let's call it Event A, can happen under different circumstances or states of the world. These circumstances must collectively cover all possibilities and not overlap. This collection of circumstances forms what is known as a partition of the sample space.

Imagine you want to find the probability of Event A occurring. If Event A depends on a series of other events, say B₁, B₂, ..., Bₙ, which are:

  • Mutually Exclusive: No two events can occur at the same time (e.g., a product cannot be made by both Machine 1 and Machine 2 simultaneously).
  • Collectively Exhaustive: Together, these events cover all possible outcomes of the sample space (e.g., all products must come from either Machine 1, Machine 2, or Machine 3; there are no other sources).

Under these conditions, the Law of Total Probability sums up the probabilities of Event A occurring under each of these distinct circumstances.

The Formula

The Law of Total Probability is formally expressed as:

$$P(A) = \sum_{i=1}^{n} P(A|B_i)P(B_i)$$

Or, expanded:

$$P(A) = P(A|B_1)P(B_1) + P(A|B_2)P(B_2) + \dots + P(A|B_n)P(B_n)$$

Where:

  • P(A) is the overall probability of Event A.
  • P(A|Bᵢ) is the conditional probability of Event A occurring, given that Event Bᵢ has occurred.
  • P(Bᵢ) is the marginal probability of Event Bᵢ occurring.

This formula essentially states that the total probability of event A is the sum of the probabilities of A occurring in conjunction with each of the distinct events Bᵢ.

Practical Application and Examples

The Law of Total Probability is widely used in various fields, including:

  • Risk Assessment: Calculating the overall risk of an event (e.g., a system failure) when there are different possible causes.
  • Quality Control: Determining the overall defect rate of products manufactured on different production lines.
  • Medical Diagnosis: Estimating the overall probability of a disease based on test results and different patient demographics.

Let's illustrate with a common example:

Example: Widget Manufacturing Defects

A factory produces widgets using three different machines: Machine X, Machine Y, and Machine Z.

  • Machine X produces 25% of the total widgets.
  • Machine Y produces 40% of the total widgets.
  • Machine Z produces 35% of the total widgets.

The defect rates for each machine are as follows:

  • Widgets from Machine X have a 3% defect rate.
  • Widgets from Machine Y have a 2% defect rate.
  • Widgets from Machine Z have a 4% defect rate.

Question: What is the overall probability that a randomly selected widget from this factory is defective?

Solution:

  1. Define Events:

    • Let $D$ be the event that a widget is defective.
    • Let $X$ be the event that a widget is produced by Machine X.
    • Let $Y$ be the event that a widget is produced by Machine Y.
    • Let $Z$ be the event that a widget is produced by Machine Z.
  2. List Known Probabilities:

    • $P(X) = 0.25$ (Machine X produces 25%)
    • $P(Y) = 0.40$ (Machine Y produces 40%)
    • $P(Z) = 0.35$ (Machine Z produces 35%)
    • $P(D|X) = 0.03$ (3% defect rate for Machine X)
    • $P(D|Y) = 0.02$ (2% defect rate for Machine Y)
    • $P(D|Z) = 0.04$ (4% defect rate for Machine Z)
  3. Apply the Law of Total Probability:
    Since X, Y, and Z form a partition of the total production (they are mutually exclusive and collectively exhaustive), we can use the formula:

    $P(D) = P(D|X)P(X) + P(D|Y)P(Y) + P(D|Z)P(Z)$
    $P(D) = (0.03)(0.25) + (0.02)(0.40) + (0.04)(0.35)$
    $P(D) = 0.0075 + 0.0080 + 0.0140$
    $P(D) = 0.0295$

Answer: The overall probability that a randomly selected widget is defective is 0.0295, or 2.95%.

Why is it Important?

The Law of Total Probability is a cornerstone of probability theory because it provides a systematic way to calculate the probability of an event when direct computation is difficult. It enables us to combine insights from different conditional probabilities, leading to a comprehensive understanding of the overall likelihood of an event. This rule is fundamental for understanding and applying Bayes' Theorem, which is critical in statistical inference and machine learning.