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.
How to Read a Conditional Probability
P(A | B) is the probability of A once you know B has happened. It equals P(A and B) ÷ P(B). With P(A) = 0.30, P(B) = 0.40 and P(A and B) = 0.12, P(A | B) = 0.30 and P(B | A) = 0.40.
Because P(A | B) equals P(A), knowing B tells you nothing about A, and the events are independent. The lift P(A and B) ÷ (P(A)P(B)) is 1 for independent events, above 1 when A and B occur together more than chance, and below 1 when they avoid each other.
Where Probability of A Given B Is Used
Conditional probability
Find P(A | B) from P(A and B) and P(B).
Reversing a condition
Compute P(B | A) with Bayes’ rule from P(A), P(B) and P(A | B).
Independence
Test whether P(A and B) equals P(A)P(B).
Two-way tables
See every region of the A and B diagram.
Common Probability of A Given B Mistakes to Avoid
- P(A | B) and P(B | A) are different. Mixing them up is the commonest error.
- Independence means P(A and B) = P(A)P(B).
- Mutually exclusive events with positive probabilities are not independent.
- All probabilities must lie between 0 and 1, and P(A and B) cannot exceed either one.
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 of both events by the probability of the condition: P(A | B) = P(A and B) ÷ P(B). For 0.12 ÷ 0.40 the answer is 0.30.
What is the difference between P(A|B) and P(B|A)?
P(A | B) is the chance of A given B, and P(B | A) is the chance of B given A. They are equal only when P(A) = P(B).
How do I test whether two events are independent?
Check whether P(A and B) = P(A) × P(B). If it does, the events are independent. In the example, 0.30 × 0.40 = 0.12, so they are.
What if I only know P(B | A)?
Then P(A and B) = P(A) × P(B | A), which gives the joint probability you need. The calculator accepts it as the third value.