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_b

P(A|B) as %

p_a_given_b_pct = (p_a_and_b / p_b) * 100

Variables

VariableDescriptionDefault
p_a_and_bP(A and B)0.12
p_bP(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
  1. 01P(A|B) = P(A and B) / P(B)
  2. 02P(A|B) = 0.12 / 0.4
  3. 03P(A|B) = 0.3
  4. 04As a percentage: 30%