Worked examples
Grade 11: P(A) = 0.6, P(B) = 0.5, P(A∩B) = 0.4
P(A|B) = 0.4 ÷ 0.5 = 0.8, not independent
Grade 11: P(A) = 1/2, P(B) = 1/3, P(A∩B) = 1/6
1/6 = 1/2 × 1/3, so independent and P(A|B) = 1/2
Grade 11: base rate 1%, true positive rate 90%, false positive rate 5%
posterior 2/13 ≈ 15.4%
How to use it
- For "Conditional probability and independence" enter P(A), P(B) and P(A∩B); decimals, fractions and percents all work.
- For "Bayes theorem" enter the base rate, the true positive rate and the false positive rate.
- Read the conditional (or posterior) probability and whether the events are independent.
What this calculates
The conditional probability P(A|B) is the probability of A given that B has happened. Only the cases where B happens count as the new whole, so P(A|B) = P(A∩B) ÷ P(B). If P(A∩B) = P(A) × P(B), one event does not change the other's probability and the events are independent. Bayes theorem reverses the question: from an observed result it finds the probability of the cause. It is taught in the probability and statistics unit of upper secondary school.
The formulas
- Conditional probability P(A|B) = P(A∩B) ÷ P(B)
- Union P(A∪B) = P(A) + P(B) − P(A∩B)
- Independence P(A∩B) = P(A) × P(B)
- Bayes theorem P(H|+) = P(+|H) P(H) ÷ [P(+|H) P(H) + P(+|not H) P(not H)]
Reference table
| Input | Result | ||
|---|---|---|---|
| 1% | 99% | 5% | 16.7% |
| 10% | 90% | 10% | 50.0% |
| 50% | 80% | 20% | 80.0% |
| 1% | 90% | 1% | 47.6% |
| 30% | 70% | 20% | 60.0% |
Good to know
- For repeated trials, see the Binomial Distribution Calculator.
- To count cases, see the Permutation and Combination Calculator.
Sources
Frequently asked questions
Are P(A|B) and P(B|A) the same?
Usually not. P(A|B) is the share of A among cases where B happens; P(B|A) is the share of B among cases where A happens. The denominators differ.
What does independent mean?
Knowing that B happened does not change the probability of A, so P(A|B) = P(A).
Are "mutually exclusive" and "independent" the same?
No. Exclusive events cannot happen together (P(A∩B) = 0); independent events do not affect each other. Two exclusive events with non-zero probability are actually not independent.
I get a message that the probabilities do not fit.
P(A∩B) cannot exceed P(A) or P(B), and cannot be below P(A) + P(B) − 1. Outside this range you are asked to check the inputs.
The Bayes result is lower than I expected.
When the base rate is very low, even an accurate test can have a low share of real cases among its yes results. The third example is like that.
Are my numbers stored?
No. Everything is calculated in your browser and nothing is sent to a server or saved.
Last updated 2026-12-02 · For reference only; not investment, tax or legal advice.