# Probability Calculator (P(A∪B))

- **URL:** https://codeasystem.com/calculators/statistics/probability-calculator/
- **Category:** statistics
- **Description:** Combine two event probabilities into P(A or B), handling mutually exclusive and independent events correctly.
- **Primary output:** P(A or B): 44%

## Inputs
- P(A) (name: `pa`, type: number, example: 30)
- P(B) (name: `pb`, type: number, example: 20)
- Relationship (name: `mode`, type: select)

## Outputs
- P(A or B): 44%
- P(A): 30%
- P(B): 20%
- P(A and B): 6%

## Formula / methodology
```
Exclusive: P(A∪B) = P(A) + P(B)   Independent: P(A∪B) = P(A) + P(B) − P(A)·P(B)
```

Mutually exclusive events (drawing a heart or drawing a club) can never co-occur, so probabilities add directly, clamped at 100% to catch over-specified inputs.

Independent events (two unrelated coin flips, two machines failing for separate reasons) overlap by chance, so we subtract the product P(A)·P(B) once to avoid double-counting the shared region.

## Assumptions & limitations
- Each probability entered as a percentage between 0 and 100.
- Only exclusive and independent relationships are offered; dependent events need P(A∩B).
- Clamping caps exclusive unions at 100% when inputs exceed feasibility.

## How to use
1. **Enter both probabilities**; As percentages between 0 and 100.
2. **Declare the relationship**; Exclusive if both happening is impossible; independent if neither influences the other.
3. **Read P(A or B)**; The union; the chance that at least one of the events occurs.

## Example
If a server has a 30% chance of a network fault and an independent 20% chance of a disk fault, the chance of at least one fault is 44%, not 50%; the double-counted 6% overlap is removed.

Result for these inputs:

```
P(A or B): 44%
```

## About this calculator
### The double-counting trap

Naively adding probabilities works only for exclusive events. Rain tomorrow (40%) and rain the day after (40%) do not make 80%; independence subtracts their 16% overlap for 64%. Most real-world addition mistakes come from ignoring overlaps like this.

### Exclusive versus independent

These are easy to confuse and almost opposite: mutually exclusive events are strongly dependent; one happening forces the other not to. Genuine independence is rare in everyday systems; reach for it only with a reason.

- Cards from one draw: exclusive.
- Two dice: independent.
- Anything causal between them: neither mode fits.

## FAQs
### What about events that are neither exclusive nor independent?

Then you need P(A∩B) directly: P(A∪B) = P(A) + P(B) − P(A∩B). Enter the joint probability yourself rather than forcing a mode.

### Why clamp at 100%?

Probabilities above 100% are impossible; exceeding it means the exclusive assumption contradicts your inputs somewhere upstream.

### Can I get P(A and B)?

In the independent mode yes; it appears as a detail row equal to P(A)·P(B). Exclusive joint probability is zero by definition.

### Do the inputs have to be percentages?

Enter them as percents (30, not 0.3); outputs are returned in the same percentage form.

## Related calculators
- [Combination & Permutation Calculator](https://codeasystem.com/calculators/statistics/combination-permutation-calculator/)
- [Mean, Median & Mode Calculator](https://codeasystem.com/calculators/statistics/mean-median-mode-calculator/)
- [Random Number Generator](https://codeasystem.com/calculators/math/random-number-generator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/statistics/probability-calculator/)
