# What is the probability of A and B?

Computes the probability of two events both happening, either happening, exactly one, or neither, and the conditional probabilities, from P(A) and P(B).

- Page: https://www.acalculator.org/statistics/probability-calculator
- JSON spec: https://www.acalculator.org/statistics/probability-calculator.json
- Version: 09675a8743bd

## Default answer

Example with the default inputs (P(A) 0.5, P(B) 0.4, A and B are Independent): With P(A) = 0.5 and P(B) = 0.4, P(A and B) is 0.2 and P(A or B) is 0.7.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| pa | P(A) | The probability of event A, from 0 to 1. |
| pb | P(B) | The probability of event B, from 0 to 1. |
| rel | A and B are | Independent (one does not change the chance of the other), mutually exclusive (they cannot both happen), or neither, with a known P(A and B). |
| pab | P(A and B) | The probability that A and B both happen, from 0 to 1. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| and | P(A and B) | The probability that both A and B happen, P(A ∩ B). |
| or | P(A or B) | The probability that A, B, or both happen, P(A ∪ B). |
| exactlyOne | P(exactly one) | The probability that A or B happens but not both. |
| neither | P(neither) | The probability that neither A nor B happens. |
| notA | P(not A) | The probability that A does not happen, 1 − P(A). |
| notB | P(not B) | The probability that B does not happen, 1 − P(B). |
| aGivenB | P(A given B) | The probability of A when B has happened, P(A and B) ÷ P(B). Shown when P(B) is above 0. |
| bGivenA | P(B given A) | The probability of B when A has happened, P(A and B) ÷ P(A). Shown when P(A) is above 0. |

## Method

P(A and B) = P(A) × P(B) for independent events, 0 for mutually exclusive events; P(A or B) = P(A) + P(B) − P(A and B); P(neither) = 1 − P(A or B); P(A given B) = P(A and B) ÷ P(B).

## Assumptions

- Probabilities are decimals from 0 to 1 (0.25 means a 25% chance).
- The arithmetic is exact on the decimals you type, then rounded once for display.

## Worked examples

1. pa = 0.5, pb = 0.4, rel = independent gives and = 0.2, or = 0.7, exactlyOne = 0.5, neither = 0.3, notA = 0.5, notB = 0.6, aGivenB = 0.5, bGivenA = 0.4. Source: OpenStax, Introductory Statistics 2e, §3.3 Two Basic Rules of Probability. https://openstax.org/books/introductory-statistics-2e/pages/3-3-two-basic-rules-of-probability.
2. pa = 0.3, pb = 0.45, rel = exclusive gives and = 0, or = 0.75, exactlyOne = 0.75, neither = 0.25, aGivenB = 0. Source: OpenStax, Introductory Statistics 2e, §3.2 Independent and Mutually Exclusive Events. https://openstax.org/books/introductory-statistics-2e/pages/3-2-independent-and-mutually-exclusive-events.
3. pa = 0.4, pb = 0.5, rel = joint, pab = 0.2 gives or = 0.7, aGivenB = 0.4, bGivenA = 0.5. Source: OpenStax, Introductory Statistics 2e, §3.3 Two Basic Rules of Probability. https://openstax.org/books/introductory-statistics-2e/pages/3-3-two-basic-rules-of-probability.
4. pa = 0.1, pb = 0.2, rel = independent gives and = 0.02, or = 0.28, neither = 0.72. Source: OpenStax, Introductory Statistics 2e, §3.3 Two Basic Rules of Probability. https://openstax.org/books/introductory-statistics-2e/pages/3-3-two-basic-rules-of-probability.

## FAQ

### How do I find the probability of A and B?

For independent events, multiply: P(A and B) = P(A) × P(B). A fair coin landing heads (0.5) and a die showing a six (1/6) together have probability 0.5 × 1/6 = 1/12, about 0.083. For events that are not independent you need P(A and B) itself, or a conditional probability.

### How do I find the probability of A or B?

Add the two probabilities and subtract the overlap, so it is not counted twice: P(A or B) = P(A) + P(B) − P(A and B). With P(A) = 0.5, P(B) = 0.4 and independent events, P(A or B) = 0.5 + 0.4 − 0.2 = 0.7.

### What is the difference between independent and mutually exclusive events?

Independent events do not affect each other: knowing that A happened leaves the chance of B unchanged. Mutually exclusive events cannot happen together, so P(A and B) = 0. Two events that each have a probability above 0 cannot be both independent and mutually exclusive, because if one happens the other becomes impossible.

### What is conditional probability?

P(A given B) is the chance of A once you know B happened: P(A and B) ÷ P(B). If 20% of people both drink coffee and tea and 50% drink tea, then P(coffee given tea) = 0.2 ÷ 0.5 = 0.4.

### What is the probability that an event does not happen?

Subtract its probability from 1: P(not A) = 1 − P(A). A 0.3 chance of rain is a 0.7 chance of no rain.

### How do I find the chance of something happening at least once in several tries?

For independent tries with the same chance p, the chance of at least one success in n tries is 1 − (1 − p)ⁿ. With p = 0.1 and 10 tries it is 1 − 0.9¹⁰ ≈ 0.651. The binomial distribution calculator gives this as P(X ≥ 1).

### Can I enter a percentage?

Enter probabilities as decimals from 0 to 1: 25% is 0.25. The results are decimals too, so you can type any result back in as an input.

## Sources

- OpenStax, Introductory Statistics 2e, §3.2 Independent and Mutually Exclusive Events. https://openstax.org/books/introductory-statistics-2e/pages/3-2-independent-and-mutually-exclusive-events
- OpenStax, Introductory Statistics 2e, §3.3 Two Basic Rules of Probability. https://openstax.org/books/introductory-statistics-2e/pages/3-3-two-basic-rules-of-probability
