Probability of Multiple Events Calculator

Find the probability of two or more events. For two events A and B, enter P(A) and P(B) and say whether they are independent, mutually exclusive or overlap by a known probability: you get P(A and B), P(A or B), P(A only), P(B only), P(exactly one), P(neither), the conditional probabilities and an exact independence check. For a list of independent events you get the chance that all, none, at least one or exactly k of them happen, and for events that affect each other you multiply their conditional probabilities.

For the chance of at least one success in n identical tries, use the at least one probability calculator. To work out P(A | B) from counts, use the conditional probability calculator; to update a probability with new evidence, use Bayes' theorem; for counting outcomes, see the probability calculator.

The chance that A happens

The chance that B happens

How the probability of several events is found

The probability that several events happen depends on how the events relate to each other, so the calculator has three modes:

  • Two events: A and B. Enter P(A) and P(B), then choose whether the events are independent (one does not affect the other), mutually exclusive (they cannot both happen) or overlap by a probability P(A and B) that you know. Every other probability of the pair follows from these three numbers.
  • Several independent events. Enter one probability per event, for as many as 50 events. You get the chance that all of them happen, that none does, that at least one does and that exactly k do, for every k.
  • Dependent events, one after another. Enter P(A₁), then P(A₂ | A₁), then P(A₃ | A₁ and A₂) and so on. Their product is the chance that all the events happen, as when cards are dealt without putting them back.

A probability can be typed as a decimal (0.25), a percentage (25%) or a fraction (1/4). The calculator keeps it as an exact fraction, so every sum, product and difference is exact and nothing is rounded until the answer is written.

Formulas

Complement: P(not A) = 1 − P(A)

Both, independent events: P(A and B) = P(A) · P(B)

Both, any events: P(A and B) = P(A) · P(B | A)

Either, any events: P(A or B) = P(A) + P(B) − P(A and B)

Either, mutually exclusive events: P(A or B) = P(A) + P(B)

Exactly one of the two: P(A) + P(B) − 2 · P(A and B)

Neither: P(not A and not B) = 1 − P(A or B)

n independent events, all happen: p₁ · p₂ · … · pₙ

n independent events, none happens: (1 − p₁) · (1 − p₂) · … · (1 − pₙ)

n independent events, at least one happens: 1 − (1 − p₁) · (1 − p₂) · … · (1 − pₙ)

A chain of events: P(A₁ and A₂ and … and Aₙ) = P(A₁) · P(A₂ | A₁) · P(A₃ | A₁ and A₂) · …

The “or” of probability is inclusive: P(A or B) is the probability that A happens, B happens or both do. Adding P(A) and P(B) counts the outcomes where both happen twice, so P(A and B) is subtracted once. For mutually exclusive events that overlap is 0 and nothing is subtracted. For “at least one” it is easier to find the opposite, that none happens, and subtract it from 1.

How to read the results

OutputWhat it tells you
P(A and B)The probability that both events happen. For independent events it is P(A) × P(B); for mutually exclusive events it is 0.
P(A or B)The probability that at least one of the events happens, counting the case where both do.
P(A only) and P(B only)A happens without B, and B happens without A.
P(exactly one) and P(neither)Exactly one of the two events happens, P(A only) + P(B only), and neither happens, 1 − P(A or B).
P(not A) and P(not B)The complements, 1 − P(A) and 1 − P(B).
P(A | B) and P(B | A)The conditional probabilities P(A and B) / P(B) and P(A and B) / P(A). A conditional probability is undefined when its condition has probability 0.
Independent events? and Mutually exclusive?Yes when P(A and B) = P(A) × P(B), decided exactly, and when P(A and B) = 0.
Joint probabilities tableP(A and B), P(A only), P(B only) and P(neither) with their row and column totals. The four inner cells add up to 1.
P(all events happen), P(at least one happens), P(none happens), P(exactly one happens)The main answers for a list of independent events. P(at least one) = 1 − P(none).
Expected number of eventsThe sum of the probabilities: the average number of events that happen.
How many of the events happenP(exactly k) and P(k or more) for every k from 0 to the number of events. The P(exactly k) column adds up to 1.
P(not all happen) and Building up the productFor a chain of dependent events: 1 − P(all happen), and the probability that the first k events all happen for every k.

Worked example 1: two independent events

Suppose P(A) = 0.4 and P(B) = 0.5, and the events do not affect each other. Load example fills in these values.

  1. P(A and B) = 0.4 × 0.5 = 0.2.
  2. P(A or B) = 0.4 + 0.5 − 0.2 = 0.7. Adding the two probabilities alone would give 0.9, which counts the overlap twice.
  3. P(A only) = 0.4 − 0.2 = 0.2 and P(B only) = 0.5 − 0.2 = 0.3, so P(exactly one) = 0.5.
  4. P(neither) = 1 − 0.7 = 0.3, which is also 0.6 × 0.5, the product of the two complements.
  5. Independence: P(A | B) = 0.2 / 0.5 = 0.4, the same as P(A), so knowing that B happened does not change the probability of A.

Worked example 2: overlapping events from one card

