Formula & Calculator

Conditional Probability

Calculates the probability of event A occurring given that event B has already occurred.

StatisticsProbabilityFundamental

Conditional Probability CalculatorBayes · Statistics

P(A|B) = P(A∩B) / P(B)
P(A|B) = probability of A given B  ·  P(A∩B) = joint probability  ·  P(B) = probability of B
⟹ SolveP(A|B), P(A∩B), P(B)
dimensionless
dimensionless
dimensionless
Please fix the errors above.
Solve for:
Presets:
P(A|B)
P(A|B): P(A∩B): P(B):
✓ Copied!
P(A|B) Gauge
Low (< 0.3) Medium (0.3–0.7) High (> 0.7)
P(A|B) = P(A∩B) / P(B)  ·  All probabilities must be between 0 and 1, and P(B) > 0

Interpretation

P(A|B) = P(A∩B)/P(B). Probability of event A given that B has occurred. Used in Bayesian inference, medical diagnosis, and machine learning.

P(A|B) = P(A∩B) / P(B)
Conditional Probability

Variables

SymbolQuantityUnit
P(A|B)Probability of A given B
P(A∩B)Probability of both A and B occurring
P(B)Probability of B occurring

What it means

Conditional probability quantifies the likelihood of an event A occurring given that another event B has already occurred. It is the ratio of the joint probability of both events to the probability of B. It is central to Bayesian statistics and to many areas of probability and statistics. It is used in diagnostic testing (probability of disease given a positive test), in machine learning (Naïve Bayes), and in decision analysis. Understanding conditional probability is essential for updating beliefs based on evidence and for interpreting dependence between events. It also forms the basis for independence (P(A|B) = P(A)).

Worked example

Conditional Probability – Two Examples

Real‑World
Scenario: In a class, P(A∩B)=0.12 and P(B)=0.3. Find P(A|B).
ParameterValue
P(A∩B)0.12
P(B)0.3
1P(A|B) = 0.12 / 0.3 = 0.4
Result 0.4 ✓ 40% chance
Scenario: In a survey, P(A∩B)=0.3 and P(B)=0.6. Compute P(A|B).
ParameterValue
P(A∩B)0.3
P(B)0.6
1P(A|B) = 0.3/0.6 = 0.5
Result 0.5 ✓ 50%
Insight: Conditional probability updates the probability of A given that B has occurred. It is the foundation of Bayes' theorem.

Common mistakes

  • Conditional probability: The probability of A given B has occurred.
  • Denominator P(B): Must be > 0 – otherwise undefined.
  • Joint probability: P(A∩B) is the probability of both A and B occurring.
  • Independence: If A and B are independent, P(A|B)=P(A).
  • Bayes’ theorem: This is the basis for Bayes’ theorem.

Applications

Conditional probability, P(A|B) = P(A∩B)/P(B), gives the probability of event A occurring given that event B has already occurred. This is the foundation of Bayesian inference and is used in many fields. Engineers use it in reliability (probability of system failure given component failure), in signal processing (detection given noise), and in medical diagnostics (disease given a positive test). By understanding conditional probability, professionals can update beliefs in light of new evidence, design better diagnostic tests, and improve decision‑making. This concept is also key to understanding independence and causal relationships. Mastering conditional probability is essential for any work involving uncertainty and data.

  • Diagnostic testing – positive predictive value, sensitivity, specificity
  • Reliability analysis – system failure given component failure
  • Signal detection – probability of signal given observation
  • Risk assessment – probability of event given a condition
  • Machine learning – naive Bayes and probabilistic inference

Frequently Asked Questions

Q01What is conditional probability and what is its formula?
A01

P(A|B) = P(A∩B) / P(B), provided P(B) > 0. It is the probability of event A given that event B has occurred.

Q02What is the difference between P(A|B) and P(B|A)?
A02

They are different in general. P(A|B) is the probability of A given B; P(B|A) is the probability of B given A. Bayes' theorem relates them.

Q03What is the chain rule of probability?
A03

For multiple events, P(A∩B∩C) = P(A) · P(B|A) · P(C|A∩B). This is a fundamental rule for joint probabilities.

Q04What is independence in probability and how does it relate to conditional probability?
A04

Two events A and B are independent if P(A|B) = P(A) (or equivalently P(A∩B) = P(A)P(B)). Independence means knowing B does not change the probability of A.

Q05How is conditional probability used in medical testing?
A05

It is used to compute sensitivity (P(positive | disease)) and specificity (P(negative | no disease)). These are then used in Bayes' theorem to find predictive values.

Q06What is the law of total probability?
A06

If events B₁, B₂, … form a partition, then P(A) = Σ P(A|Bᵢ) · P(Bᵢ). This is often used to compute marginal probabilities.

Q07What is the difference between conditional probability and joint probability?
A07

Joint P(A∩B) is the probability both occur. Conditional P(A|B) is the probability of A given B already occurred. They are related: P(A∩B) = P(A|B)P(B).

Q08How do you calculate conditional probability from a contingency table?
A08

From a table, P(A|B) = (cell count for A and B) / (row or column total for B), depending on which is conditioned.

Q09What is the Monty Hall problem and how does conditional probability explain it?
A09

In the Monty Hall problem, the host's action provides information that changes the conditional probabilities. Switching doors gives a 2/3 chance of winning, as shown by conditional probability updates.

Q10What is the role of conditional probability in Bayesian networks?
A10

Bayesian networks use conditional probability distributions to represent dependencies among variables. They allow efficient inference using the chain rule and conditional independence.