Statistics & Probability • Independence & Conditional Probability

Conditional Probability of A Given B

Learn how knowing that one event has already occurred changes the likelihood of another — the foundation of modern probabilistic reasoning.

Historical Context & Motivation

Humans have grappled with questions of chance for thousands of years, but it was not until the development of formal probability theory that mathematicians could describe, precisely, how new information changes what we expect. The concept of conditional probability — the likelihood of an event occurring given that another event has already happened — sits at the heart of statistics, medicine, finance, and everyday decision-making. Before we dive into the formula, let's trace the ideas that made it possible.

1654
Blaise Pascal and Pierre de Fermat exchange a series of letters about gambling problems. Their correspondence establishes the first rigorous framework for calculating probabilities and lays the groundwork for reasoning about how outcomes depend on prior events.
1713
Jacob Bernoulli publishes Ars Conjectandi posthumously, formalizing the law of large numbers and showing that probability can be treated as a branch of mathematics rather than mere intuition about dice and cards.
1763
Thomas Bayes' essay is published after his death, presenting what we now call Bayes' Theorem. This theorem is built directly on conditional probability and shows how to update beliefs when new evidence arrives — an idea that revolutionizes statistics.
1812
Pierre-Simon Laplace refines and popularizes Bayesian reasoning in Théorie analytique des probabilités, giving the conditional probability formula its modern algebraic form and applying it to problems in astronomy and science.
1933
Andrey Kolmogorov publishes his axioms of probability, placing the entire subject on a rigorous mathematical foundation. Conditional probability is defined formally as P(A | B) = P(A ∩ B) / P(B), the very formula you will learn in this lesson.

The question that conditional probability answers is deceptively simple: If you already know that event B happened, how does that change the probability of event A? This turns out to be one of the most powerful questions in all of mathematics — it underpins medical diagnostic tests, spam email filters, weather forecasting, and the way courts evaluate DNA evidence. Understanding the formula P(A | B) = P(A ∩ B) / P(B) is your entry point to all of these applications.

Core Principles & Definitions

Before working with the conditional probability formula, you need a clear understanding of four foundational ideas. Each one builds naturally on what you already know about basic probability, so think of this section as connecting the dots between concepts you've seen before.

1

Sample Space & Events

The sample space S is the set of all possible outcomes. An event is any subset of S. For example, when rolling a die, S = {1, 2, 3, 4, 5, 6}, and the event "rolling an even number" is {2, 4, 6}.
2

P(A ∩ B) — The Joint Probability

P(A ∩ B) is the probability that both events A and B occur simultaneously. In set language, A ∩ B is the intersection — the outcomes that belong to both A and B at the same time.
3

P(B) — The Condition

When we say "given B," we mean that B has already occurred or is assumed to be true. P(B) is the probability of this conditioning event. Crucially, P(B) must be greater than zero — you can't condition on an impossible event.
4

P(A | B) — The Conditional Probability

P(A | B) reads "the probability of A given B." It answers: if we restrict our attention to only the outcomes where B is true, what fraction of those also satisfy A? This is the ratio P(A ∩ B) / P(B).
Key Takeaway
Think of conditional probability like a filter on a search engine. When you search for "restaurants" you get millions of results. But when you add the filter "within 5 miles," the search engine narrows the universe of results to only those that satisfy the condition. Conditional probability does the same thing: P(A | B) narrows the universe from the entire sample space S down to only the outcomes in B, and then asks what fraction of that smaller world belongs to A.

Visual Explanation — Venn Diagram

The best way to build intuition for conditional probability is to see it. The Venn diagram below represents a sample space S with two overlapping events, A and B. Study the shaded regions carefully — they are the key to understanding the formula.

Venn diagram showing two overlapping events A and B inside a sample space S, with the intersection A ∩ B highlighted.

When you compute P(A | B), you are mentally "zooming in" on the purple circle B and asking: of all the outcomes inside B, what fraction also falls inside the green intersection A ∩ B? The part of A that lies outside B no longer matters because you already know B happened. This is why the denominator of the formula is P(B) — it rescales everything so that B becomes the new "whole." The numerator P(A ∩ B) captures only the overlap where both A and B are true.

Mathematical Framework

With the visual intuition established, let's formalize the conditional probability formula and explore the key equations that flow from it. These relationships are the tools you'll use to solve problems.

The Conditional Probability Formula
P(A | B) = P(A ∩ B) / P(B), where P(B) > 0
Read as: "the probability of A given B equals the probability of A and B divided by the probability of B."

Let's unpack each piece. P(A | B) is the conditional probability — the quantity we want to find. P(A ∩ B) is the joint probability that both A and B occur; this is also sometimes written as P(A and B). P(B) is the marginal probability of the conditioning event B. Division by P(B) effectively "shrinks" the sample space down to B alone, ensuring that the probabilities within that reduced space still sum to 1.

