MathIsimple
Grades 10–12
probability
10 min read

Conditional Probability Explained: P(A | B) with Real-World Examples

A clear introduction to conditional probability for grades 10–12: the formula P(A | B), independent vs. dependent events, the multiplication rule, and a worked Bayes example.

What is conditional probability?

Conditional probability is the probability that one event happens given that another event has already happened. We write it P(AB)P(A \mid B), read "the probability of AA given BB."

The formula is

P(AB)=P(AB)P(B),P(B)>0P(A \mid B) = \frac{P(A \cap B)}{P(B)}, \qquad P(B) > 0

where P(AB)P(A \cap B) is the probability that both AA and BB happen. Knowing that BB already occurred shrinks the sample space — instead of looking at all outcomes, we only look at outcomes inside BB, and ask what fraction of those also lie inside AA.

A first example. A standard deck has 52 cards. Let AA = the card is a Queen and BB = the card is a face card (Jack, Queen, or King — 12 cards total). Then

P(AB)=P(AB)P(B)=4/5212/52=412=13.P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{4/52}{12/52} = \frac{4}{12} = \frac{1}{3}.

Among face cards, exactly one third are Queens — exactly what intuition says.

The multiplication rule

Rearranging the formula above gives the multiplication rule for the joint probability:

P(AB)=P(B)P(AB)=P(A)P(BA)P(A \cap B) = P(B) \cdot P(A \mid B) = P(A) \cdot P(B \mid A)

This is how you combine probabilities when events happen in sequence.

Example. A bag has 5 red and 3 blue marbles. You draw two marbles without replacement. What is the probability both are red?

The conditional probability captures the fact that the first draw changes what is left in the bag.

Independent vs. dependent events

Two events are independent when knowing one happened tells you nothing about the other. Formally, AA and BB are independent when

P(AB)=P(A)P(AB)=P(A)P(B).P(A \mid B) = P(A) \quad \Longleftrightarrow \quad P(A \cap B) = P(A) \cdot P(B).

Either condition implies the other, so you can use whichever is easier to check.

Example. Roll a fair six-sided die twice. Let AA = the first roll is a 4 and BB = the second roll is even. The two rolls do not affect each other, so

P(AB)=1612=112.P(A \cap B) = \frac{1}{6} \cdot \frac{1}{2} = \frac{1}{12}.

If two events are not independent, they are dependent. The marble example above is a classic dependent case: the second draw depends on what you already removed from the bag.

Bayes' theorem

Sometimes you know P(BA)P(B \mid A) but want P(AB)P(A \mid B). Bayes' theorem flips a conditional:

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

Here P(A)P(A) is the prior (what you believed about AA before seeing BB), P(BA)P(B \mid A) is the likelihood of the evidence under AA, and P(AB)P(A \mid B) is the posterior (your updated belief).

Example: medical testing. A disease occurs in 2%2\% of a population. A test is 95%95\% sensitive (it gives a positive result 95%95\% of the time when the disease is present) and has a 5%5\% false-positive rate (it gives a positive result 5%5\% of the time when the disease is absent). If a random person tests positive, what is the probability they actually have the disease?

Let DD = "has disease" and ++ = "tests positive." We want P(D+)P(D \mid +).

  1. Total probability of a positive test: P(+)=P(+D)P(D)+P(+¬D)P(¬D)=(0.95)(0.02)+(0.05)(0.98)=0.019+0.049=0.068P(+) = P(+ \mid D) P(D) + P(+ \mid \neg D) P(\neg D) = (0.95)(0.02) + (0.05)(0.98) = 0.019 + 0.049 = 0.068.
  2. Apply Bayes' theorem: P(D+)=P(+D)P(D)P(+)=0.0190.0680.279P(D \mid +) = \dfrac{P(+ \mid D) P(D)}{P(+)} = \dfrac{0.019}{0.068} \approx 0.279.

So even after a positive result, there is only about a 28%28\% chance the person has the disease. The takeaway: when a condition is rare, even an accurate test produces many false positives compared to true positives. This is the kind of result Bayes' theorem makes precise.

A quick recipe

