Conditional Probability: Formula, Examples & Practice

7 fully solved examples and 5 practice problems on \(P(A \mid B)\)

What is Conditional Probability?

Conditional probability measures the probability of event \( A \) occurring given that event \( B \) has already occurred. The idea is to restrict the sample space from all of \( S \) down to only the outcomes where \( B \) happens. We denote this \( P(A \mid B) \) — read "the probability of \( A \) given \( B \)."

The Conditional Probability Formula

Conditional probability formulas
Rule Formula
Conditional probability \( P(A \mid B) = \dfrac{P(A \cap B)}{P(B)} \)
Multiplication rule (rearranged) \( P(A \cap B) = P(A \mid B) \cdot P(B) \)

Validity: the conditional formula requires \( P(B) \ne 0 \).

Visualizing Conditional Probability — a Die Roll

A fair 6-sided die is rolled.

  1. What is the probability the die shows a 1, 2, or 3?
  2. Given that the number rolled is odd, what is the probability it is a 1, 2, or 3?
View solution

(a) Simple probability. The sample space is \( S = \{1,2,3,4,5,6\} \). Let \( A = \{1,2,3\} \). Then:

\[ P(A) = \frac{n(A)}{n(S)} = \frac{3}{6} = \frac{1}{2} \]

(b) Conditional probability. Let \( B = \{1,3,5\} \) (odd). The two events overlap on \( A \cap B = \{1,3\} \).

Venn diagram showing events A = {1,2,3} and B = {1,3,5} with overlap at {1,3}
Figure 1 — Events A (1, 2, 3) and B (odd numbers).

Given \( B \), our universe shrinks to just \( \{1, 3, 5\} \). Within that restricted space, 2 of the 3 outcomes are also in \( A \):

\[ P(A \mid B) = \frac{n(A \cap B)}{n(B)} = \frac{2}{3} \]
Venn diagram with sample space restricted to event B = {1,3,5}, showing 2 of 3 outcomes in A
Figure 2 — Restricting the sample space to B.

Deriving the formula. Divide numerator and denominator by \( n(S) \):

\[ P(A \mid B) = \frac{n(A \cap B)/n(S)}{n(B)/n(S)} = \frac{P(A \cap B)}{P(B)} \]

Detailed Examples with Solutions

Example 2 — Fruit preferences

In a group of children, the probability that a randomly selected child likes oranges is 0.6. The probability they like both oranges and apples is 0.3. If a child who likes oranges is selected, what is the probability they also like apples?

View solution

Let \( O \) = likes oranges, \( A \) = likes apples. Given \( P(O) = 0.6 \) and \( P(A \cap O) = 0.3 \):

\[ P(A \mid O) = \frac{P(A \cap O)}{P(O)} = \frac{0.3}{0.6} = 0.5 \]

Conclusion: 50%.

Example 3 — Electronics purchase survey

A survey of 100 people who recently bought mobile phones or tablets:

Electronics purchases by brand and type
Mobile Phone Tablet Total
Brand A201030
Brand B304070
Total5050100

If a person is selected at random, find:

  1. The probability they bought brand B.
  2. The probability they bought a mobile phone from brand B.
  3. The probability they bought a mobile phone given they bought brand B.
View solution
  1. \( P(B) = 70/100 = 0.7 \)
  2. \( P(Mp \cap B) = 30/100 = 0.3 \)
  3. \( P(Mp \mid B) = \dfrac{P(Mp \cap B)}{P(B)} = \dfrac{0.3}{0.7} = \dfrac{3}{7} \approx 0.429 \)

Restricted-space shortcut: within the 70 brand-B buyers, 30 bought a mobile phone, giving \( 30/70 = 3/7 \). ✓

Example 4 — Card deck probabilities

Standard deck of 52 playing cards arranged by suit and rank
Figure 3 — Standard 52-card deck (4 suits × 13 ranks).

