DISCRETE MATH • DISCRETE PROBABILITY

Conditional probability and independence

Understanding how new information reshapes uncertainty and when events have no influence on each other.

Historical Context & Motivation

The idea that knowing something about one event can change the likelihood of another has deep roots in the history of probability theory. Long before formal axioms were written, gamblers and philosophers grappled with the question: if you already know part of the outcome, how should you update your expectations? The formal treatment of conditional probability and independence arose from centuries of effort to bring mathematical rigor to uncertainty. These concepts now underpin everything from medical diagnostics and machine learning to cryptography and network reliability, making them indispensable tools in discrete mathematics and computer science.

1654
Pascal–Fermat Correspondence
Blaise Pascal and Pierre de Fermat exchanged letters on the "problem of points," laying the groundwork for reasoning about probabilities conditioned on partial outcomes in games of chance.
1763
Bayes' Theorem Published
Thomas Bayes' posthumous paper, edited by Richard Price, introduced a systematic method for computing the probability of a cause given an observed effect—the first formal statement of inverse conditional probability.
1812
Laplace's Théorie Analytique
Pierre-Simon Laplace generalized Bayes' result, defined independence explicitly, and used conditional reasoning extensively in his comprehensive treatise on probability.
1933
Kolmogorov's Axioms
Andrey Kolmogorov axiomatized probability theory using measure theory, defining conditional probability as P(A | B) = P(A ∩ B) / P(B) and independence as P(A ∩ B) = P(A) · P(B), placing both concepts on rigorous footing.

The central question this lesson addresses is twofold. First, given that some event B has occurred (or is known to be true), how do we recalculate the probability of another event A? Second, under what precise conditions does knowing B tell us absolutely nothing new about A—that is, when are two events truly independent? Answering these questions rigorously is essential for modeling real-world systems in which events interact—or conspicuously do not.

Core Principles & Definitions

Before diving into computations, it is important to establish the conceptual foundations that make conditional probability and independence precise. We work within a finite or countably infinite sample space Ω, a probability measure P satisfying Kolmogorov's axioms, and events A, B ⊆ Ω. The following principles form the backbone of everything that follows.

1

Conditional Probability

The probability of A given B is defined as P(A | B) = P(A ∩ B) / P(B), provided P(B) > 0. Conceptually, this restricts the sample space from Ω to B, then measures A's share within that reduced universe.
2

Multiplication Rule

Rearranging the definition yields P(A ∩ B) = P(A | B) · P(B). This chain rule generalizes to n events: P(A₁ ∩ A₂ ∩ … ∩ Aₙ) = P(A₁) · P(A₂ | A₁) · P(A₃ | A₁ ∩ A₂) · … and is fundamental in combinatorial counting arguments.
3

Independence

Two events A and B are independent if and only if P(A ∩ B) = P(A) · P(B). Equivalently, P(A | B) = P(A) whenever P(B) > 0—knowing B occurred does not update our belief about A.
4

Law of Total Probability

If B₁, B₂, …, Bₙ partition Ω, then P(A) = Σᵢ P(A | Bᵢ) · P(Bᵢ). This allows us to decompose a complex probability into conditional slices, each of which may be easier to compute.
5

Mutual vs. Pairwise Independence

Events A₁, …, Aₙ are mutually independent if for every subset S ⊆ {1, …, n}, P(∩ᵢ∈S Aᵢ) = Πᵢ∈S P(Aᵢ). Pairwise independence (all pairs independent) is strictly weaker; mutual independence requires all 2ⁿ − n − 1 subset conditions.
KEY TAKEAWAY
Think of conditional probability as adjusting a camera's field of view. Ordinarily, you photograph the entire landscape (Ω). When you learn that B has happened, you zoom into just the region B, and the proportion of that zoomed-in frame occupied by A is P(A | B). Independence means that no matter how much you zoom into B, A's proportion of the frame never changes—its relative size is the same whether you view the full landscape or any subregion. In engineering terms, independence means one subsystem's failure rate is unaffected by the state of another subsystem.

Visual Explanation

Venn Diagram: Conditional Probability as Area Restriction

