Probability Calculator
Combine two events (and, or, given), apply Bayes' theorem with a tree of natural frequencies, or find the chance over repeated trials.
As a decimal, a percent or a fraction: 0.25, 25% or 1/4.
Assumed: one happening does not change the chance of the other.
- P(A and B)Both
- ≈ 8.333%
- 1/12 · 0.08333 · 1 in 12
- P(A or B)At least one
- ≈ 58.33%
- 7/12 · 0.5833
- P(neither)Neither A nor B
- ≈ 41.67%
- 5/12 · 0.4167 · 1 in 2.4
- P(exactly one)A or B, not both
- 50%
- 1/2 · 0.5 · 1 in 2
- P(A | B)A, when B happens
- ≈ 16.67%
- 1/6 · 0.1667 · 1 in 6
- P(B | A)B, when A happens
- 50%
- 1/2 · 0.5 · 1 in 2
Working
Three calculators in one. Two events combines P(A) and P(B) into the chance of both, of either, of neither and of each given the other, with a Venn diagram. Bayes turns a base rate and a test's error rates into the chance that a positive result is right, and shows it as counts of people. Repeated trials gives the chance of exactly, at least or at most k successes in n tries.
Probabilities can be typed as decimals, percents or fractions, and fractions stay exact: 1/3 is one third, not 0.333. Each answer is given as a percent, a fraction where it is short enough to read, a decimal and, for the less likely ones, as 1 in N.
How to use it
In Two events, choose how A and B relate. Independent and Mutually exclusive are assumptions the tool states; if neither holds, choose one of the Know options and type the probability you know, such as P(A and B) or P(A | B). A value no pair of events could have, such as a P(A and B) above the smaller of P(A) and P(B), is refused with the range it must lie in.
In Bayes, A is a condition and B a positive result. The false positive rate is 100% minus the test's specificity. The tree uses the smallest population, a power of 10 from 100, that puts every branch at 10 people or more, up to 1,000,000,000; counts are whole people, so they may be rounded, while the percentages are exact.
In Repeated trials, n goes up to 10,000. Up to 1,000 trials with a simple p the answers are exact fractions; beyond that each term is worked out as a logarithm and summed from its own side, so even a chance far below 10⁻³⁰⁰ is given, never rounded to 0.
The rules
Every result comes from a few rules. The complement rule gives neither and none; the addition rule gives A or B; the multiplication rule gives A and B, which for independent events is the plain product. A conditional probability is the joint probability divided by the probability of what is given.
Bayes' theorem turns P(B | A), how often a test finds A, into P(A | B), how often a positive result means A. People often take one for the other and overlook the base rate. Gigerenzer and Hoffrage (1995) found that the same problem is solved correctly far more often when the numbers are given as natural frequencies, counts out of a population: 46% of answers followed Bayes' rule against 16% with the numbers given as probabilities. That is why the tool draws the tree.
P(not A) = 1 − P(A)
P(A or B) = P(A) + P(B) − P(A and B)
P(A and B) = P(A) × P(B), for independent events
P(A | B) = P(A and B) ÷ P(B)
P(A | B) = P(B | A) × P(A) ÷ [P(B | A) × P(A) + P(B | not A) × P(not A)]
P(at least one in n) = 1 − (1 − p)ⁿ
P(exactly k in n) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ
Examples
A six on a die and heads on a coin
With P(A) = 1/6, P(B) = 1/2 and Independent, the chance of both is 1/12 (about 8.333%), and of at least one 7/12 (about 58.33%).
What a positive test means
A condition affects 1% of people, a test finds 90% of them, and 9% of people without it test positive too. Then a positive result means the condition only 10/109 (about 9.174%) of the time.
Out of 10,000 people, 100 have A. Of those, 90 test positive (B). Of the 9,900 without A, 891 also test positive. So 981 test positive, and 90 of them have A.
At least one six in four rolls
With p = 1/6 and n = 4, the chance of at least one six is 671/1,296 (about 51.77%): just better than even, the bet the Chevalier de Méré is said to have won.
2 successes in 10 tries at 30%
With p = 0.3, n = 10 and k = 2, exactly 2 successes has a chance of 466,948,881/2,000,000,000 (about 23.35%), at least 2 8,506,916,541/10,000,000,000 (about 85.07%) and at most 2 478,478,483/1,250,000,000 (about 38.28%).
Frequently asked questions
See also
- Permutation and Combination Calculator — to count the outcomes behind a probability.
- Z-Score Calculator — for probabilities under the normal curve.
- Random Number Generator — to simulate trials and compare with the exact chances.