Statistics & Probability
Conditional Probability Calculator
Choose your question type and enter the probabilities as decimals, fractions or percents. The calculator substitutes into the formula and shows each step, including a medical-test (false positive) mode.
- 40%
Step-by-step working 3 steps
- 1Conditional probability formula
P(A | B) = P(A and B) ÷ P(B)
Read “probability of A given B”: restrict attention to the cases where B happened.
- 2Substitute
P(A | B) = 0.2 ÷ 0.5 = 0.4
- 3As a percent
40%
How to use the conditional probability calculator
- Choose the question type.
- Enter each probability as a decimal, fraction or percent.
- Follow the substitution into the formula.
- Read the answer as a decimal and a percent.
Formulas
P(A | B) = P(A and B) ÷ P(B) P(A | B) = P(B | A)·P(A) ÷ P(B) P(B) = P(B | A)P(A) + P(B | not A)P(not A)
Conditional probability restricts attention to the cases where B happened.
Worked examples
Each example below is generated by the same calculator you used above, so the working always matches the answer.
P(A and B) 0.2, P(B) 0.5
- 40%
Step-by-step working 3 steps
- 1Conditional probability formula
P(A | B) = P(A and B) ÷ P(B)
Read “probability of A given B”: restrict attention to the cases where B happened.
- 2Substitute
P(A | B) = 0.2 ÷ 0.5 = 0.4
- 3As a percent
40%
Bayes’ theorem
- 48%
Step-by-step working 3 steps
- 1Bayes’ theorem
P(A | B) = P(B | A) × P(A) ÷ P(B)
- 2Substitute
P(A | B) = 0.8 × 0.3 ÷ 0.5 = 0.24 ÷ 0.5 = 0.48
- 3As a percent
48%
Medical test: 1% prevalence
- 15.3846%
- P(positive) = 0.0585
Step-by-step working 3 steps
- 1Set up
P(A) = 0.01 (prior) P(positive | A) = 0.9 (true-positive rate) P(positive | not A) = 0.05 (false-positive rate)
- 2Total probability of a positive result
P(positive) = P(pos | A)·P(A) + P(pos | not A)·P(not A) = 0.9 × 0.01 + 0.05 × 0.99 = 0.0585
- 3Bayes’ theorem
P(A | positive) = 0.009 ÷ 0.0585 = 0.153846
When A is rare, most positives can be false positives even if the test is accurate.
P(A and B) 1/6, P(B) 1/2
- 33.3333%
Step-by-step working 3 steps
- 1Conditional probability formula
P(A | B) = P(A and B) ÷ P(B)
Read “probability of A given B”: restrict attention to the cases where B happened.
- 2Substitute
P(A | B) = 0.166667 ÷ 0.5 = 0.333333
- 3As a percent
33.3333%
Where you will use this
- Medical-test and screening “how likely is it really?” questions
- Two-way table problems in statistics
- Checking Bayes’ theorem homework
Common mistakes to avoid
Confusing P(A | B) with P(B | A)
They are different. A test being 90% accurate does not mean a positive result is 90% likely to be right.
Ignoring the base rate
If a condition is rare, most positives can be false positives even for an accurate test.
Treating dependent events as independent
Multiplying probabilities only works when the events are independent.
Frequently asked questions
What is the formula for conditional probability?
P(A | B) = P(A and B) ÷ P(B), as long as P(B) is not 0.
If P(A and B) = 0.2 and P(B) = 0.5, what is P(A | B)?
0.2 ÷ 0.5 = 0.4, or 40%.
What is Bayes’ theorem used for?
To reverse a conditional probability: from P(B | A) to P(A | B), using the prior P(A) and the overall P(B).
Related calculators
Probability Calculator
One event, both events or either event.
Binomial Probability Calculator
Exactly, at most or at least k successes in n trials.
Permutation & Combination Calculator
nPr, nCr and repetition cases, exact for big numbers.
Standard Deviation Calculator
Sample or population SD with the full working.
Mean, Median & Mode Calculator
Mean, median, mode, range and standard deviation.
Percentage Calculator
% of a number, what percent, original value and % change.
Browse everything in Statistics & Probability or the full calculator list.