Conditional Probability

Conditional probability calculates the likelihood of one event given that another event has definitely already occurred, denoted P(A|B).

P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}

Solve a problem with Conditional Probability

Type the problem. The solver will use Conditional Probability where Conditional Probability is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Conditional Probability takes
AA
BB
Conditional Probability
SymbolMeaning
AAThe event whose probability we want to find; it is the outcome of interest that appears before the vertical bar.
BBThe condition or given event—something we already know has happened, and it appears after the vertical bar.

When to use it

Reach for this when you have new information about one event and need to update your belief about another.

Level

Usually taught in: Statistics · Appears on: AP Statistics

Worked examples

1. Rolling an even number on a die

Problem

A standard die is rolled. Given that the result is even, what is the probability that it shows a 6?
  1. P(AB)=16P(A \cap B) = \frac{1}{6}

    Rolling a 6 satisfies both conditions—it is a 6 and it is even—so the intersection has probability 1/61/6.

  2. P(B)=36=12P(B) = \frac{3}{6} = \frac{1}{2}

    Three outcomes are even (2, 4, 6), so P(B)=3/6P(B) = 3/6, which simplifies to 1/21/2.

  3. P(AB)=P(AB)P(B)=1/61/2P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{1/6}{1/2}

    Apply the conditional probability formula, substituting our values.

  4. 16÷12=16×21=26=13\frac{1}{6} \div \frac{1}{2} = \frac{1}{6} \times \frac{2}{1} = \frac{2}{6} = \frac{1}{3}

    Divide by multiplying by the reciprocal and simplify.

Answer: P(AB)=13P(A \mid B) = \frac{1}{3}

This answer makes sense: among the three even outcomes (2, 4, 6), only one is a 6, so the probability is 1/31/3. The conditional probability formula correctly shrinks our sample space from all six outcomes to only the three even outcomes.

2. Drawing a heart from face cards

Problem

A standard deck has 52 cards with 12 face cards (Jack, Queen, King in each of 4 suits). If we draw one card and observe it is a face card, what is the probability it is a heart?
  1. P(AB)=352P(A \cap B) = \frac{3}{52}

    There are exactly 3 heart face cards (J♥, Q♥, K♥) among all 52 cards, so P(AB)=3/52P(A \cap B) = 3/52.

  2. P(B)=1252=313P(B) = \frac{12}{52} = \frac{3}{13}

    All face cards total 12 (three in each of the four suits), so P(B)=12/52P(B) = 12/52, which reduces to 3/133/13.

  3. P(AB)=3/523/13P(A \mid B) = \frac{3/52}{3/13}

    Substitute into the conditional probability formula.

  4. 352×133=3×1352×3=39156=14\frac{3}{52} \times \frac{13}{3} = \frac{3 \times 13}{52 \times 3} = \frac{39}{156} = \frac{1}{4}

    To divide fractions, multiply by the reciprocal; the 3's cancel and 52=4×1352 = 4 \times 13, so we get 1/41/4.

Answer: P(AB)=14P(A \mid B) = \frac{1}{4}

Of the 12 face cards, 3 are hearts, giving 3/12=1/43/12 = 1/4. The conditional probability formula correctly filters the full deck down to just the face cards we know about, then computes the fraction that are hearts.

3. Coffee shop purchase correlation

Problem

At a coffee shop, 60% of customers buy coffee, 40% buy food, and 30% buy both. If we randomly select a customer who bought coffee, what is the probability they also bought food?
  1. P(AB)=0.30P(A \cap B) = 0.30

    The problem states that 30% of customers buy both coffee and food.

  2. P(B)=0.60P(B) = 0.60

    The problem states that 60% of customers buy coffee, which is our condition.

  3. P(AB)=0.300.60P(A \mid B) = \frac{0.30}{0.60}

    Apply the conditional probability formula with the given values.

  4. P(AB)=3060=12=0.5P(A \mid B) = \frac{30}{60} = \frac{1}{2} = 0.5

    Simplify by converting to fractions: 30/6030/60 reduces to 1/21/2 or 0.5.

Answer: P(AB)=0.5 or 50%P(A \mid B) = 0.5 \text{ or } 50\%

Among all coffee buyers (60% of customers), exactly half of them also bought food. This is different from saying "30% of all customers buy both"—we are restricting our attention to coffee buyers only and asking what fraction of them purchased food.

