On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Statistics & Probability · Grade 9-12

Conditional Probability

Conditional probability P(A∣B) is the chance of A given that B has occurred — you divide the overlap by the size of the known condition.

P(A|B) = \frac{P(A
Venn diagram of Event A and Event BA two-event view of conditional probability.ABA ∩ B
A: Event A
B: Event B
A two-event view of conditional probability.

Quick Answer

Conditional probability P(A∣B) is the chance of A given that B has occurred — you divide the overlap by the size of the known condition. Use it whenever you are told something has already happened and need the updated chance of something else: whether a card is a heart once you know it is red, or whether a person is ill once a test comes back positive. Keep only the outcomes where B is true and ask what fraction of them also have A: P(A∣B)=P(A and B)P(B).

Why This Matters

Conditional probability is how evidence changes a chance. It explains why a positive result on a fairly accurate test for a rare disease can still leave the disease unlikely, and why P(positive∣disease) and P(disease∣positive) are different numbers. Mixing the two up leads to wrong conclusions in medicine, courtrooms and spam filters.

Intuitive Explanation

Draw a card from a standard 52-card deck and peek only at its color: red. Your world has just shrunk from 52 cards to the 26 red ones. Of those 26, 13 are hearts, so P(heart∣red)=1326=12. Before you peeked it was 1352=14. The information did not change the deck; it changed which cards are still possible, and so it changed the denominator.

A table of counts makes this concrete. In a class of 30, 12 students play a sport, 8 play music and 5 do both. Given that a student plays music, the chance they also play a sport is 58: look only at the 8 musicians. Given that a student plays a sport, the chance they play music is 512. Same overlap of 5, different denominators, which is why P(A∣B) and P(B∣A) usually differ.

The joint probability P(A and B) looks similar but has no 'given': it is the overlap measured against everyone, 530 for sport and music. The formula connects the two: P(sport∣music)=5/308/30=58. When knowing B leaves the chance of A unchanged, P(A∣B)=P(A) and the events are independent; here 58 is far from P(sport)=1230, so they are not.

Think of it like this. Conditioning is a search filter. Filter a deck to red cards and 26 remain; hearts are half of what is on screen, so P(heart∣red)=12. Filter to hearts instead and every result is red, so P(red∣heart)=1. Swapping the filter changes the answer.

Core idea. P(A∣B) is the chance of A once you restrict attention to only the cases where B already happened.


When to Use

Use conditional probability when a problem says given, if we know, 'among those who' or 'of the students who', or when new information arrives: a test result, a peek at a card, a first draw already made. The denominator becomes the group that meets the condition. If nothing is given and the question asks for the chance that both things happen, it is a joint probability over the whole sample space. Always check which event sits after the bar.

Tip. Ask: Has some information already been revealed that shrinks the set of possible outcomes?

How to Recognize It

Before writing P(A∣B), sort the facts into what is already known and what is being asked, and find the group the answer is a fraction of.

  1. Is the answer a fraction of a smaller group, such as the students who ride the bus or the people who tested positive?

    If yes, that group goes in the denominator, and the question is conditional. If the answer is a fraction of everyone, such as the chance a random student both rides the bus and lives far away, it is a joint probability.

  2. Can you say which event is known and which is in question, and put each on the correct side of the bar?

    If the known fact is a positive test and the question is about illness, you want P(ill∣positive). Swapping them gives P(positive∣ill), a measure of the test's accuracy, which can be a very different number.

  3. Is the chance of A among the cases where B holds the same as its chance overall?

    If yes, A and B are independent and P(A∣B)=P(A), so the condition can be dropped. If the two chances differ, the condition matters and you need the full formula.

  4. Has a first card or marble already been drawn and kept out before the second is described?

    If yes, the second chance is conditional on the first: after a red card is removed, P(red second∣red first)=2551. If the card goes back and the deck is shuffled, the condition no longer matters.

Conditional Probability compared with Joint probability, Independent events, and Reversed conditional P(B|A)

All four rows involve two events and their overlap, so they share the same numbers. What separates them is the denominator: everyone for a joint probability, the known group for P(A∣B), the other group for P(B∣A); with independent events the condition changes nothing.

Conditional Probability

Meaning
Use this when new information about one event narrows the possibilities and you want the updated probability of another.
Key test
Has some information already been revealed that shrinks the set of possible outcomes?
Formula
P(A∣B)=P(A and B)P(B)
Example
From a standard deck, a card is drawn and seen to be red. What is the probability it is a heart?

Joint probability

Meaning
The chance both A and B happen, out of the full sample space.
Key test
Use when nothing is assumed yet and you want both to occur.
Formula
P(A∩B)
Example
Chance a card is red AND a heart from all 52

Independent events

Meaning
A special case where P(A∣B)=P(A) — the condition changes nothing.
Key test
Use when the condition has no effect; then conditioning is pointless.
Formula
P(A∩B)=P(A)P(B)
Example
Coin flip given a die roll

Reversed conditional P(B∣A)

Meaning
The condition and event are swapped, generally a different value.
Key test
Use when the given information is the other event.
Formula
P(B∣A)=P(A∩B)P(A)
Example
Test-positive given disease vs disease given test-positive

Formula & Notation

P(A∣B)=P(A and B)P(B)
P(A∣B)=P(A∩B)P(B) where P(B)>0

How to read it: P(A∣B) reads 'the probability of A given B'; the vertical bar means 'given that' — it names the event you already know happened. P(A∩B) is the chance both happen, and P(B) is the new, smaller denominator (once B is given, only B's outcomes are left to count). P(A∣B) and P(B∣A) usually differ because they divide by different totals: with 12 sport, 8 music, 5 both, P(sport∣music)=5/8 but P(music∣sport)=5/12.

Worked Examples

Example 1 — Heart given red

Easy

From a standard deck, a card is drawn and seen to be red. What is the probability it is a heart?
Show the steps and the answer
  1. Apply the condition: the card is red, so only the 26 red cards remain possible.

    The information rules out all 26 black cards, so they leave the denominator.

  2. Count hearts among the red cards: all 13 hearts are red.

    Favorable outcomes must also satisfy the condition, and every heart does.

  3. Divide: P(heart∣red)=1326=12.

    Overlap (red hearts) over the size of the condition (red cards).

  4. Confirm with the formula: P(heart and red)P(red)=13/5226/52=12.

    The formula and the shrunken count agree, since the 52s cancel.

Answer: 12

Takeaway: Shrink the sample space to the given event, then count the favorable outcomes inside it.

Example 2 — Joint, not conditional

Standard

From a full deck, what is the probability a card is red AND a heart, before seeing anything?
Show the steps and the answer
  1. Notice there is no 'given': nothing about the card has been revealed.

    So the denominator stays at all 52 cards.

  2. Count cards that are both red and hearts: 13.

    Every heart is red, so 'red and heart' is the same set as 'heart'.

  3. Divide: 1352=14.

    A joint probability is the overlap measured against the full deck.

  4. Compare with the first example: the same 13 cards on top, but 14 instead of 12.

    Only the denominator differs: 52 with no information, 26 once red is known.

Answer: 1352=14

Takeaway: 'And' with nothing revealed is a joint probability over the whole sample space; 'given' shrinks the denominator.

Example 3 — Find the mistake: the reversed condition

Application

A disease affects 1% of people. A test is positive for 90% of people who have the disease and for 5% of people who do not. Rosa writes: "The test catches 90% of cases, so someone who tests positive has a 90% chance of having the disease." Find the mistake and correct it.
Show the steps and the answer
  1. Write what 90% means: P(positive∣disease)=0.9.

    It is measured among sick people, but the question is about people who tested positive, a different group.

  2. Picture 10,000 people: 1% is 100 sick people, and 90 of them test positive.

    Whole numbers make both groups visible.

  3. Count false positives: 5% of the 9,900 healthy people is 495.

    Healthy people far outnumber sick ones, so a small false-positive rate still produces many positives.

  4. Divide by everyone who tested positive: P(disease∣positive)=9090+495=90585≈0.15.

    The given event is a positive test, so its 585 people form the denominator.

Answer: P(disease∣positive)≈15%, not 90%

Takeaway: Check which event is given; P(A∣B) and P(B∣A) share an overlap but divide by different groups.

Where You'll See It

  • Spam filters sorting your email

    A filter learns that a phrase like 'claim your prize' appears in many spam messages but very few real ones. When a new email contains it, the filter computes the chance the message is spam given the phrase, which is far higher than the overall spam rate, and moves the email accordingly.

  • Car insurance prices by driver age

    If records showed 120 crashes in a year among 1,000 drivers aged 17 and 40 among 1,000 drivers aged 40, the conditional crash rates are 1201000=12% given age 17 and 401000=4% given age 40. Insurers set prices from conditional rates like these, which is why teen premiums cost more.

Common Mistakes

  1. The slip: Dividing by the whole sample space

    Instead: divide by P(B), the known condition, which shrinks the denominator.

  2. The slip: Swapping P(A∣B) and P(B∣A)

    Instead: read carefully which event is the 'given.'

  3. The slip: Assuming independence to skip the formula

    Instead: only set P(A∣B)=P(A) if you have verified the events are independent.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. If P(A and B)=0.12 and P(B)=0.4, find P(A∣B).

    Hint: Divide the joint probability by the probability of the given event.

  2. A fair die is rolled, and you are told the result is greater than 3. What is the probability it is even?

    Hint: The new sample space is only the results greater than 3.

  3. In a class of 30, 18 students play a sport. Of those 18, 12 play an instrument. Of the other 12 students, 4 play an instrument. Find P(instrument∣sport) and P(sport∣instrument).

    Hint: Each "given" group becomes the denominator. How many play an instrument in total?

  4. A disease affects 1% of people. A test is positive for 90% of sick people and 5% of healthy people. Out of 10,000 people, what is P(sick∣positive)?

    Hint: Count the sick positives and the healthy positives out of 10,000.

  5. Of 200 students surveyed, 50 play chess, and 20 of the chess players are girls. A question asks: "If a chess player is picked at random, what is the chance she is a girl?" Conditional or joint probability?

    Hint: Is the pick made from all 200 students or from a smaller group?

  6. A survey of 100 people finds 40 dog owners, and 10 of them also own a cat. Eli writes: "P(cat∣dog)=10100=0.1." Correct his work.

    Hint: Which group does "given dog" restrict you to?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why should you switch doors in the Monty Hall problem?

You pick one of three doors, and the host, who knows where the car is, opens another door to show a goat. Your first pick was right with probability 13\frac{1}{3}, and the reveal cannot change that, because the host can always find a goat to show. So the other closed door holds the car with probability 23\frac{2}{3}. The condition is not just that a goat sits behind the opened door, but that a host who never reveals the car chose to open it.

Can P(A∣B) ever be smaller than the chance that both A and B happen?

Never. P(A∣B)P(A|B) divides the overlap P(A and B)P(A \text{ and } B) by P(B)P(B), a number no bigger than 1, so the result is at least as large as the overlap. If 3% of students are left-handed tennis players and 20% play tennis, then P(left-handed∣tennis)=0.030.20=0.15P(\text{left-handed}|\text{tennis}) = \frac{0.03}{0.20} = 0.15, five times the overlap. The two are equal only when BB is certain, so the condition adds nothing.

How does a spam filter use conditional probability?

It is trained on thousands of emails already marked as spam or not. From them it learns chances such as P(the word winner∣spam)P(\text{the word winner}|\text{spam}) and P(the word winner∣not spam)P(\text{the word winner}|\text{not spam}). For a new email, it turns these around with Bayes' theorem to estimate P(spam∣the words in this email)P(\text{spam}|\text{the words in this email}), and moves the email if that chance is high. Turning the condition around also needs the base rate: the share of all email that is spam.

Learning Path

Conditional Probability

You are here

Next →

Nothing after this yet
You need Probability, for favorable-over-total, and Independent Events, the special case where the condition changes nothing. Conditional probability adds the shrinking denominator and P(A∣B)=P(A and B)P(B). With it you can work multi-stage tree diagrams, use Bayes' theorem to reverse a condition (from P(positive∣disease) to P(disease∣positive)), and test whether two variables in a two-way table are related.

See Also