HomeStatistics & Probability › Probability of Two Events Calculator

Probability of Two Events Calculator

Combines the probabilities of two events A and B that are either independent or mutually exclusive into the probabilities of both, at least one, exactly one, one but not the other, and neither occurring.

When to use

You know P(A) and P(B) and how the events relate (independent or mutually exclusive) and need P(A and B), P(A or B), P(neither) or P(exactly one).

Do not use when: The events are dependent with a known conditional probability (apply P(A and B) = P(A)·P(B|A) directly), you need the probability of k successes in repeated trials (use binomial-distribution), or you need an expected payoff (use expected-value).

Formula

Independent: P(A and B) = P(A)·P(B). Mutually exclusive: P(A and B) = 0. Then P(A or B) = P(A) + P(B) − P(A and B); P(A not B) = P(A) − P(A and B); P(exactly one) = P(A) + P(B) − 2·P(A and B); P(neither) = 1 − P(A or B)

The identities follow from the addition rule of probability; independence is an assumption about the events, not something the calculator can check. Mutually exclusive events require P(A) + P(B) ≤ 1.

Inputs

ParameterTypeUnitRequiredDescription
probability_anumberyesProbability of event A, as a number between 0 and 1 (0.25 for 25 %). Range: ≥ 0, ≤ 1
probability_bnumberyesProbability of event B, between 0 and 1. Range: ≥ 0, ≤ 1
relationshipenum: independent | mutually_exclusivedefault independentHow A and B relate: independent events multiply (P(A and B) = P(A)·P(B)); mutually exclusive events cannot occur together (P(A and B) = 0).

Outputs

OutputTypeUnitDescription
probability_a_and_bnumberBoth events occur.
probability_a_or_bnumberAt least one of the events occurs.
probability_a_not_bnumberA occurs but B does not.
probability_b_not_anumberB occurs but A does not.
probability_exactly_onenumberExactly one of the two events occurs.
probability_neithernumberNeither event occurs = 1 − P(A or B).

Example

Two independent coin flips (heads): {"probability_a":0.5,"probability_b":0.5,"relationship":"independent"}{"probability_a_and_b":0.25,"probability_a_or_b":0.75,"probability_a_not_b":0.25,"probability_b_not_a":0.25,"probability_exactly_one":0.5,"probability_neither":0.25}

Mutually exclusive 0.2 and 0.3: {"probability_a":0.2,"probability_b":0.3,"relationship":"mutually_exclusive"}{"probability_a_and_b":0,"probability_a_or_b":0.5,"probability_a_not_b":0.2,"probability_exactly_one":0.5,"probability_neither":0.5}

GET https://tttkmbb.com/api/v1/calculate/probability-of-events?probability_a=0.5&probability_b=0.5&relationship=independent

Machine access

Sources

FAQ

What is the difference between independent and mutually exclusive?

Independent events do not influence each other (rolling a die twice); mutually exclusive events cannot happen together (rolling a 1 and rolling a 6 on the same roll). Two events with non-zero probability cannot be both.

Can I enter percentages?

No, enter fractions between 0 and 1: 0.3 for 30 %. The outputs are fractions as well.

Related calculators