Conditional Probability Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter the joint probability of A and B and the probability of each event, as numbers between 0 and 1.
Result
P(A | B), A given B
P(B | A), B given A
- Independent events?
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- P(A and B), both happen (0 to 1): enter a number from 0 to 1.
- P(A) (0 to 1): enter a number from 0 to 1.
- P(B) (0 to 1): enter a number from 0 to 1.
- Read the result: P(A | B), A given B; the panel also shows P(B | A), B given A and Independent events?.
How this calculator works
P(A | B) = P(A and B) ÷ P(B) and P(B | A) = P(A and B) ÷ P(A). The conditional probability is the share of B's outcomes in which A also happens.
A and B are independent exactly when P(A and B) = P(A) × P(B), which is the same as P(A | B) = P(A).
The formula
| Symbol | Meaning |
|---|---|
| P(A and B), both happen (0 to 1) | |
| P(B) (0 to 1) | |
| P(A | B), A given B |
Worked example
| P(A and B), both happen (0 to 1) | 0.12 |
|---|---|
| P(A) (0 to 1) | 0.3 |
| P(B) (0 to 1) | 0.4 |
| P(B | A), B given A | 0.4 |
|---|---|
| Independent events? | Yes: P(A and B) = P(A) × P(B) |
P(A | B), A given B 0.3
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
If 12% of students play both sports and 40% play soccer, what share of soccer players also play basketball?
P(basketball | soccer) = 0.12 ÷ 0.4 = 0.3.
Can P(A | B) be larger than P(A)?
Yes, when B makes A more likely; it is smaller when B makes A less likely, and equal when they are independent.