Probability Calculator
Two probabilities and one question about how the events relate, and this returns the intersection, the union, both complements, the exclusive-or, and both conditional probabilities. Every one of them shows its formula with your numbers written into it, so you can copy the working and not just the answer. Enter probabilities however the question gave them to you: 0.25, 25%, 1/4 or 1 in 4 all work. A third event, repeated trials and Bayes' theorem are a click away underneath. Below, the and-versus-or split, the three relationships, a worked example, and conditional probability and Bayes.
= 0.4
= 0.3
A or B, or both P(A ∪ B)
0.58
29/50 · 58%. The overlap P(A ∩ B) is 0.12, so it gets subtracted once to stop it being counted twice.
Both A and B
P(A) × P(B)
= 0.4 × 0.3
= 0.12 = 3/25 = 12%
A or B, or both
P(A) + P(B) − P(A ∩ B)
= 0.4 + 0.3 − 0.12
= 0.58 = 29/50 = 58%
Exactly one of them
P(A) + P(B) − 2 × P(A ∩ B)
= 0.4 + 0.3 − 2 × 0.12
= 0.46 = 23/50 = 46%
Neither one
1 − P(A ∪ B)
= 1 − 0.58
= 0.42 = 21/50 = 42%
A does not happen
1 − P(A)
= 1 − 0.4
= 0.6 = 3/5 = 60%
B does not happen
1 − P(B)
= 1 − 0.3
= 0.7 = 7/10 = 70%
A, given B happened
P(A ∩ B) ÷ P(B)
= 0.12 ÷ 0.3
= 0.4 = 2/5 = 40%
B, given A happened
P(A ∩ B) ÷ P(A)
= 0.12 ÷ 0.4
= 0.3 = 3/10 = 30%
Add a third event
0.4 · 40% · 2/5 · 2 of 5
Enter P(C) above. C is taken as independent of both A and B, which is all two probabilities can tell you.
Repeat event A several times
It happens every time
P(A)^n
= 0.4^10
= 0.000105 = 0.0105%
It never happens
(1 − P(A))^n
= (1 − 0.4)^10
= 0.006047 = 0.6047%
It happens at least once
1 − (1 − P(A))^n
= 1 − 0.6^10
= 0.993953 = 99.3953%
Bayes' theorem: flip a conditional probability
You know how often B follows A and want to know how often A was behind a B. The defaults are the medical testing example: a test that catches 99% of cases, a condition 1% of people have.
= 0.99
= 0.01
= 0.0198
A, given B happened
P(B | A) × P(A) ÷ P(B)
= 0.99 × 0.01 ÷ 0.0198
= 0.5 = 1/2 = 50%
And, or, and the overlap in between
Almost every probability question turns on which of these four regions it is asking about. Taking P(A) = 0.4 and P(B) = 0.3 as independent events:
| In words | Notation | Formula | Here |
|---|---|---|---|
| Both A and B | P(A ∩ B) | P(A) × P(B) | 0.12 |
| A or B, or both | P(A ∪ B) | P(A) + P(B) − P(A ∩ B) | 0.58 |
| Exactly one of them | P(A △ B) | P(A) + P(B) − 2 × P(A ∩ B) | 0.46 |
| Neither one | P((A ∪ B)′) | 1 − P(A ∪ B) | 0.42 |
The four add up to more than 1 only if you count wrong: the union already contains the intersection. The three regions that do partition everything are exactly-one, both, and neither, which come to 0.46 + 0.12 + 0.42 = 1.
Which of the three relationships is yours?
This is the choice that decides the answer, and it is where most marks are lost. Only the overlap changes, but every other value is built on it.
Independent
P(A ∩ B) = P(A) × P(B) = 0.12One happening changes nothing about the other.
Two coin flips. Rain today and a coin landing heads.
Mutually exclusive
P(A ∩ B) = 0 = 0They cannot both happen.
One die showing a 3 and the same die showing a 5.
Neither, so you need the overlap
P(A ∩ B) = the value you are given = 0.3They affect each other, and independence would give the wrong answer.
Drawing two cards without putting the first one back.
Independent and mutually exclusive are opposites, not synonyms, though they are constantly swapped. Mutually exclusive events are about as dependent as two events can get: learning that one happened tells you the other definitely did not.
A worked example, start to finish
Two dice are rolled. A is "the first die shows a six", B is "the second die shows a six". Each is 1/6, and the dice do not influence each other, so they are independent.
- Both sixes: P(A) × P(B) = 0.166667 × 0.166667 = 1/36
- At least one six: P(A) + P(B) − P(A ∩ B) = 11/36, which is 30.5556%. Note it is not 1/6 + 1/6, because the double six would be counted twice.
- Exactly one six: 5/18, the union minus the double.
- Neither die a six: 25/36, which is (5/6)² and the quickest route to the answer in step 2.
Enter 1/6 in both boxes to see the same four numbers with the working attached.
Conditional probability and Bayes' theorem
P(A | B) asks what A's chances are once B is known to have happened. Knowing B shrinks the world down to B alone, so the overlap gets measured against that instead of against everything: P(A | B) = P(A ∩ B) ÷ P(B). With P(A) = 0.5, P(B) = 0.4 and an overlap of 0.3, that gives P(A | B) = 0.75 while P(B | A) = 0.6. The two directions are different numbers, and mixing them up has a name: the prosecutor's fallacy.
Bayes' theorem converts one direction into the other: P(A | B) = P(B | A) × P(A) ÷ P(B). A screening test that catches 99% of a condition 1% of people have, producing positives 1.98% of the time overall, means a positive result is a true positive 50% of the time. The test is not bad. The condition is just rare enough that false positives from the healthy 99% match the true positives one for one.
If A and B turn out to be independent, P(A | B) comes back equal to P(A), which is the cleanest definition of independence there is: the condition made no difference.
The same event, repeated
Repeat an event with probability p a total of n times, independently, and three questions have short answers. It happens every time: p^n. It never happens: (1 − p)^n. It happens at least once: 1 − (1 − p)^n, which is the complement of never and much easier than adding up every other case.
Rolling a fair die 10 times, a six comes up at least once 83.8494% of the time and never at all 16.1506% of the time. For a count of successes rather than a yes-or-no, the binomial distribution calculator handles exactly k, at least k and the rest.
Frequently Asked Questions
What is the difference between P(A and B) and P(A or B)?
Why do you subtract P(A and B) from P(A) + P(B)?
When can I just multiply two probabilities?
What is conditional probability?
How do you calculate the probability of 3 events?
What is the probability of something happening at least once in n tries?
What is Bayes' theorem used for?
Can I enter probabilities as fractions or percentages?
Why does the calculator warn me about my numbers?
What is P(A | B) when P(B) is zero?
Related
For dice specifically, the dice probability calculator handles totals, ranges and matching dice, and draws the whole distribution for the dice you rolled. For a fixed number of independent trials at one success rate, the binomial distribution calculator gives P(X = k) and every tail.
Related Calculators
Dice Probability
Odds for any dice roll: an exact total, a range, how many dice match, …
Pythagorean Theorem
Solve a² + b² = c² for any missing side of a right triangle, with the …
Scientific Calculator
Full scientific calculator with trigonometry, logarithms, exponents, f…
Percent Off Calculator
Find the sale price and what you save for any percent off. Stack extra…