Probability and conditioning
Update uncertainty with evidence while keeping event direction, base rates, and independence straight.
On this page
The question for today
What you’ll understand
- Define probabilities on an explicit sample space.
- Compute conditional probabilities and Bayes updates.
- Distinguish independence from mutually exclusive events.
An alert and a fault are different events, connected through assumptions about the detector. Conditioning describes how evidence restricts possibilities. This language supports inference, reliability, and machine-learning evaluation. The arithmetic is simple; deciding which population each percentage describes is the essential work.
Name the sample space before calculating
A sample space collects the outcomes your model treats as possible. An event is a subset of those outcomes. Probability assigns nonnegative weights, with total weight one, and adds weights for disjoint events. For a fair six-sided die, every face receives probability one sixth. Fairness is a modeling assumption rather than a consequence of the die having six sides; a damaged die can use the same sample space with different weights.
Complements and overlaps let you calculate more complicated events. The probability of either event happening is the sum of their probabilities minus the overlap that was counted twice. Mutually exclusive events have no overlap. Independence means something different: knowing that one occurred does not alter the other's probability. Two positive-probability exclusive events cannot be independent, because observing one makes the other impossible.
Conditioning changes the reference population
The conditional probability asks what fraction of the probability inside event also belongs to . Dividing by renormalizes that restricted population. Reversing the condition usually changes the answer: the fraction of faults that trigger an alert need not equal the fraction of alerts caused by faults. The denominators describe different populations even though the numerator involves the same overlap.
Bayes' rule relates these directions. Its denominator must account for every way the evidence can arise. In a fault detector, alerts can come from true faults and false positives. Ignoring the second route can create a wildly overconfident conclusion when faults are rare. Conditioning can also be undefined for a zero-probability event in this elementary formula; continuous conditioning requires more careful machinery introduced later.
Assumptions are part of the answer
Independent repeated trials make some models manageable, but independence needs justification. Two services can fail together because they share a power source. Two classifier errors can be correlated because their inputs come from the same user. Multiplying marginal probabilities is justified only when the model asserts the appropriate independence, not simply because the events have different names. Conditional independence can hold after a shared cause is specified even when unconditional independence fails.
Probability quantifies uncertainty within a chosen model; it does not repair selection bias or identify causes automatically. An alert rate estimated on one population may transfer poorly to another with a different fault prevalence. Quantum measurement will also use probabilities, but those are obtained from amplitudes through an additional physical rule. The finite-event bookkeeping here remains useful while leaving the origin of those probabilities to its own subject.
Work it through
Why most alerts can still be false
A detector catches 90% of faults and falsely alerts on 5% of nonfaults. Faults occur in 1% of cases. What fraction of alerts correspond to faults?
Use a hypothetical population of 10,000 cases with the stated exact model proportions. There are 100 faults and 9,900 nonfaults; this keeps the base rate visible.
The detector produces 90 true alerts from faults and 495 false alerts from nonfaults. Both groups enter the population of alerts, giving 585 total alerts.
Condition on receiving an alert: the desired fraction is , rather than the detector's 90% sensitivity.
Only about 15.4% of alerts indicate faults in this model. A high sensitivity and a low false-positive rate can coexist with low precision when the base rate is small.
The living notebook
Explore the model
Interactive lab · probability
See what independent repeated trials imply
Set success probability p and integer trials n to inspect exact binomial bars, mean, and variance. The model assumes independent trials with constant success probability. It does not calculate detector posteriors or simulate random alerts; inspect the repeated-trial assumption itself.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA probability picture is meaningful only with its event definitions and independence assumptions attached.
Pause & reason
Check your understanding
Your turn
Try it yourself
A service uses pool A for 80% of requests and pool B for 20%. Error rates are 1% in A and 5% in B. Given an error, what is the probability it came from B?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Weight each pool's error rate by its traffic share before normalizing.
Compare with the solution
The B-and-error probability is . Total error probability is . Therefore . Pool B handles little traffic but supplies most errors under these assumptions.
Keep the idea
Take it with you
- A probability is tied to an event and a reference population.
- Bayes' rule reverses a condition while accounting for every route to the evidence.
- Independence is a substantive assumption, distinct from mutual exclusion.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.