Conditional Probability
Formal
(Conditional Probability)
The conditional probability of event given that event has occurred is defined as
Geometrically: we restrict the sample space from to , and ask what fraction of is also .
(Independence)
Events and are independent if and only if
which implies . Conditioning on gives no information about .
(Chain Rule of Probability)
For any events :
(Law of Total Probability)
If is a partition of (disjoint, exhaustive), then for any event :
This is the mechanism for marginalisation — integrating out an unknown variable.
Intuition
Think of the sample space as a database table of all possible outcomes. Conditioning on is a WHERE clause — it filters the table down to the rows where is true, and then asks what fraction of those rows satisfy .
The law of total probability is partitioned aggregation: sum up contributions from each disjoint partition of the data.
Independence is the absence of correlation between two filters: knowing that row passes filter tells you nothing about whether it passes filter .
ML Applications
- Bayesian inference — the posterior is a conditional probability. All Bayesian ML is an application of eq. (1).
- Chain rule in generative models — autoregressive models (GPT, etc.) factorise using eq. (3): generate each token conditioned on all previous ones.
- Naive Bayes classifier — assumes features are conditionally independent given the class label (eq. (2)), turning a joint distribution into a product of simple univariate conditionals.
- Causal inference — do-calculus and interventional distributions are built on conditional probability and independence.
Connections
- Forward Links: Bayes Theorem, Random Variables
- Backward Links: The Probability Space