Introduction
New information changes probabilities. Knowing that a test came back positive, that a packet arrived late, or that the first card drawn was an ace, we should update how likely the other events are. Conditional probability is the rule for that update. Two theorems follow from it: the law of total probability (compute a probability by splitting into cases) and Bayes theorem (reverse the direction of conditioning: from "probability of the evidence given the cause" to "probability of the cause given the evidence"). Bayes theorem underlies spam filters, diagnostic reasoning and naive Bayes classifiers.
Prerequisites
- Probability Basics: axioms, addition rule, independence, partitions of the sample space.
Core concepts
Definition
For events and with , the conditional probability of given is
Knowing occurred shrinks the sample space to ; is the share of that also lies in . With equally likely outcomes, . is undefined when .
For fixed , is itself a probability: it satisfies the axioms, so and . But in general .
Multiplication rule and chain rule
provided the conditioning events have positive probability. This is the rule for sequential experiments such as drawing without replacement.
Independence revisited
For : and are independent if and only if . So independence means "learning does not change the probability of ".
and are conditionally independent given if . Conditional independence and independence do not imply each other.
Law of total probability
Let be a partition of (mutually exclusive, exhaustive) with every . Then for any event :
The simplest case uses and : .
Bayes theorem
With the same partition and :
Vocabulary: is the prior, the likelihood, the posterior, and the denominator is by total probability. The posteriors over the partition add to 1.
Probability tree method. Draw a branch for each labelled , then sub-branches for and labelled with conditional probabilities. Multiply along a path for the joint probability; add paths ending in for ; divide one path by that sum for Bayes.

is not
Confusing the two is the prosecutor's fallacy. They are related by Bayes: . They are equal only when (or ).
Worked examples
Example 1: diagnostic test (base rates)
A disease affects 1% of a population. A test detects it in 99% of patients who have it (sensitivity), and gives a false positive for 5% of people who do not. A random person tests positive. What is the probability they have the disease?
Despite a 99% sensitive test, a positive result means only about a 1 in 6 chance of disease, because healthy people vastly outnumber sick ones. A second independent positive test (conditionally independent given the disease status) raises it to .
Example 2: machines and defects
Machines make 50%, 30% and 20% of a factory's items, with defect rates 1%, 2% and 3%.
A random item is defective. ; similarly , . The three posteriors add to 1.
Example 3: drawing without replacement
An urn has 5 red and 3 blue balls. Two are drawn without replacement.
- (chain rule).
- (total probability). By symmetry, every draw position has the same marginal probability of red.
- .
Example 4: conditioning on partial information
A family has two children, each independently a boy or girl with probability . Given that at least one is a boy, the probability that both are boys is , not . Given that the elder is a boy, it is . The sample spaces differ: versus .
Example 5: Monty Hall
A prize is behind one of three doors. You pick door 1. The host, who knows where the prize is and always opens an unpicked door without the prize (choosing at random when he has a choice), opens door 3. Switching to door 2 wins with probability : . The answer depends on the stated host behaviour.
Example 6: a noisy binary channel
A transmitter sends 0 with probability 0.6 and 1 with probability 0.4. The channel flips a 0 into a 1 with probability 0.1, and a 1 into a 0 with probability 0.2.
Similarly and . The probability of a correct decision when the receiver outputs whatever arrives is .
Example 7: moving a ball between urns
Urn I has 3 white and 2 black balls; urn II has 4 white and 4 black. One ball is moved at random from urn I to urn II, then a ball is drawn from urn II. Split on the moved ball:
Given that the ball drawn is white, the moved ball was white with probability , up from the prior .
Example 8: a randomly chosen coin
A box holds one fair coin and one two-headed coin. A coin is picked at random and tossed twice. Given the coin, the tosses are independent. Unconditionally, , but
so the tosses are dependent: a first head is evidence for the two-headed coin. After two heads, , and the next toss is a head with probability .
Example 9: "at least one" conditions
Two fair dice. "At least one six" has 11 of the 36 outcomes, so and (outcomes and ). Conditioning on "the first die is a six" instead gives for both. As in Example 4, the wording of the condition changes the reduced sample space.
Important properties and observations
- , but can be anything in .
- If , then . If , .
- if and only if (positive association is symmetric), assuming both probabilities are positive.
- A low base rate makes most positives false unless the false-positive rate is small compared with the base rate. Writing for the disease prevalence, if and only if . In Example 1 this holds (0.0495 against 0.0099). If instead , sensitivity is 0.99 and specificity is 0.9999, then , so almost all positives are true.
- Finite-ratio odds form of Bayes (assume , , and ; zero denominators/infinite odds require separate handling): (posterior odds = likelihood ratio times prior odds).
- Sequential updating. If observations are conditionally independent given the hypothesis, updating one observation at a time (each posterior becomes the next prior) gives the same answer as conditioning on all of them at once. In Example 1, updating twice on a positive test gives the same .
GATE examination perspective
- Bayes with a partition. Two or three sources (machines, urns, channels) with given rates, and a question about the source given an outcome. Draw the tree, multiply along paths, divide.
- Total probability. "Probability that the second item is defective", "probability that a bit is received as 1".
- Sequential draws. Chain rule; symmetry of draw positions without replacement.
- Trap: swapping and .
- Trap: "at least one is a boy" versus "the elder is a boy"; restate the condition as a precise event before computing.
- Numerical answers. Keep fractions exact until the last step; round only when the required precision is known.
- Two-stage experiments. Move a ball, pick an urn or a coin, then observe: total probability over the first stage, Bayes for "which first-stage outcome" (Examples 7 and 8).
- Trap: treating tosses of a randomly chosen coin as independent; they are independent only given the coin.
Summary
Sources
- S. Ross, A First Course in Probability, 8th ed., Pearson Prentice Hall, 2010: Chapter 3 (Conditional Probability and Independence), Sections 3.2 (Conditional Probabilities), 3.3 (Bayes's Formula) and 3.4 (Independent Events).