Article — Probability Calculator
Probability Calculator
Probability is a number between 0 and 1 (or 0% and 100%) that measures the chance of an event. The fundamental formula is P(A) = favorable outcomes / total outcomes. For a fair die, P(rolling a 6) = 1/6 ≈ 16.67%. For two events: P(A or B) = P(A) + P(B) − P(A and B), and P(A and B) = P(A) × P(B|A).
The calculator above handles five modes: basic, union, intersection, conditional, and at-least-one. This page walks through each one with the math, intuition, and worked examples. All formulas come from the standard NIST and LibreTexts references; no Bayesian metaphysics required.
What is probability?
Probability quantifies uncertainty. An event with probability 0 cannot happen; an event with probability 1 must happen. Everything else falls in between. A fair coin has P(heads) = 0.5. A fair six-sided die has P(any specific face) = 1/6. A standard deck of cards has P(specific card) = 1/52.
The classical definition assumes all outcomes are equally likely. The frequentist definition treats probability as the long-run fraction across many independent trials. The Bayesian view treats probability as a degree of belief. For all the calculations in this page, the classical and frequentist views coincide, and the math is the same.
The basic probability formula
The basic probability formula is P(A) = number of favorable outcomes / total number of outcomes, valid when every outcome is equally likely. Drawing a heart from a 52-card deck: 13 favorable, 52 total, P = 13/52 = 25%. Rolling an even number on a d6: 3 favorable {2,4,6}, 6 total, P = 50%.
The complement rule comes from the same axioms: P(A') = 1 − P(A). It is often the fastest route. For "probability that two coin flips give at least one head," compute the complement: P(no heads) = (1/2) × (1/2) = 1/4, so P(at least one head) = 3/4 = 75%.
The first formal axioms of probability theory were laid out by the Russian mathematician Andrey Kolmogorov in 1933. Every modern probability calculator, including this one, ultimately reduces to three rules: probabilities are non-negative, the total probability is 1, and the probability of a disjoint union is the sum of probabilities.
Probability of A or B (union)
P(A ∪ B) = P(A) + P(B) − P(A ∩ B). The subtraction prevents double-counting the cases where both events happen. For mutually exclusive events (A ∩ B = ∅), the formula simplifies to P(A) + P(B).
Example: a card drawn from a deck is a heart with P = 0.25 and a face card with P = 12/52 ≈ 0.231. The card can be both (J, Q, K of hearts, P = 3/52 ≈ 0.058). So P(heart or face card) = 0.25 + 0.231 − 0.058 = 0.423, or 42.3%.
Probability of A and B (intersection)
P(A ∩ B) = P(A) × P(B|A). For independent events, P(B|A) = P(B), so the formula reduces to P(A) × P(B). Two coin flips both heads: 0.5 × 0.5 = 0.25. Two dice both showing 6: (1/6) × (1/6) = 1/36 ≈ 2.78%.
For dependent events the conditional matters. Drawing two hearts from a 52-card deck without replacement: P(first heart) = 13/52 = 0.25; P(second heart given first is heart) = 12/51 ≈ 0.235. Joint probability = 0.25 × 0.235 = 0.0588, or 5.88%.
Conditional probability explained
P(A|B) = P(A ∩ B) / P(B) is the probability of A given that B is already known. Conditioning shrinks the sample space to outcomes consistent with B. If you draw a card and someone tells you it is red, the probability that it is a heart updates from 25% to 50% (13 hearts out of 26 red cards).
Bayes theorem rearranges the conditional: P(A|B) = P(B|A) × P(A) / P(B). It is the standard tool for medical-test interpretation. If a test is 99% accurate and the disease has prevalence 1%, the conditional that you actually have the disease given a positive test is about 50%, not 99% — a counterintuitive result that has tripped up many practicing doctors.
Use natural frequencies instead of percentages when explaining conditional probabilities to non-statisticians. "Out of 10,000 people, 100 have the disease, the test correctly flags 99 of them, and falsely flags 99 of the 9,900 healthy. So 99 of 198 positive tests are true. That is 50%." Far clearer than the Bayes algebra.
At-least-one probability across n trials
"At least once in n trials" is the most common compound probability question. The cleanest approach is the complement: P(at least one) = 1 − (1 − p)^n, where p is the per-trial probability and n is the number of trials.
Example: rolling at least one 6 in 4 throws of a fair die. P(no 6 per throw) = 5/6; P(no 6 in any of 4 throws) = (5/6)^4 ≈ 0.482; P(at least one 6) = 1 − 0.482 = 0.518, or 51.8%. This is the classic gambling problem analyzed by the Chevalier de Méré in 1654 and solved by Pascal and Fermat.
p=0.05, n=10 40.13%p=0.05, n=20 64.15%p=0.10, n=10 65.13%p=0.10, n=20 87.84%p=1/6, n=4 51.77%p=1/20, n=20 64.15%Common probability mistakes
The gambler's fallacy is the most common error: thinking that a tails "must come" after a long run of heads. Independent coin flips have no memory. After ten heads, the next flip is still 50%.
The base-rate fallacy is the second most common: ignoring the prior probability when interpreting a conditional. A positive medical test from a 99% accurate test does NOT imply 99% chance of disease unless you also know the prevalence. The Bayes calculation is essential.
Many probability mistakes happen because people assume independence when it is not justified. Drawing cards without replacement, picking days in a calendar, or sampling people in a small social network all introduce dependence. Always ask "does the first outcome change the probability of the second?" before multiplying.
A probability cheat sheet
- Basic probability = favorable / total
- Complement P(A') = 1 − P(A)
- Union P(A∪B) = P(A) + P(B) − P(A∩B)
- Intersection (independent) = P(A) × P(B)
- Conditional P(A|B) = P(A∩B) / P(B)
- At least one = 1 − (1 − p)^n
- Bayes P(A|B) = P(B|A) × P(A) / P(B)
- Probability range 0 ≤ P ≤ 1