Chapter 2: Conditional Probability and Independence#
If you have ever changed your guess after seeing new information—like rethinking the chance of rain when you spot dark clouds—you already have an intuitive feel for conditional probability. In this chapter we make that idea precise. Then we learn how to break complex problems into simpler conditional pieces, how to reverse a conditional question with Bayes’ formula, and finally what it really means for events and random variables to be independent.
The Big Picture#
Probability is all about reasoning with uncertainty. But often we don’t see all possibilities at once—we get a clue, a piece of data, that narrows the field. This chapter answers one big question: how do we update our probabilities when we learn that something has happened? From that question we get the Law of Total Probability and Bayes’ formula—two very practical tools for data analysis, medicine, and everyday decisions. Then we look at the opposite idea: when does knowing one thing give you no information about another? That’s independence, and it’s the foundation of many probability models.
Conditional Probability#
Imagine you roll a fair six‑sided die. The probability of rolling a 4 is
We write this situation with a simple formula:
Conditional probability: The conditional probability of event
given event , written , is
provided.
The denominator
It helps to picture a Venn diagram. Think of a rectangle as the whole sample space. The event
A short example. Pick a card at random from a standard 52‑card deck. Let
Makes sense: among face cards, one third are kings.
Note that once we condition on
Sometimes we flip the condition around:
📝 Section Recap: Conditional probability
updates our probability of by restricting the sample space to and rescaling; it is the ratio .
The Law of Total Probability#
Real‑world problems often come in layers. You want the probability of some event
We start with a partition of the sample space: a set of events
- mutually exclusive:
for , - exhaustive: their union is the whole sample space,
.
Think of it as chopping the whole universe into non‑overlapping pieces, like slicing a pie. Then for any event
Law of Total Probability:
In words: the overall probability of
Why does this hold? Because
Example: A test with two paths. Suppose a factory has two machines that produce light bulbs. Machine 1 makes
Let
So a randomly chosen bulb has a
The Law of Total Probability is a “divide and conquer” strategy: split a hard problem into easier sub‑problems and combine the answers. It is especially useful when
📝 Section Recap: The Law of Total Probability expresses
as a sum of conditional probabilities weighted by , where the partition the sample space. It turns a tough probability into a manageable weighted average.
Bayes’ Formula#
Sometimes we know
Starting from the definition of conditional probability,
Now replace the denominator
Bayes’ formula:
The numerator is the
This is a mathematical version of “update your prior beliefs with evidence.” We start with a prior probability
Example: disease testing. Suppose a rare disease affects
Let the partition be
Plug in numbers:
Even with a positive test, the probability of actually having the disease is only about
Bayes’ formula is the basis of many methods: Bayesian statistics, machine‑learning classifiers, spam filters, and medical diagnosis. It is simply a logical way to flip a conditional probability.
📝 Section Recap: Bayes’ formula computes the reverse conditional probability
by multiplying the prior by the likelihood and normalising by the total probability. It is the optimal recipe for updating beliefs when new evidence arrives.
Independence of Events#
Conditional probability tells us how events are linked. The opposite extreme is when knowing one event tells you absolutely nothing about another—they are independent.
Intuitively,
Independent events: Two events
and are independent if
Example: coin and die. Toss a fair coin and roll a fair six‑sided die. The combined experiment has
Do not confuse independence with mutual exclusivity. If
Independence can be extended to more than two events, but the definition needs care.
📝 Section Recap: Two events are independent if the chance of both occurring is the product of their individual chances:
. This captures the idea that learning one event gives no information about the other.
Pairwise and Mutual Independence#
For three events
Mutual independence of events
means that for every subset of the events, the probability of the intersection equals the product of the individual probabilities. For three events, this requires:
and the triple condition:
Pairwise independence only guarantees the first three equations; it does not force the triple product to factor. Mutual independence demands that all subset intersections factor, not just pairs.
A classic counterexample: two coins. Toss two fair coins. Define
: first coin heads, : second coin heads, : both coins show the same face (both heads or both tails).
Then
So the events are pairwise independent. But
When we say a set of events is “independent” without qualification, we always mean mutually independent. This distinction becomes especially important in reliability analysis and probabilistic proofs.
📝 Section Recap: Mutual independence requires that the probability of the intersection of any subset of events equals the product of their probabilities. Pairwise independence is not enough; triple and higher‑order intersections must also factor.
Independence of Random Variables#
A random variable
Independent random variables:
and are independent if for any (reasonable) sets and ,
In plain words: every event aboutis independent of every event about .
For discrete random variables this condition is equivalent to the joint probability mass function (pmf) factoring:
for all possible values
For continuous random variables independence means that the joint probability density function (pdf)
for all
In either case the idea is the same: knowing the value of
Independence can be extended to more than two random variables: a collection
In terms of densities, the joint pdf (or pmf) splits completely into the product of the marginals.
📝 Section Recap: Two random variables are independent when the probability of any joint event factors as the product of the individual event probabilities. For discrete variables, the joint pmf is the product of marginal pmfs; for continuous variables, the joint pdf is the product of marginal pdfs.
Product Measures for Independent Experiments#
Many experiments consist of two or more unrelated sub‑experiments, like rolling a die and flipping a coin. Probability theory has a clean way to describe such independent combinations: the product probability measure.
Suppose we have two independent experiments with sample spaces
This rule extends to all events built from such rectangles and defines the product measure
Discrete product measure. If both experiments are discrete, with probability mass functions
Any event’s probability is the sum of these products over the event. For instance, two independent fair die rolls have
Continuous product measure. For independent random variables
Then the probability that
This factorization is both a definition of independence and a practical tool. It lets us build complex models by multiplying simpler ones.
The product‑measure construction generalises to any finite or countable number of independent experiments. In each case, probabilities (or densities) multiply, which is a direct consequence of mutual independence.
📝 Section Recap: When experiments are independent, the probability measure on the combined sample space is the product measure, obtained by multiplying the probabilities of the individual outcomes. In the discrete case, the joint pmf is the product of marginals; in the continuous case, the joint pdf is the product of marginals.
Summary#
We began with a simple but profound question: how do we update probability when we learn that something happened? That gave us conditional probability. We then saw how to break a probability into conditional pieces using a partition—the Law of Total Probability. Bayes’ formula turned the tables, letting us compute the “reverse” conditional probability and update our prior beliefs. Independence then arrived as the extreme case where conditioning changes nothing. We distinguished pairwise from mutual independence and extended the idea to random variables, culminating in the product‑measure construction for independent experiments. These tools are the workhorses of probability: they let you reason about partial information, combine evidence, and build models out of independent pieces.
| Key idea | What it means (plain English) | Why it matters |
|---|---|---|
| Conditional probability |
The chance of |
It lets you update probabilities when you receive new information—essential for any kind of learning from data. |
| Law of Total Probability | The overall probability of an event is a weighted average of its conditional probabilities across a partition, weighted by the partition’s probabilities. | Breaks complex problems into simpler conditional chunks; the basis for many inference and simulation methods. |
| Bayes’ formula | Reverses a conditional probability: |
The mathematical engine for updating beliefs. Powers medical diagnosis, spam filters, machine learning classifiers, and scientific reasoning. |
| Independence (events) | Two events are independent if |
Allows huge simplifications in models; often a reasonable assumption in real‑world systems. |
| Mutual vs. pairwise independence | Mutual independence requires that all subset intersections factor; pairwise only requires each pair. | Many probability results rely on full mutual independence. Pairwise alone can give deceptively wrong conclusions in multi‑variable settings. |
| Independence of random variables | Justifies multiplying probabilities for separate measurements; the foundation for the behaviour of sums, averages, and limit theorems. | |
| Product probability measure | For independent experiments, the probability of a combined outcome is the product of the individual probabilities. | Formalises how to combine independent sources of randomness; gives us the joint distribution from marginals. |