Conditional Probability
Conditional probability is what you use when you want to talk about “the chance of something” after you’ve learned some extra information. It’s the math version of updating your expectations once you know a relevant fact.
What it means
The conditional probability of an event A given event B is written P(A|B) and read “probability of A given B.” Technically, it’s defined as:
P(A|B) = P(A ∩ B) / P(B), provided P(B) > 0
This says: among the situations where B happens, what fraction also have A? The key idea is that conditioning on B shrinks your “universe” down to only the cases consistent with B.
Quick intuition
Think of B as a filter. If you first look at all customers, the chance someone buys might be one number. If you filter to “customers who clicked the ad,” the chance of buying usually changes—because you’re now looking at a more specific group.
Practical examples
- Housing: P(price > $500k | 4 bedrooms) is typically higher than P(price > $500k).
- Medicine: P(disease | positive test) depends on both test accuracy and how common the disease is.
- Education: P(pass | attended review session) can reveal whether attendance is associated with better outcomes.
Why it matters in AI/ML
Many ML models are built around conditional probabilities: predicting a label given features, P(y|x). Naive Bayes uses conditional probabilities directly, and Bayes’ rule (derived from conditional probability) powers probabilistic reasoning, calibration, and decision-making under uncertainty. Without conditional probability, you lose the formal way to incorporate evidence and update predictions.
Conditional Probability is the probability of an event occurring given that another event has occurred, written P(A|B) = P(A∩B)/P(B) for P(B)>0. It formalizes how evidence updates uncertainty and underpins key AI/ML methods such as Bayesian inference, Naive Bayes classifiers, and probabilistic graphical models. Example: P(disease|positive test) combines test accuracy with disease prevalence to estimate a patient’s risk.
Imagine you’re guessing whether it will rain today. If you know nothing else, you use a general chance. But if you learn the sky is dark and cloudy, your guess changes. That “updated chance given new information” is conditional probability.
In statistics and AI, conditional probability means the probability of something happening assuming something else is already true. For example: the chance an email is spam given it contains words like “free” or “winner.” Many machine-learning systems use this idea to make better predictions by adjusting probabilities when they observe new clues.