TL;DR
The probability of an event changes once you learn that another event happened. The conditional probability is the chance of in the world where is already true. You compute it by throwing away every outcome outside and asking what fraction of the remaining outcomes also have .
Conditioning is how evidence enters probability. Every update, from a weather forecast to a medical test result, is a conditional probability.
Where you'll see it: in a spam filter asking how likely a message is to be spam given the words it contains, and in a Markov chain asking where the system goes next given where it is now.
Intuition
Narrowing the world
Suppose you draw one card from a standard deck and ask (this builds on Probability): is it a king? The answer is 4 in 52. Now someone tells you the card is a face card (a jack, queen or king). The question has changed. The other 40 cards are gone from consideration, and of the 12 face cards, 4 are kings. The answer is now 4 in 12.
Nothing about the card changed. The information shrank the set of possibilities you still consider, and the probability is the share of the surviving possibilities that match what you care about. That is the whole idea. The rest is notation and arithmetic.
flowchart LR S[All outcomes] --> B[Outcomes where B happened] B --> AB[Outcomes where A and B both happened] AB --> R[P of A given B: the share of B that is also A]
Why the notation matters
The bar in means "given". It separates what you are asking about from what you know. Writing and as different quantities keeps you honest: they are different questions, and they often have different answers. Confusing them is one of the most common mistakes in probability, and the tradeoffs section comes back to it.
The math
Definition
For events and with , the conditional probability of given is
Here is the probability that both and happen, and is the probability of the event you are conditioning on. Dividing by rescales so that the conditioned world has total probability 1. Without that division, would be too small, because it is measured against the whole space rather than against .
The requirement is real. If can never happen, the ratio has a zero denominator and there is nothing to condition on.
Multiplication rule
Rearranging the definition gives
This is often the more useful form. To find the chance of two things happening in sequence, multiply the first chance by the chance of the second, given the first. Extending it to three events:
Conditioning is a probability
For a fixed with , the function satisfies the same rules as any probability. It is between 0 and 1, the whole sample space has conditional probability 1, and for disjoint events and the probabilities add. So everything you know about probabilities applies once you condition. You are simply working in a smaller universe.
Independence in one line
Two events are independent when learning one tells you nothing about the other:
Independence is therefore the special case where conditioning changes nothing. See statistical independence for the full treatment.
Worked examples
Roll two fair dice. Let be "the sum is 8" and be "the first die shows 3".
- Outcomes with a first die of 3 are , so .
- Among those six outcomes, only sums to 8. So .
- Apply the definition: .
- Check by the simple view: once the first die is 3, the second must be 5, and that happens with chance .
Interpretation: knowing the first die is 3 leaves the sum equally likely to be any value from 4 to 9, so the chance of 8 is one in six. Compare this with for an unconditioned sum of 8. The information raised the chance.
A disease affects 1% of a population. A test catches 90% of sick people (true positive rate). It wrongly flags 5% of healthy people (false positive rate). A person tests positive. What is the chance they are sick?
Let be "sick" and be "tests positive". We want .
- Joint chances: .
- Healthy and positive: .
- Total chance of a positive result: .
- Divide: .
- About 15%.
Interpretation: a positive result is strong evidence, since the chance rose from 1% to about 15%, but most positives are still false alarms. Here the answer comes straight from the definition. The Bayes' rule lesson shows how to get the same number when the inputs are given in the reverse direction.
A bag holds 3 red and 2 blue balls. You draw two balls without replacement. What is the chance both are red?
- Let be "first ball red" and be "second ball red".
- .
- After one red is removed, the bag holds 2 red and 2 blue, so .
- Multiply: .
Interpretation: the second draw depends on the first. Ignoring that and multiplying by would give , which is wrong.
Tradeoffs and failure modes
Conditional probability is easy to define and easy to misuse. The table lists common situations.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Swapping the two sides, for | The prosecutor's fallacy: a rare match given innocence is read as a low chance of innocence | Write both directions and apply [[bayes-rule |
| Ignoring the base rate | The 15% result in the medical example looks like 90% | Always multiply by the prior before reading a test |
| Conditioning on a zero-probability event | The ratio is undefined | Use a limit or a density, or condition on a coarser event |
| Conditioning on a result of your own choosing | Selecting data after seeing it inflates apparent effects | Fix the condition before collecting data |
| Assuming independence without checking | Multiplying chances that are linked gives the wrong answer | Compute directly, or justify independence |
Some practical warnings:
- is not in general. The probability that a person is a pilot given they wear a uniform is not the probability they wear a uniform given they are a pilot.
- Conditioning on something caused by both variables creates a fake link. If you only look at admitted students, a hard-working and a well-connected applicant can look negatively related, even if they are independent in the whole pool. This is called collider bias or selection bias.
- The definition needs a consistent model. Conditional probabilities are only as good as the joint probabilities behind them. If the model of is wrong, every conditional value inherits the error.
History
Conditional reasoning is much older than the formula. In 1654 Blaise Pascal and Pierre de Fermat exchanged letters about the problem of points: how to split the stake of an unfinished game fairly. Their answers depended on what had already happened in the game, which is conditioning in practice, though neither wrote the general definition.
The idea of revising a probability with new evidence came with Thomas Bayes, whose essay on the topic appeared in 1763 after his death, and Pierre-Simon Laplace, who used the inverse form widely in the 1770s and 1780s. Both worked with what would later be called Bayes' rule, which is built on conditional probabilities.
The modern definition, , was made formal by Andrey Kolmogorov in his 1933 book Foundations of the Theory of Probability. Kolmogorov built probability on measure theory and defined conditional probability as a ratio of measures. That made it a precise object that could be used in stochastic processes, statistics and later machine learning. It caught on because it is short, intuitive (restrict and renormalise) and works everywhere the other axioms do.
Check yourself
QuestionA jar has 4 green and 6 yellow marbles. You pick one at random and it is yellow. What is the chance the next pick, without replacement, is also yellow?Show answer
After one yellow is removed, 5 yellow and 4 green remain, so . The second draw depends on the first because the composition of the jar changed.
QuestionCompute for a fair die, where is the event that the roll is even and is the event that the roll is at least 3. Show the counts.Show answer
The outcomes in are , so . The outcomes in are , so . Then . Restricting to leaves two even and two odd outcomes, which is why the answer is one half.
QuestionWhy is the same thing as saying and are independent, and why does this matter for multiplying probabilities?Show answer
Substituting into the multiplication rule gives , which is the definition of independence. Only then can you multiply the two individual probabilities to get the probability of both. If the events are linked, the product is wrong, as the drawing-without-replacement example shows.
QuestionA test is 99% accurate in both directions and the disease has a 0.1% base rate. Someone tests positive. Without computing, is the chance they are sick closer to 99% or to 10%? Explain briefly.Show answer
Closer to 10%, roughly. Among 100,000 people, about 100 are sick and 99 of those test positive, while about 1 in 100 of the 99,900 healthy people, roughly 999, also test positive. So about 1,100 test positives, of which 99 are sick, which is near 9%. The base rate dominates because healthy people are so numerous, so most positives are false.