What Is Probability of A Given B?
Conditional probability is the probability of an event A given that another event B has occurred: P(A | B) = P(A and B) ÷ P(B). It is the foundation of Bayes theorem and of how new information updates a probability.
Enter P(A), P(B) and either the joint probability P(A and B) or one of the conditionals. The calculator returns both conditional probabilities, P(A and B), P(A or B), P(neither), the lift and whether the events are independent, along with a two-way probability table.
The sections below explain the formulas, variables, a worked example and common questions about the difference between P(A | B) and P(B | A).
How to Use the Probability of A Given B Calculator
- Enter P(A) and P(B).
- Choose which third value you know: the joint probability or either conditional.
- Enter it.
- Read both conditionals, the union and the independence test.
Probability of A Given B Formula
Conditional probability
Multiplication rule
Bayes theorem
Union
Probability of A Given B Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| P(A), P(B) | Probability of each event | |
| P(A and B) | Joint probability | both occur |
| P(A | B) | Probability of A given B | |
| P(A or B) | Union probability | P(A) + P(B) − P(A and B) |
Probability of A Given B Worked Example
Suppose P(A) = 0.30, P(B) = 0.40 and P(A and B) = 0.12. Then P(A | B) = 0.12 ÷ 0.40 = 0.30 and P(B | A) = 0.12 ÷ 0.30 = 0.40. Because P(A)P(B) = 0.12 equals P(A and B), the events are independent.
With the example values loaded in the calculator above, the steps are:
- P(A and B) = 0.12 (given).
- P(A | B) = P(A and B) ÷ P(B) = 0.12 ÷ 0.4 = 0.3.
- P(B | A) = P(A and B) ÷ P(A) = 0.12 ÷ 0.3 = 0.4.
- P(A or B) = P(A) + P(B) − P(A and B) = 0.58.
- Bayes: P(A | B) = P(B | A) P(A) ÷ P(B) = 0.4 × 0.3 ÷ 0.4 = 0.3.
Result: P(A | B) = 0.3; P(B | A) = 0.4.
Where Probability of A Given B Is Used
Bayes problems
Converting between P(A | B) and P(B | A).
Medical testing
Relating test accuracy to the chance of a condition given a result.
Independence checks
Testing whether two events are independent.
Probability coursework
Checking joint, union and conditional answers.
Common Probability of A Given B Mistakes to Avoid
- P(A and B) can never exceed P(A) or P(B).
- Independence means P(A | B) = P(A).
- Mutually exclusive events with positive probability are never independent.
Probability of A Given B Terms and Definitions
- Joint probability
- The probability that both events occur.
- Independent events
- Events where knowing one occurred does not change the probability of the other.
Probability of A Given B FAQs
How do you calculate conditional probability?
Divide the probability that both occur by the probability of the condition: P(A | B) = P(A and B) ÷ P(B).
What is the difference between P(A|B) and P(B|A)?
They condition on different events and usually differ. Bayes theorem converts one into the other.
How do I test whether two events are independent?
Check whether P(A and B) equals P(A) × P(B), or equivalently P(A | B) = P(A).
What if I only know P(B | A)?
Multiply by P(A) to get P(A and B), then divide by P(B) to get P(A | B).