Skip to content
math

Conditional Probability Calculator

Calculate P(A | B) — the probability of event A given that event B has occurred.

P(A | B)
0.4
P(A | B) = P(A ∩ B) ÷ P(B) = 0.2 ÷ 0.5 = 0.4. Conditional probability measures how likely A is given that B has already occurred — it rescales the joint probability by the probability of the condition.

How it works

  1. 1Enter P(A ∩ B), the probability that both A and B occur together (a value between 0 and 1).
  2. 2Enter P(B), the probability that event B occurs. It must be greater than 0.
  3. 3The calculator applies the formula P(A | B) = P(A ∩ B) ÷ P(B) and displays the result to four decimal places.

Use cases

  • Medical testing: find the probability a patient has a disease given a positive test result.
  • Risk analysis: determine the likelihood of a failure given that a precursor event has been observed.
  • Machine learning: compute posterior class probabilities in Naïve Bayes classifiers.

Frequently asked questions

What is conditional probability?

Conditional probability P(A | B) is the probability that event A occurs given that event B has already occurred. It equals the joint probability P(A ∩ B) divided by P(B), and is only defined when P(B) > 0.

Why does P(B) need to be greater than zero?

Dividing by zero is undefined. If P(B) = 0, event B can never happen, so conditioning on it has no mathematical meaning.

How is conditional probability related to Bayes’ theorem?

Bayes’ theorem rearranges the conditional probability formula: P(A | B) = P(B | A) × P(A) ÷ P(B). It is used to update a prior belief about A after observing evidence B.

See all →