Home › Statistics & 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
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
probability_a | number | yes | Probability of event A, as a number between 0 and 1 (0.25 for 25 %). Range: ≥ 0, ≤ 1 | |
probability_b | number | yes | Probability of event B, between 0 and 1. Range: ≥ 0, ≤ 1 | |
relationship | enum: independent | mutually_exclusive | default independent | How 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
| Output | Type | Unit | Description |
|---|---|---|---|
probability_a_and_b | number | Both events occur. | |
probability_a_or_b | number | At least one of the events occurs. | |
probability_a_not_b | number | A occurs but B does not. | |
probability_b_not_a | number | B occurs but A does not. | |
probability_exactly_one | number | Exactly one of the two events occurs. | |
probability_neither | number | Neither 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
- API:
GET https://tttkmbb.com/api/v1/calculate/probability-of-events(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/probability-of-events · Markdown: https://tttkmbb.com/statistics/probability-of-events.md · JSON definition: https://tttkmbb.com/statistics/probability-of-events.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="probability-of-events" - OpenAPI operationId:
calculate_event_probabilities - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Independence (probability theory) (reference)
- Wikipedia – Mutual exclusivity (reference)
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
- Binomial Distribution Calculator — Probability of k successes in repeated independent trials.
- Expected Value Calculator — Average outcome of a probabilistic payoff.