A single card is drawn from a standard 52-card deck. Find:

  1. \( P(\text{King}) \)
  2. \( P(\text{Red}) \)
  3. \( P(\text{King} \cap \text{Red}) \)
  4. \( P(\text{King} \mid \text{Red}) \)
  5. \( P(\text{Red} \mid \text{King}) \)
  6. \( P(\text{Queen} \mid \text{Heart}) \)
View solution
  1. \( P(\text{King}) = \frac{4}{52} = \frac{1}{13} \)
  2. \( P(\text{Red}) = \frac{26}{52} = \frac{1}{2} \)
  3. \( P(\text{King} \cap \text{Red}) = \frac{2}{52} = \frac{1}{26} \)
  4. \( P(\text{King} \mid \text{Red}) = \dfrac{1/26}{1/2} = \frac{1}{13} \) (or \( 2/26 \) directly)
  5. \( P(\text{Red} \mid \text{King}) = \dfrac{1/26}{1/13} = \frac{1}{2} \) (or \( 2/4 \) directly)
  6. \( P(\text{Queen} \mid \text{Heart}) = \dfrac{1/52}{13/52} = \frac{1}{13} \)

Example 5 — Car dealership inventory

A dealership's vehicle inventory by type and color:

Car inventory by color and type
SUV Sport Car Van Coupe Total
Black3510251585
White101520550
Blue151553065
Total60405050200

If a car is selected at random, find:

  1. Probability it is black given it is a Van.
  2. Probability it is an SUV given it is white.
  3. Probability it is blue given it is a Coupe.
View solution
  1. \( P(\text{Black} \mid \text{Van}) = \dfrac{25}{50} = \frac{1}{2} \)
  2. \( P(\text{SUV} \mid \text{White}) = \dfrac{10}{50} = \frac{1}{5} \)
  3. \( P(\text{Blue} \mid \text{Coupe}) = \dfrac{30}{50} = \frac{3}{5} \)

Shortcut: each answer is just the ratio of "row/column cell" to "row/column total" — the formula agrees with the table's marginal counts.

Example 6 — Insurance survey

A survey of 100 people showed that 40% have both home and car insurance with a specific company. The probability of having car insurance is 0.7. What is the probability that a person has home insurance given they have car insurance?

View solution

Let \( H \) = home insurance, \( C \) = car insurance. Given \( P(C) = 0.7 \) and \( P(H \cap C) = 0.4 \):

\[ P(H \mid C) = \frac{P(H \cap C)}{P(C)} = \frac{0.4}{0.7} = \frac{4}{7} \approx 0.571 \]

Conclusion: 57.1% of car-insurance holders also hold home insurance.

Example 7 — Sports participation survey

Out of 200 students surveyed, 120 play football, 50 play basketball, and 20 play both.

  1. What is the probability a student plays football given they play basketball?
  2. What is the probability a student plays basketball given they play football?
  3. What is the probability a student plays football given they play exactly one sport?
View solution

Let \( F \) = plays football, \( B \) = plays basketball. Then \( P(F) = 120/200 = 0.6 \), \( P(B) = 50/200 = 0.25 \), \( P(F \cap B) = 20/200 = 0.1 \).

  1. \( P(F \mid B) = \dfrac{0.1}{0.25} = 0.4 \)
  2. \( P(B \mid F) = \dfrac{0.1}{0.6} = \frac{1}{6} \approx 0.167 \)
  3. Let \( O \) = exactly one sport. Then:

    \[ n(O) = (120 - 20) + (50 - 20) = 100 + 30 = 130 \] \[ P(O) = \frac{130}{200} = 0.65 \]

    The intersection \( F \cap O \) is "football only" = 100 students:

    \[ P(F \cap O) = \frac{100}{200} = 0.5 \] \[ P(F \mid O) = \frac{0.5}{0.65} = \frac{10}{13} \approx 0.769 \]