The Venn diagram illustrates the geometric intuition behind conditional probability. The violet circle represents event A, the cyan circle represents event B, and the pink overlap is A ∩ B. When we condition on B, we effectively discard everything outside B, and P(A | B) becomes the ratio of the pink overlap to the entire cyan circle: 0.15 / 0.5 = 0.3. Note that P(A) = 0.4 but P(A | B) = 0.3, so these events are not independent—knowing B has occurred decreases our assessment of A's likelihood.

This area-based interpretation is more than a pedagogical convenience; it mirrors the measure-theoretic definition precisely. When P(B) > 0, conditioning on B creates a new probability measure Q(A) = P(A ∩ B) / P(B) that satisfies all of Kolmogorov's axioms restricted to the σ-algebra intersected with B. In the discrete case, you can think of each outcome ω ∈ B as being re-weighted: its probability under Q is P({ω}) / P(B). Outcomes outside B receive probability zero. This "shrink and rescale" operation is the essence of conditioning.

Mathematical Framework

We now formalize the key equations governing conditional probability and independence, beginning with the definition and progressing through Bayes' theorem. Throughout, let (Ω, P) be a discrete probability space with events A, B ⊆ Ω.

DEFINITION OF CONDITIONAL PROBABILITY
P(A | B) = P(A ∩ B) / P(B), P(B) > 0
P(A | B) denotes the probability of event A given that event B has occurred. The numerator captures outcomes common to both events; the denominator normalizes by the total probability of the conditioning event.
INDEPENDENCE CRITERION
A ⊥ B ⟺ P(A ∩ B) = P(A) · P(B)
Two events are independent if and only if the probability of their intersection equals the product of their individual probabilities. Equivalently, P(A | B) = P(A) and P(B | A) = P(B). Note: independence is a symmetric relation and is not the same as mutual exclusivity.
LAW OF TOTAL PROBABILITY
P(A) = Σᵢ₌₁ⁿ P(A | Bᵢ) · P(Bᵢ), where {B₁, …, Bₙ} partitions Ω
If the Bᵢ are mutually exclusive and exhaustive (i.e., Bᵢ ∩ Bⱼ = ∅ for i ≠ j and ∪ Bᵢ = Ω), then the total probability of A is the weighted sum of its conditional probabilities across each partition element.
BAYES' THEOREM
P(Bⱼ | A) = P(A | Bⱼ) · P(Bⱼ) / Σᵢ₌₁ⁿ P(A | Bᵢ) · P(Bᵢ)
Bayes' theorem inverts the direction of conditioning. Given a partition {B₁, …, Bₙ} and an observed event A, it computes the posterior probability P(Bⱼ | A) from the likelihood P(A | Bⱼ), prior P(Bⱼ), and total probability of A in the denominator.
⚠️ Independence ≠ Mutual Exclusivity
A common misconception is conflating independence with disjointness. If A and B are mutually exclusive (A ∩ B = ∅) and both have positive probability, then P(A ∩ B) = 0 ≠ P(A) · P(B), so they are dependent. Knowing that one has occurred tells you with certainty that the other has not. Conversely, independent events with positive probabilities must overlap.

Classifying Dependence and Independence

In practice, determining whether events are independent or dependent requires checking the product rule P(A ∩ B) = P(A) · P(B). The following diagram provides a decision flowchart that systematically distinguishes the cases and highlights the contrast with mutual exclusivity. After the diagram, a comparison table summarizes the key differences between independence, dependence, and mutual exclusivity in discrete probability spaces.

This flowchart guides the decision process for classifying two events. Start at the top by computing both P(A ∩ B) and the product P(A) · P(B). If they are equal, the events are independent. If not, they are dependent. The orange box emphasizes that mutual exclusivity is a special case of dependence, not independence.
Comparison of independence, dependence, and mutual exclusivity
PropertyIndependent EventsDependent EventsMutually Exclusive Events
P(A ∩ B)= P(A) · P(B)≠ P(A) · P(B)= 0
P(A | B)= P(A)≠ P(A)= 0
Can both occur?Yes (overlap required if both have P > 0)Yes (overlap exists but not at product rate)No (A ∩ B = ∅)
Are they dependent?NoYesYes (special case)