Common mistakes

Where Conditional Probability usually goes wrong
Answer came out wrong
Writing P(AB)=P(BA)P(A | B) = P(B | A) or swapping which event goes before and after the bar.
Remember: the event AFTER the vertical bar is the condition (what we know happened), and the event BEFORE the bar is what we want to find the probability of. Reverse the order and you change the entire problem.
Writing P(AB)=P(AB)P(A | B) = P(A \cap B) and forgetting to divide by P(B)P(B).
Always include the division: P(AB)=P(AB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)}. The denominator shrinks the sample space to only outcomes where B occurred.
Writing P(AB)=P(AB)P(A)P(A | B) = \frac{P(A \cap B)}{P(A)} instead of dividing by P(B)P(B).
Double-check: the denominator is ALWAYS the probability of whatever appears after the vertical bar. If you want P(AB)P(A|B), divide by P(B)P(B); if you want P(BA)P(B|A), divide by P(A)P(A).
The mistakeWhy it is wrongThe fix
Writing P(AB)=P(BA)P(A | B) = P(B | A) or swapping which event goes before and after the bar.These are two different probabilities with different meanings: P(AB)P(A|B) is the probability of A given B, while P(BA)P(B|A) is the probability of B given A, and they are usually not equal.Remember: the event AFTER the vertical bar is the condition (what we know happened), and the event BEFORE the bar is what we want to find the probability of. Reverse the order and you change the entire problem.
Writing P(AB)=P(AB)P(A | B) = P(A \cap B) and forgetting to divide by P(B)P(B).The intersection P(AB)P(A \cap B) is just one piece of the formula; you must divide by P(B)P(B) to account for the fact that B restricts the sample space.Always include the division: P(AB)=P(AB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)}. The denominator shrinks the sample space to only outcomes where B occurred.
Writing P(AB)=P(AB)P(A)P(A | B) = \frac{P(A \cap B)}{P(A)} instead of dividing by P(B)P(B).Since both P(A)P(A) and P(B)P(B) appear in problems, students sometimes confuse which one is the denominator. The denominator must be the probability of the condition—the event after the bar.Double-check: the denominator is ALWAYS the probability of whatever appears after the vertical bar. If you want P(AB)P(A|B), divide by P(B)P(B); if you want P(BA)P(B|A), divide by P(A)P(A).

Tips and when to use something else

  • If P(B)=0P(B) = 0 (the condition is impossible), the conditional probability is undefined. You cannot condition on something that never happens.
  • When A and B are independent, knowing B gives you no information about A, so P(AB)=P(A)P(A|B) = P(A). Check independence with the Multiplication Rule: if P(AB)=P(A)P(B)P(A \cap B) = P(A) \cdot P(B), the events are independent—use that formula instead of computing a conditional.
  • Conditional probability measures how past information changes likelihood in data, but it does not prove causation. Just because P(wet grassrain)=0.95P(\text{wet grass} | \text{rain}) = 0.95 does not mean rain caused the grass to be wet.
  • In real-world settings, the sample space shrinks to only outcomes where the condition is true. Think of P(AB)P(A|B) as asking: 'Of all the times B happened, what fraction of those also had A?'

Frequently asked questions

What does the vertical bar in P(A|B) mean?
The vertical bar means 'given' or 'knowing that.' It separates the event of interest (A, on the left) from the known condition (B, on the right). Think of it as a divider: everything to the left is what you want to find, and everything to the right is what you already know happened.
Why do we divide by P(B) in the formula?
Dividing by P(B)P(B) rescales the sample space. Instead of considering all possible outcomes, you narrow it down to only outcomes where B is true, then ask what fraction of those also satisfy A. The denominator is the 'new total' when you condition on B.
Can conditional probability be greater than 1?
No. Since P(AB)P(B)P(A \cap B) \le P(B) always (the intersection cannot be larger than the part), the formula P(AB)=P(AB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)} always gives a value between 0 and 1, just like any probability.
When should I use conditional probability instead of regular probability?
Use conditional probability when you have been told that one event definitely occurred and you want to update the probability of another event based on that information. For example, 'Given that it rained today, what is the probability the grass is wet?' If you did not have that information, you would use basic probability instead.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18