Venn diagram showing two overlapping sets (the sports scenario uses the same layout as a car/bicycle overlap)
Figure 4 — Overlapping-set diagram illustrating football and basketball.
Venn diagram highlighting the exactly-one-sport region
Figure 5 — Restricting to "exactly one sport" (the two non-overlapping regions).

Practice Problems

Practice 1 — Even given greater than 3

A fair die is rolled. Find the probability of rolling an even number given that the number rolled is greater than 3.

Answer

\( E = \{2,4,6\} \), \( G = \{4,5,6\} \), \( E \cap G = \{4,6\} \).

\[ P(E \mid G) = \frac{2/6}{3/6} = \frac{2}{3} \]

Practice 2 — Getting a 3 given a red card

A card is drawn from a standard 52-card deck. Find the probability of getting a 3 given that the card is red.

Answer
\[ P(T \mid R) = \frac{P(T \cap R)}{P(R)} = \frac{2/52}{26/52} = \frac{2}{26} = \frac{1}{13} \]

Practice 3 — Cars and bicycles

Out of 120 people: 90 own cars, 40 own bicycles, 10 own neither.

  1. Probability they own both.
  2. Probability they own a car given they own a bicycle.
  3. Probability they own a bicycle given they own exactly one of the two.
Answer

Let \( x \) = owns both. Then \( (90-x) + (40-x) + x + 10 = 120 \Rightarrow x = 20 \).

  1. \( P(C \cap B) = 20/120 = 1/6 \)
  2. \( P(C \mid B) = 20/40 = 1/2 \)
  3. Exactly-one count = \( 70 + 20 = 90 \). The intersection with "owns bicycle" is "bicycle only" = 20. So \( P(B \mid \text{exactly one}) = (20/120)/(90/120) = 20/90 = 2/9 \).

Practice 4 — Two companies

Company A produces 70 products (40 software, 30 hardware). Company B produces 50 products (x hardware, y software).

  1. \( P(H \mid B) \) in terms of x.
  2. \( P(H \mid A) \).
  3. For which x is (a) greater than (b)?
Answer
  1. \( P(H \mid B) = x/50 \)
  2. \( P(H \mid A) = 30/70 = 3/7 \)
  3. \( x/50 > 3/7 \Rightarrow 7x > 150 \Rightarrow x > 21.43 \). Since x is an integer, \( x \ge 22 \).

Practice 5 — Economy and market

The probability the market goes down given the economy deteriorates is 0.8. The probability the economy deteriorates is 0.5. What is the probability the economy deteriorates and the market goes down?

Answer
\[ P(S \cap E) = P(S \mid E) \cdot P(E) = 0.8 \times 0.5 = 0.4 \]

Frequently Asked Questions

What is conditional probability?

\(P(A \mid B)\) is the probability that event \(A\) occurs given that \(B\) has already occurred. It is defined as \(P(A \mid B) = P(A \cap B)/P(B)\) whenever \(P(B) > 0\). Conceptually, it restricts the sample space from \(S\) down to \(B\).

What is the multiplication rule?

Rearranging the definition gives \(P(A \cap B) = P(A \mid B) \cdot P(B)\). This computes the probability of both events occurring when the conditional probability is known.

When are two events independent?

Events \(A\) and \(B\) are independent iff \(P(A \mid B) = P(A)\), equivalently \(P(A \cap B) = P(A) \cdot P(B)\). Independence means knowing \(B\) gives no information about whether \(A\) occurs.

How is conditional probability related to Bayes' Theorem?

Bayes' Theorem is built from two applications of conditional probability: \(P(A \mid B) = P(A \cap B)/P(B)\) and \(P(B \mid A) = P(A \cap B)/P(A)\). Eliminating \(P(A \cap B)\) gives \(P(A \mid B) = P(B \mid A) \cdot P(A)/P(B)\), which inverts the direction of conditioning.

Related Probability & Statistics Topics

Last updated: October 20, 2026