Statisticsdrill

Probability Updated November 2026

Conditional probability

Conditional probability is the chance of A given that B has happened: P(A | B) = P(A and B) / P(B). In a two-way table it is the count in the A-and-B cell divided by the total of the B row or column.

Syntax

P(A | B) = P(A and B) / P(B)
PartWhat it is
P(A and B)the joint probability of both events
P(B)the probability of the condition; must be greater than 0

Examples

100 customers: 40 use the app, and 30 of those 40 made a purchase
P(purchase | app) = 30 / 40

Result: 0.75

Deck of 52 cards: P(king | face card)
face cards = 12, kings among them = 4
4 / 12

Result: 1/3

From probabilities: P(rain) = 0.3, P(rain and late) = 0.12
P(late | rain) = 0.12 / 0.3

Result: 0.4

Independence check: P(A) = 0.5, P(A | B) = 0.5

Result: A and B are independent because the condition does not change the probability

Common mistakes

  • Dividing by the wrong total; P(A | B) divides by the B total, P(B | A) divides by the A total, and the two are usually different.
  • Treating P(A | B) and P(B | A) as the same thing; 90% of sick people test positive does not mean 90% of positives are sick.
  • Using the whole-table total in the denominator; that gives the joint probability P(A and B), not the conditional one.

Practice Conditional probability

These drills check your answer on live data, free, no account needed.

  • Conditional probability from a tableA subscription service tabulates new customers by plan and sign-up channel (see the table). Among customers who signed up through the Web channel, what is the probability that a customer chose the Basic plan? Counts: Basic plan: Web 21, App 28, Store 157; Premium plan: Web 118, App 93, Store 77. Round to 4 decimal places.
  • Total probability across groupsAn online store ships with three carriers. Carrier A handles 20% of orders, B 17% and C 63%. Their late delivery rates are 12%, 9% and 7%. What is the probability that a randomly chosen order arrives late? Round to 4 decimal places.

Questions

How do I read conditional probability from a table?

Find the row or column of the condition, use its total as the denominator, and use the cell where the condition and the event meet as the numerator.

What is the chain rule for probability?

P(A and B) = P(B) * P(A | B). It rearranges the definition and is how you multiply probabilities when events are not independent, for example drawing cards without replacement.

Related

  • Bayes' theoremBayes theorem updates a probability with new evidence. The formula, a medical screening example with exact numbers, the natural frequency shortcut and errors.
  • Probability rulesThe basic probability rules with dice and coin examples: the addition rule for A or B, the multiplication rule for independent events and the complement rule.
  • Chi-square testHow to run a chi-square test of independence or goodness of fit: expected counts, sum of (O - E)^2 / E, degrees of freedom and p-value. Examples and Excel.
  • Permutations and combinationsWhen order matters use permutations nPr = n! / (n - r)!; otherwise combinations nCr = n! / (r! (n - r)!). Examples plus Excel PERMUT and COMBIN.

Previous: Probability rulesNext: Bayes' theorem