The Multiplication Rule (Rearranged)
P(A ∩ B) = P(A | B) × P(B)
Multiply both sides of the conditional probability formula by P(B) to find the joint probability.

This rearrangement is extremely useful. If you know the conditional probability and the probability of the condition, you can recover the joint probability by multiplying. You can also swap the roles of A and B to get P(A ∩ B) = P(B | A) × P(A), which leads directly to Bayes' Theorem — a topic you'll encounter soon if you haven't already.

Connection to Independence
If A and B are independent: P(A | B) = P(A)
Knowing B occurred tells you nothing new about A. The condition has no effect.

Independence is a special case. When two events are independent, knowing that B happened doesn't change the probability of A at all. In that case, P(A | B) simplifies to just P(A), and the joint probability becomes P(A ∩ B) = P(A) × P(B). Recognizing whether events are independent or dependent is a critical skill — if you mistakenly treat dependent events as independent, your calculations will be wrong.

Detailed Breakdown — Two-Way Frequency Tables

One of the most practical tools for computing conditional probabilities is a two-way frequency table (also called a contingency table). These tables organize data about two categorical variables into rows and columns, making it straightforward to read off joint and marginal counts. Let's walk through a concrete example.

Suppose a school surveyed 200 students about whether they play a sport and whether they have a part-time job. The results are summarized below.

Plays a SportDoes Not Play a SportTotal
Has a Job305080
No Job7050120
Total100100200

From this table you can compute any conditional probability by identifying the right cells. For instance, what is the probability that a randomly selected student plays a sport, given that they have a job? Let A = "plays a sport" and B = "has a job." Then P(A ∩ B) = 30/200 = 0.15 and P(B) = 80/200 = 0.40. Applying the formula:

Calculation
P(A | B) = P(A ∩ B) / P(B) = 0.15 / 0.40 = 0.375

Equivalently, you can think of it directly from counts: of the 80 students with a job, 30 play a sport, so the conditional probability is 30/80 = 0.375, or 37.5%. Notice how this differs from the unconditional probability P(A) = 100/200 = 0.50. Having a job lowers the probability of playing a sport from 50% to 37.5%, which suggests these two events are not independent.

Bar chart comparing unconditional probability P(A) to conditional probability P(A|B) using values from the two-way table.

