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|B) = P(A and B) / P(B)
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.
Worked Example
P(A and B) = 0.12 and P(B) = 0.4. Find P(A|B).
p_a_and_b = 0.12p_b = 0.4
- 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%
Ready to run the numbers?
Open Conditional Probability Calculator