Mathematics
Probability calculator
From classical probability to Bayes' theorem: pick the rule your problem needs and enter the figures. The complement is always shown, because “at least one” problems are solved through it.
The rules and when they apply
The classical definition — favourable cases over possible cases — holds only if every case is equally likely. That is why it works with dice and packs of cards and not with “either it rains tomorrow or it does not”: those two cases are not equally likely, and counting them as two out of two would give 50% to any event whatsoever.
Union and intersection are the two basic operations. For the union you add the probabilities and subtract the intersection, because the shared cases would otherwise be counted twice. For the intersection you multiply, but only if the events are independent: drawing two aces from a pack without replacement is not independent, and multiplying 4/52 by 4/52 gives the wrong answer.
Bayes' theorem is the least intuitive and the most useful. In its diagnostic-test form it shows why a test that is 99% accurate for a rare disease still produces a flood of false alarms: if the disease affects one person in a hundred and the test is wrong for 5% of healthy people, then out of ten thousand people about ninety-nine of the sick are found but nearly five hundred healthy ones test positive. The probability of actually being ill after a positive test is therefore around 17%, not 99%.
Common mistakes
- Multiplying the probabilities of events that are not independent: if the outcome of the first changes the conditions of the second, you need conditional probability, not a plain product.
- Entering percentages instead of fractions: a probability of 25% is written 0.25. A value above 1 is not a probability.
- Swapping P(A|B) for P(B|A) in Bayes' theorem: the probability of being ill given a positive test is very different from the probability of testing positive given illness. It is the very error the theorem is built around.
Frequently asked questions
How do you find the probability of two independent events?
Multiply the two probabilities: P(A ∩ B) = P(A) · P(B). It holds only if the events are independent, that is if one happening does not change the probability of the other.
How do you find the probability that at least one of two events happens?
With the union formula: P(A) + P(B) − P(A ∩ B). For independent events you can also go through the complement: 1 minus the probability that neither happens.
What is conditional probability?
The probability of A given that B has happened, equal to P(A ∩ B)/P(B). Knowing that B occurred narrows the sample space, so you divide by the probability of B.
When is the binomial distribution used?
When the same independent trial with two outcomes and a constant probability of success is repeated n times and you want to know how likely exactly k successes are. Coin tosses, free throws, quality checks on a batch.
How this calculation works
Classical probability: P = favourable cases / possible cases, valid when the cases are equally likely. Complement: P(not A) = 1 − P(A). Union: P(A ∪ B) = P(A) + P(B) − P(A ∩ B). Intersection of independent events: P(A ∩ B) = P(A)·P(B); at least one of the two: 1 − (1−P(A))·(1−P(B)). Conditional probability: P(A|B) = P(A ∩ B)/P(B), defined for P(B) > 0. Bayes' theorem: P(A|B) = P(B|A)·P(A) / [P(B|A)·P(A) + P(B|¬A)·P(¬A)], where the denominator is the total probability of the evidence. Binomial distribution: P(X = k) = C(n; k)·pᵏ·(1−p)ⁿ⁻ᵏ, with expected value n·p and variance n·p·(1−p).
Related calculators
Combinatorics
Factorial, permutations, arrangements, combinations and the binomial coefficient.
Sequences
Arithmetic and geometric sequences, nth term and sums.
Descriptive statistics
Mean, median, mode, standard deviation, quartiles and frequency distribution.
Grade average
Simple and weighted averages, and the mark needed for a target.