When a problem gives you conditional information, work through it in this order:

  1. Identify the events. Name them AA, BB, DD, ++, etc., so the formulas don't get muddled.
  2. Write down what you know in symbols — P(A)P(A), P(BA)P(B \mid A), etc.
  3. Decide which formula you need: definition of P(AB)P(A \mid B), multiplication rule, or Bayes' theorem.
  4. Plug in and simplify. Always sanity-check that probabilities are between 00 and 11.

Common mistakes

Practice Yourself

Try each one on paper first, then click Show answer to check your work.

  1. 1Practice problem 1

    A bag has 4 red and 6 green balls. You draw two balls without replacement. What is the probability both are green?

    Show answer

    P(first green)=610P(\text{first green}) = \dfrac{6}{10}. After taking one green, 5 greens remain out of 9: P(second greenfirst green)=59P(\text{second green} \mid \text{first green}) = \dfrac{5}{9}. So P(both green)=61059=3090=13P(\text{both green}) = \dfrac{6}{10} \cdot \dfrac{5}{9} = \dfrac{30}{90} = \dfrac{1}{3}.

  2. 2Practice problem 2

    If P(A)=0.4P(A) = 0.4, P(B)=0.5P(B) = 0.5, and P(AB)=0.2P(A \cap B) = 0.2, are AA and BB independent?

    Show answer

    Check P(A)P(B)=0.4×0.5=0.20P(A) \cdot P(B) = 0.4 \times 0.5 = 0.20. This equals P(AB)P(A \cap B), so yes, AA and BB are independent.

  3. 3Practice problem 3

    Given P(AB)=0.18P(A \cap B) = 0.18 and P(B)=0.6P(B) = 0.6, find P(AB)P(A \mid B).

    Show answer

    Apply the definition: P(AB)=0.180.6=0.3P(A \mid B) = \dfrac{0.18}{0.6} = 0.3.

  4. 4Practice problem 4

    A factory has two machines. Machine 1 produces 60%60\% of parts and is defective 1%1\% of the time. Machine 2 produces 40%40\% and is defective 4%4\% of the time. A part is chosen at random and is defective. What is the probability it came from Machine 2?

    Show answer

    Let M1M_1, M2M_2 be the machines and DD be defective. Total defect rate: P(D)=0.6×0.01+0.4×0.04=0.006+0.016=0.022P(D) = 0.6 \times 0.01 + 0.4 \times 0.04 = 0.006 + 0.016 = 0.022. Then P(M2D)=P(DM2)P(M2)P(D)=0.0160.0220.727P(M_2 \mid D) = \dfrac{P(D \mid M_2) P(M_2)}{P(D)} = \dfrac{0.016}{0.022} \approx 0.727.

  5. 5Practice problem 5

    You roll two fair dice. Given that the first die shows a 33, what is the probability the sum is 77?

    Show answer

    Conditioning on the first die being 33, only outcomes where the second die equals 44 give a sum of 77. So P(sum=7first=3)=16P(\text{sum} = 7 \mid \text{first} = 3) = \dfrac{1}{6}.

Related Topics

Frequently Asked Questions

What does $P(A \mid B)$ mean in plain English?

"The probability of AA happening, given that we already know BB happened." Knowing BB shrinks the sample space to just the outcomes inside BB.

When can I assume two events are independent?

When the physical setup makes one event genuinely not affect the other — separate dice rolls, drawing with replacement, or unrelated random processes. Otherwise compute P(AB)P(A \mid B) and check whether it equals P(A)P(A).

What is the difference between conditional probability and joint probability?

P(AB)P(A \cap B) is the joint probability — the chance that both happen. P(AB)P(A \mid B) is the conditional probability — the chance of AA once you already know BB. They are related by P(AB)=P(AB)/P(B)P(A \mid B) = P(A \cap B) / P(B).

Why does a positive medical test not mean you have the disease?

When a disease is rare, the small false-positive rate is multiplied by a much larger healthy population. Bayes' theorem balances those two pieces and shows the posterior probability can be much lower than the test's sensitivity.

Is the multiplication rule the same as Bayes' theorem?

They are closely related. The multiplication rule writes P(AB)P(A \cap B) as P(A)P(BA)P(A) P(B \mid A). Bayes' theorem rearranges that identity to recover P(AB)P(A \mid B) from P(BA)P(B \mid A), P(A)P(A), and P(B)P(B).

Want to keep going?

Try a different problem with the AI Math Solver, browse the practice library, or return to High School Math.

Ask AI ✨