Worked Example: Medical Testing with Bayes' Theorem

A disease affects 1% of a population. A diagnostic test has a sensitivity (true positive rate) of 95% and a specificity (true negative rate) of 98%. If a randomly selected person tests positive, what is the probability that they actually have the disease?

Computing P(Disease | Positive Test)
1
Step 1 — Define Events and Given ProbabilitiesLet D = "person has the disease" and T⁺ = "test is positive." We are given: P(D) = 0.01, P(Dᶜ) = 0.99, P(T⁺ | D) = 0.95 (sensitivity), P(T⁻ | Dᶜ) = 0.98 so P(T⁺ | Dᶜ) = 0.02 (false positive rate).
P(D) = 0.01, P(T⁺ | D) = 0.95, P(T⁺ | Dᶜ) = 0.02
2
Step 2 — Apply the Law of Total ProbabilityCompute the total probability of testing positive: P(T⁺) = P(T⁺ | D) · P(D) + P(T⁺ | Dᶜ) · P(Dᶜ) = (0.95)(0.01) + (0.02)(0.99) = 0.0095 + 0.0198 = 0.0293.
P(T⁺) = 0.0293
3
Step 3 — Apply Bayes' TheoremNow invert the conditional: P(D | T⁺) = P(T⁺ | D) · P(D) / P(T⁺) = (0.95 × 0.01) / 0.0293 = 0.0095 / 0.0293 ≈ 0.3242.
P(D | T⁺) ≈ 0.324 or about 32.4%
4
Step 4 — Interpret the ResultDespite the test's high sensitivity (95%) and specificity (98%), a positive result corresponds to only a 32.4% chance of actually having the disease. This is because the disease prevalence is very low (1%), so the false positives from the large healthy population outnumber the true positives from the small diseased population. This counterintuitive result is known as the base rate fallacy and demonstrates why conditional probability reasoning is essential in medical decision-making.
🔍 Check for Independence
Are D and T⁺ independent in this scenario? If they were, we would need P(D ∩ T⁺) = P(D) · P(T⁺) = 0.01 × 0.0293 = 0.000293. But P(D ∩ T⁺) = P(T⁺ | D) · P(D) = 0.0095, which is much larger. Therefore D and T⁺ are strongly dependent—as we would expect from a useful diagnostic test.

Common Pitfalls and Practical Insights

Conditional probability and independence are deceptively simple to define but remarkably easy to misapply. The following table catalogs the most frequent errors and contrasts them with correct reasoning. Understanding these pitfalls is crucial for anyone working with probabilistic models, whether in algorithm design, statistical inference, or discrete mathematics proofs.

Common errors in conditional probability and independence reasoning
Pitfall / IssueIncorrect ReasoningCorrect Approach
Confusing P(A | B) with P(B | A)"If 90% of spam emails contain 'free,' then an email with 'free' has a 90% chance of being spam."Use Bayes' theorem. P(Spam | 'free') depends on the prior P(Spam) and P('free' | Not Spam).
Equating mutual exclusivity with independence"A and B can't both happen, so knowing A tells me nothing about B."If A ∩ B = ∅ and both have P > 0, they are dependent: P(A | B) = 0 ≠ P(A).
Assuming pairwise ⇒ mutual independence"All pairs are independent, so the three events are mutually independent."Pairwise independence does not imply mutual independence. Must verify P(A ∩ B ∩ C) = P(A)·P(B)·P(C) separately.
Ignoring the base rate"The test is 99% accurate, so a positive result means I'm 99% likely to be sick."Must incorporate disease prevalence (prior). Low base rates dramatically reduce the positive predictive value.
Conditioning on zero-probability events"P(A | B) = P(A ∩ B)/P(B)" applied when P(B) = 0.The definition requires P(B) > 0. For continuous distributions, use conditional densities or regular conditional probabilities.
KEY TAKEAWAY
Independence is a precise algebraic property, not an intuitive judgment. Two events may seem "unrelated" in everyday language yet be probabilistically dependent (or vice versa). Always verify independence by checking the product rule P(A ∩ B) = P(A) · P(B) computationally. In the context of system design—say, redundant servers—assuming independence without verification can lead to catastrophically underestimating correlated failures.