Draw one card from a standard deck of 52. Let A be “the card is a king”, so P(A) = 4 / 52 = 1/13, and B “the card is a heart”, so P(B) = 13 / 52 = 1/4. The king of hearts is in both events, so P(A and B) = 1/52. Choose I know P(A and B) and enter 1/13, 1/4 and 1/52.

  1. P(A or B) = 1/13 + 1/4 − 1/52 = 16/52 = 4/13 ≈ 0.307692: there are 16 cards that are a king, a heart or both (4 kings and 13 hearts, less the king of hearts counted twice).
  2. P(A only) = 3/52 ≈ 0.057692 (the three kings that are not hearts) and P(B only) = 12/52 = 3/13 ≈ 0.230769 (the twelve hearts that are not kings).
  3. P(neither) = 1 − 4/13 = 9/13 ≈ 0.692308.
  4. Independence: P(A) × P(B) = 1/13 × 1/4 = 1/52 = P(A and B), so Independent events? answers Yes. The suit of a card tells you nothing about its rank.

Worked example 3: mutually exclusive events

Draw one card and let A be “a king” and B “a queen”. A card cannot be both, so the events are mutually exclusive: choose Mutually exclusive and enter 1/13 for both.

  1. P(A and B) = 0.
  2. P(A or B) = 1/13 + 1/13 = 2/13 ≈ 0.153846, the 8 kings and queens out of 52 cards.
  3. Independence: P(A) × P(B) = 1/169 ≈ 0.005917, which is not P(A and B) = 0, so the events are not independent. After a king is drawn a queen is impossible, and the conditional probability P(B | A) is 0, not 1/13.

Worked example 4: several independent events

Three machines break down independently on a given day with probabilities 0.1, 0.2 and 0.05. Choose Several independent events and enter 0.1, 0.2, 0.05 (or use Load example).

  1. P(all events happen) = 0.1 × 0.2 × 0.05 = 0.001: all three break down together once in a thousand days.
  2. P(none happens) = 0.9 × 0.8 × 0.95 = 0.684.
  3. P(at least one happens) = 1 − 0.684 = 0.316: on 31.6% of days at least one machine is down.
  4. P(exactly one happens) = 0.1 × 0.8 × 0.95 + 0.9 × 0.2 × 0.95 + 0.9 × 0.8 × 0.05 = 0.076 + 0.171 + 0.036 = 0.283. The table adds P(exactly 2) = 0.032, and the four probabilities 0.684, 0.283, 0.032 and 0.001 add up to 1.
  5. Expected number of events = 0.1 + 0.2 + 0.05 = 0.35 machines down on an average day.

Worked example 5: dependent events without replacement

Two cards are dealt from a deck of 52 without putting the first back. What is the chance that both are aces? The first card is an ace with probability 4/52. Given that, 3 aces are left among 51 cards, so the second is an ace with probability 3/51. Choose Dependent events, one after another and enter 4/52, 3/51.

  1. P(all events happen) = 4/52 × 3/51 = 1/221 ≈ 0.004525, about 0.45%.
  2. Continuing with 2/50 and 1/49 gives the chance of being dealt all four aces from the first four cards: 1/270725 ≈ 3.6938e-6.
  3. If the first card were put back each time, the draws would be independent and the chance of two aces would be 1/13 × 1/13 = 1/169 ≈ 0.005917. Treating dependent draws as independent overstates the chance here.

Independent, mutually exclusive or dependent?

  • Independent events do not affect each other: knowing that one happened leaves the probability of the other unchanged. Coin flips, dice rolls, machines in different places and draws with replacement are independent. Then P(A and B) = P(A) · P(B).
  • Mutually exclusive events cannot happen together, such as a king and a queen on one draw. Then P(A and B) = 0 and P(A or B) = P(A) + P(B). Two mutually exclusive events that can each happen are always dependent, because once one has happened the other is impossible.
  • Dependent events change each other's probability, as when cards are dealt without replacement. Use P(B | A) for the second event. The conditional probability calculator finds it from counts or from P(A and B).

If you know only P(A) and P(B), the probability P(A and B) is not fixed by them: it can be anything from max(0, P(A) + P(B) − 1) to min(P(A), P(B)). For P(A) = 0.7 and P(B) = 0.6 that is from 0.3 to 0.6, which is why the calculator refuses a P(A and B) of 0.2 for these two events: it would make P(A or B) larger than 1.

For the two ideas side by side, with the tests and worked examples, see independent vs mutually exclusive events.

Common mistakes

  • Adding for “and”. The chance that two independent events both happen is the product of their probabilities, not the sum: 0.4 × 0.5 = 0.2, not 0.9.
  • Adding for “or” without removing the overlap. P(A) + P(B) is right only for mutually exclusive events. Otherwise subtract P(A and B), as in 0.4 + 0.5 − 0.2 = 0.7.
  • Adding for “at least one”. Three independent events with probability 0.1 each do not give 0.3. The chance that at least one happens is 1 − 0.9 × 0.9 × 0.9 = 0.271. Use the list mode or the at least one probability calculator for identical tries.
  • Treating dependent events as independent. Drawing two aces without replacement has probability 1/221, not 1/169. Use the third mode and enter the conditional probability of each step.
  • Confusing mutually exclusive with independent. They are nearly opposites: exclusive events with positive probabilities are dependent.
  • Rounding an input. A third is 1/3, not 0.33. Type the fraction and the result stays exact.