The bar chart makes the comparison vivid. Among all students, half play a sport. But among students with a job, only 37.5% play a sport, while among students without a job, 58.3% play one (that's 70/120). The condition — having or not having a job — substantially shifts the probability. This is exactly the phenomenon that conditional probability captures.

Worked Example

Let's work through a complete problem from start to finish, showing every step and highlighting the reasoning behind each calculation.

Drawing a King Given a Face Card
1
ProblemA standard deck of 52 cards is well-shuffled and one card is drawn. Find the probability that the card is a king, given that the card is a face card (jack, queen, or king).
2
Step 1 — Define the EventsLet A = "the card is a king" and B = "the card is a face card." A face card is defined as a jack, queen, or king. We want P(A | B).
3
Step 2 — Find P(A ∩ B)The intersection A ∩ B represents cards that are both kings and face cards. Since every king is automatically a face card, the set of kings is entirely contained within the set of face cards. Therefore A ∩ B = A, meaning A ∩ B = {K♠, K♥, K♦, K♣}.
P(A ∩ B) = 4 / 52 = 1/13 ≈ 0.0769
4
Step 3 — Find P(B)There are 3 face card ranks (jack, queen, king) in each of 4 suits, giving 3 × 4 = 12 face cards total.
P(B) = 12 / 52 = 3/13 ≈ 0.2308
5
Step 4 — Apply the FormulaSubstitute into the conditional probability formula.
P(A | B) = P(A ∩ B) / P(B) = (4/52) / (12/52) = 4/12 = 1/3 ≈ 0.3333
6
Step 5 — Interpret the ResultThe probability that the drawn card is a king, given that it is a face card, is 1/3 ≈ 33.3%. This makes intuitive sense: once you know the card is a face card, there are only 12 possibilities (jacks, queens, kings), and 4 of those are kings. Compare this with the unconditional probability P(A) = 4/52 ≈ 7.7%. Learning that the card is a face card dramatically increases the likelihood that it is a king — more than quadrupling it — because the condition eliminates 40 of the 52 possible outcomes.

Strengths, Limitations & Common Mistakes

The conditional probability formula is elegant and powerful, but it can trip students up in predictable ways. The table below maps out where the formula excels and where caution is needed.

StrengthsLimitations / Pitfalls
Works for any pair of events with P(B) > 0 — discrete or continuous, simple or complex.Undefined when P(B) = 0. You cannot condition on an event with zero probability (dividing by zero is meaningless).
Directly connects to two-way tables and Venn diagrams, giving multiple access points for understanding.Confusing P(A | B) with P(B | A). These are not the same. "The probability of rain given clouds" ≠ "the probability of clouds given rain." This error is so common it has a name: the inverse fallacy.
Foundation for Bayes' Theorem, the multiplication rule, and testing independence.Assuming independence without checking. If events are dependent, P(A ∩ B) ≠ P(A) × P(B), and you must use the conditional form P(A | B) × P(B).
Applies to real-world data — medical tests, polls, quality control, risk analysis.Base rate neglect. People often focus on the conditional probability (e.g., test accuracy) while ignoring the base rate P(B), which can lead to wildly wrong conclusions about P(A | B).
Key Takeaway
The most dangerous mistake is flipping the condition — confusing P(A | B) with P(B | A). Think of it like this: "the probability you're wet given it's raining" is very high (maybe 90% if you're outside), but "the probability it's raining given you're wet" could be much lower (maybe you just got out of a swimming pool). The direction of the "given" matters enormously, and the only way to switch directions reliably is through Bayes' Theorem.

Connection to Advanced Theory

Understanding P(A | B) = P(A ∩ B) / P(B) isn't just a standalone skill — it's a gateway to more powerful ideas that appear in AP Statistics, college probability courses, and real-world data science. Here's how the concept extends.

This LessonAdvanced ExtensionWhere You'll See It
P(A | B) = P(A ∩ B) / P(B)Bayes' Theorem: P(A | B) = P(B | A) × P(A) / P(B)Medical testing, machine learning, spam filtering
Testing if P(A | B) = P(A)Chi-squared test of independence — statistical test for whether two categorical variables are independent in a data set.AP Statistics, social science research
Multiplication rule: P(A ∩ B) = P(A | B) × P(B)Chain rule of probability: P(A ∩ B ∩ C) = P(A | B ∩ C) × P(B | C) × P(C)Bayesian networks, natural language processing
Conditional probability with countsConditional distributions — full probability distributions defined relative to a condition, not just single-event probabilities.College statistics, data science

Think of the formula you learned today as the first building block. Bayes' Theorem is essentially the same formula used twice and rearranged, so the intuition you've built here — narrowing the sample space, comparing the intersection to the condition — will carry you through these more advanced topics with a solid conceptual foundation.

Practice Problems

Test your understanding with these five problems, arranged from conceptual understanding to multi-step synthesis. Try each one on your own before checking the answer.

PROBLEM 1CONCEPTUAL
In your own words, explain why P(A | B) is not the same as P(B | A). Give a brief real-world example where confusing the two would lead to an incorrect conclusion.
PROBLEM 2BASIC CALCULATION
A bag contains 5 red marbles, 3 blue marbles, and 2 green marbles. A marble is drawn at random. Given that the marble is not green, what is the probability that it is blue?
PROBLEM 3INTERMEDIATE
At a high school, 60% of students participate in extracurricular activities. Among students who participate in extracurriculars, 45% also volunteer in the community. Find the probability that a randomly selected student both participates in extracurriculars and volunteers.
PROBLEM 4APPLIED / MULTI-STEP
A factory produces widgets on two assembly lines. Line A produces 70% of all widgets and has a 4% defect rate. Line B produces 30% of all widgets and has a 6% defect rate. A widget is selected at random and found to be defective. What is the probability it came from Line A?
PROBLEM 5SYNTHESIS / CRITICAL THINKING
Two events A and B satisfy P(A) = 0.5, P(B) = 0.4, and P(A | B) = 0.6. Determine whether A and B are independent, find P(B | A), and find P(A ∪ B). Show your reasoning for each part.

Lesson Summary

Conditional probability answers the question: "If event B has already occurred, what is the probability of event A?" The formula P(A | B) = P(A ∩ B) / P(B) works by narrowing the sample space from all possible outcomes down to only those in B, then measuring what fraction of that smaller universe also belongs to A. You can visualize this with Venn diagrams, where the condition "zooms in" on one circle, or with two-way frequency tables, where you isolate a single row or column and compute proportions within it.

Key takeaways include: P(A | B) ≠ P(B | A) — the direction of the "given" matters; events are independent if and only if P(A | B) = P(A), meaning the condition has no effect; and the formula can be rearranged into the multiplication rule P(A ∩ B) = P(A | B) × P(B), which becomes the foundation for Bayes' Theorem and the chain rule of probability. Mastering this formula gives you a powerful lens for analyzing dependent events in statistics, science, and everyday decision-making.

Varsity Tutors • Statistics and Probability (Common Core) • Conditional Probability of A Given B