Connection to Advanced Topics

The concepts of conditional probability and independence in discrete settings serve as the launchpad for many advanced topics in probability, statistics, and theoretical computer science. Understanding these foundational ideas makes it possible to engage with sophisticated models where conditioning and independence assumptions play central structural roles. The table below maps the core ideas of this lesson to their generalizations in more advanced frameworks.

From discrete foundations to advanced probability and CS theory
This Lesson's ConceptAdvanced GeneralizationWhere It Appears
P(A | B) = P(A ∩ B) / P(B)Conditional expectation E[X | Y], regular conditional distributionsMeasure-theoretic probability, stochastic processes
Independence of two eventsIndependence of σ-algebras, independent random variablesStrong law of large numbers, central limit theorem proofs
Bayes' theorem (discrete)Bayesian inference, posterior distributions, MCMCMachine learning, computational statistics, AI
Chain rule for n eventsBayesian networks, graphical model factorizationsProbabilistic graphical models, causal inference
Conditional independence (A ⊥ B | C)Markov property, d-separationMarkov chains, hidden Markov models, reinforcement learning

A particularly important generalization is conditional independence: events A and B are conditionally independent given C if P(A ∩ B | C) = P(A | C) · P(B | C). Two variables might be dependent marginally but become independent once a common cause is observed. This idea is the cornerstone of Bayesian networks—directed acyclic graphs in which nodes represent random variables and edges encode direct dependencies. The chain rule of conditional probability provides the mathematical justification for factoring a joint distribution along the graph's structure, enabling efficient inference even in high-dimensional spaces. If you continue into courses on algorithms, machine learning, or information theory, these foundations will appear repeatedly.

Practice Problems

PROBLEM 1CONCEPTUAL
Events A and B satisfy P(A) = 0.6, P(B) = 0.5, and A ∩ B = ∅. Are A and B independent? Explain why or why not, and contrast independence with mutual exclusivity.
PROBLEM 2BASIC CALCULATION
A standard deck of 52 cards is shuffled. One card is drawn. Let A = "the card is a King" and B = "the card is a Heart." Compute P(A | B) and determine whether A and B are independent.
PROBLEM 3INTERMEDIATE
Two fair dice are rolled. Let A = "the sum is 7" and B = "the first die shows 3." Find P(A | B), P(B | A), and verify whether A and B are independent.
PROBLEM 4APPLIED
A network has two independent routers, R₁ and R₂, each with a 0.02 probability of failure on any given day. The network goes down only if both routers fail simultaneously. (a) What is the probability the network goes down on a given day? (b) If you observe that R₁ has failed, what is the conditional probability that the network is down? (c) A monitoring system reports "at least one router failed." Given this information, what is the probability the network is down?
PROBLEM 5CRITICAL THINKING
Construct an explicit example of three events A, B, C on a finite sample space that are pairwise independent but not mutually independent. State the sample space, the probability measure, define each event, and verify all four conditions (three pairwise equations and the failure of the triple product equation).

Lesson Summary

Conditional probability quantifies how the likelihood of an event A changes when we know that another event B has occurred, via the formula P(A | B) = P(A ∩ B) / P(B). Geometrically, this corresponds to restricting the sample space Ω to the subset B and rescaling probabilities so they sum to one. Two events are independent if and only if P(A ∩ B) = P(A) · P(B), meaning conditioning on B does not alter A's probability. The Law of Total Probability decomposes P(A) across a partition, and Bayes' theorem inverts the direction of conditioning to compute posterior probabilities from likelihoods and priors.

Critical distinctions to remember: mutual exclusivity implies dependence (not independence) when both events have positive probability; pairwise independence does not guarantee mutual independence; and P(A | B) is generally not equal to P(B | A). These concepts extend naturally to conditional independence, Bayesian networks, and the Markov property, forming the backbone of probabilistic reasoning in computer science and statistics.

Varsity Tutors • Discrete Math • Conditional probability and independence