Probability Calculator

Compute the probability of a single event, its complement, or how two events combine. Enter your values below, and see the formula, a worked example, and ready-to-use Python code underneath.

Enter your values

Please enter probabilities between 0 and 100.

Result

Basic probability rules

Probability measures how likely an event is, on a scale from 0 (impossible) to 1, or equivalently 0% to 100% (certain). Most everyday probability questions boil down to a handful of rules for combining simpler probabilities: the complement rule, the multiplication rule for independent events, and the addition rule for combining two events with "or."

Probability formulas

P(not A) = 1 − P(A)
P(A and B) = P(A) · P(B)  (if A and B are independent)
P(A or B) = P(A) + P(B)  (if A and B are mutually exclusive)
P(A or B) = P(A) + P(B) − P(A and B)  (general case)
"Independent" means one event doesn't affect the other's probability. "Mutually exclusive" means the two events can't both happen at once.

Python code

p_a = 0.25
p_b = 12 / 52

p_not_a = 1 - p_a
p_and_independent = p_a * p_b
p_or_mutually_exclusive = p_a + p_b
p_or_independent = p_a + p_b - (p_a * p_b)

print(p_and_independent, p_or_independent)  # 0.0577 0.4231

Worked example

Drawing one card from a standard 52-card deck: A = "the card is a heart" (13 hearts), B = "the card is a face card" (12 face cards). These two events happen to be independent, since 3 of the 12 face cards are hearts, and 13/52 × 12/52 = 3/52 exactly.

  1. 1
    Individual probabilities.
    P(A) = 13/52 = 0.25,  P(B) = 12/52 = 0.2308
  2. 2
    P(A and B), independent.
    0.25 × 0.2308 = 0.0577 (= 3/52, the heart face cards)
  3. 3
    P(A or B), independent / not mutually exclusive.
    0.25 + 0.2308 − 0.0577 = 0.4231

There's a 42.31% chance a random card is a heart, a face card, or both.

Frequently asked questions

What does it mean for two events to be independent?

Two events are independent if knowing one occurred doesn't change the probability of the other. When events are independent, the probability of both happening is simply the product of their individual probabilities.

What does it mean for two events to be mutually exclusive?

Mutually exclusive events can't both happen at the same time — for example, rolling a 3 and rolling a 5 on a single die roll. For mutually exclusive events, P(A and B) is 0, so P(A or B) simplifies to just P(A) + P(B).

Why does the formula for P(A or B) subtract P(A and B)?

Simply adding P(A) and P(B) would double-count outcomes where both A and B happen. Subtracting P(A and B) removes that double-counting, which is why the general addition rule is P(A) + P(B) − P(A and B).

Can a probability be negative or greater than 1?

No. Probabilities always fall between 0 and 1 (or 0% and 100%), where 0 means the event is impossible and 1 means it's certain.

Advertisement