Conditional Probability Calculator Formula
Understand the math behind the conditional probability calculator. Each variable explained with a worked example.
Formulas Used
P(A|B)
p_a_given_b = p_a_and_b / p_bP(A|B) as %
p_a_given_b_pct = (p_a_and_b / p_b) * 100Variables
| Variable | Description | Default |
|---|---|---|
p_a_and_b | P(A and B) | 0.12 |
p_b | P(B) | 0.4 |
How It Works
How to Calculate Conditional Probability
Formula
P(A Conditional probability measures how the probability of event A changes when we know event B has occurred. The vertical bar " " is read as "given". P(B) must be greater than zero.B) = P(A and B) / P(B)
Worked Example
P(A and B) = 0.12 and P(B) = 0.4. Find P(A|B).
- 01P(A|B) = P(A and B) / P(B)
- 02P(A|B) = 0.12 / 0.4
- 03P(A|B) = 0.3
- 04As a percentage: 30%
Frequently Asked Questions
What does conditional probability mean intuitively?
It restricts the sample space to only those outcomes where B occurred, then asks what fraction of those also have A. It updates our belief about A after learning B happened.
Is P(A|B) the same as P(B|A)?
No. P(A|B) and P(B|A) are generally different. They are related through Bayes' theorem: P(A|B) = P(B|A) * P(A) / P(B).
When are events independent in terms of conditional probability?
Events A and B are independent if P(A|B) = P(A), meaning knowing B occurred does not change the probability of A.
Ready to run the numbers?
Open Conditional Probability Calculator