Probability of multiple events in other software

ToolCommand
Excel / Google SheetsAll independent events: =PRODUCT(B2:B4). At least one: =1-(1-B2)*(1-B3)*(1-B4). Either of two independent events: =B2+B3-B2*B3
Pythonmath.prod(p) for all of them and 1 - math.prod(1 - x for x in p) for at least one. The whole distribution with numpy: start with dist = np.array([1.0]) and, for each x in p, dist = np.convolve(dist, [1 - x, x]); dist[k] is P(exactly k)
Rprod(p) for all of them and 1 - prod(1 - p) for at least one, with p a vector of probabilities

These tools use binary floating-point numbers. For p = [0.1, 0.2, 0.05] Python prints the product as 0.0010000000000000002 and the chance of at least one as 0.31599999999999995. This calculator works with exact fractions, so it gives exactly 0.001 and 0.316. To count outcomes rather than multiply probabilities, use the combination calculator or the permutation calculator; for the chance of k successes in n identical independent tries, see the binomial distribution calculator, and for draws without replacement from a group of two kinds, the hypergeometric distribution calculator.

Frequently Asked Questions

How do you find the probability of multiple events?

It depends on how the events relate. For independent events that must all happen, multiply their probabilities. For events that cannot happen together and of which any one will do, add them. For events that overlap, add and subtract the overlap: P(A or B) = P(A) + P(B) − P(A and B). For events that affect each other, multiply conditional probabilities: P(A and B) = P(A) · P(B | A).

How do you calculate the probability of two independent events both happening?

Multiply the two probabilities: P(A and B) = P(A) · P(B). With P(A) = 0.4 and P(B) = 0.5 the probability that both happen is 0.4 × 0.5 = 0.2. This works only when the events are independent, that is, when knowing that one happened does not change the probability of the other.

What is the formula for P(A or B)?

P(A or B) = P(A) + P(B) − P(A and B). It is the probability that A happens, B happens or both happen. The overlap P(A and B) is subtracted because adding P(A) and P(B) counts it twice. For mutually exclusive events P(A and B) = 0, so P(A or B) = P(A) + P(B).

How do you find the probability that at least one of several events happens?

For independent events, subtract the probability that none happens from 1: P(at least one) = 1 − (1 − p₁) · (1 − p₂) · … · (1 − pₙ). For probabilities of 0.1, 0.2 and 0.05 the chance that none happens is 0.9 × 0.8 × 0.95 = 0.684, so the chance that at least one happens is 0.316. Adding the probabilities (0.35) would overstate it because it counts overlaps more than once.

What is the difference between independent and mutually exclusive events?

Independent events do not affect each other, so P(A and B) = P(A) · P(B). Mutually exclusive events cannot happen together, so P(A and B) = 0. Two events that can each happen and are mutually exclusive are always dependent, because once one has happened the other is impossible. Two events can be both independent and mutually exclusive only when at least one of them has probability 0.

How do I calculate the probability of dependent events?

Multiply the conditional probabilities of the steps: P(A₁ and A₂ and … and Aₙ) = P(A₁) · P(A₂ | A₁) · P(A₃ | A₁ and A₂) · …. For two aces dealt from a deck without replacement it is 4/52 × 3/51 = 1/221 ≈ 0.004525. Enter the step probabilities in the third mode; fractions such as 4/52 are accepted and kept exact.

How do I find the probability that exactly k of several events happen?

For independent events with different probabilities, the number of events that happen follows the Poisson binomial distribution. The calculator multiplies out (1 − p₁ + p₁x) · (1 − p₂ + p₂x) · … and reads P(exactly k) from the coefficient of xᵏ; the table lists every k from 0 to the number of events, with P(k or more) beside it. When every event has the same probability, this is the binomial distribution.

Can I enter percentages or fractions instead of decimals?

Yes. Each probability can be a decimal such as 0.25, a percentage such as 25% or a fraction such as 1/4, from 0 to 1 (0% to 100%). Fractions are the most accurate way to enter a probability that is not a short decimal: 1/3 stays exactly one third, while 0.33 does not.

What if I know P(A) and P(B) but not whether the events are independent?

Then P(A and B) is not determined. It can be anything from max(0, P(A) + P(B) − 1) to min(P(A), P(B)). With P(A) = 0.7 and P(B) = 0.6 it lies between 0.3 and 0.6. Enter the value in the mode where you know P(A and B); the calculator refuses combinations that would make P(A or B) larger than 1.

Why is the result exact, and why does the working show fractions?

Probabilities are held as exact fractions, so 0.1 × 0.2 × 0.05 is exactly 0.001 rather than the floating-point 0.0010000000000000002 that many tools print. When a result is not a decimal that fits six places, such as 1/221, the working shows the exact fraction followed by the rounded decimal.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.