Probability Trees And Repeated Experiments
On this page
A probability tree turns the rules from "Probability Foundations" into a picture you can compute with. Instead of juggling formulas for unions, intersections and conditional probabilities, you draw branches, write a probability on each, and follow two simple rules. Trees are especially good at experiments that happen in stages, which leads naturally into repeating an experiment several times, with or without putting things back.
Reading A Probability Tree
A tree starts at a single point and splits into one branch per possible outcome. Every branch carries the probability of taking it, and the branches leaving one point always add up to .
OR Means Add
Rolling a die gives a tree with 6 branches of each. "Rolling an even number" means landing on branch 2 or 4 or 6. These branches are mutually exclusive, so by the addition rule:
If several branches leaving the same point are favourable, add their probabilities. Be careful with language here: "even" is never "a 2 and a 4 and a 6". In mathematics "and" means at the same time, and a single roll cannot show three faces.
AND Means Multiply
A bag of 3 white rolls (ham, cheese, salami) and 2 brown rolls (ham, cheese). You first see the bread, then open the roll to see the filling, so the tree has two levels.
The first level holds ordinary probabilities, . The second level holds conditional probabilities: once you know the roll is brown, there are only 2 fillings left and salami is impossible, so .
Multiplying two consecutive branches gives , which by the multiplication rule is exactly . Multiplying along a path gives the probability of everything on that path happening. Here every leaf works out to , which makes sense: there are 5 rolls, all equally likely.
The Chain Rule In Tree Form
The tree extends to any number of stages. Along a path , the first branch carries , the second , the third , and
You get this formula for free just by multiplying along the path, without writing it out. When stages are independent, the conditional probabilities equal the ordinary ones, so the branches simply carry and .
Draw Only What You Need
You never need the complete tree. If the question only asks about one combination of outcomes, draw only the path (or paths) leading to it. For large experiments, the full tree would be enormous, so this is not just a shortcut but a necessity.
The Unknown Branch Trap
Some questions produce a branch whose probability you cannot fill in. Two cards are drawn without replacement. What is the probability that the first card is an ace and the second is red?
The first branch is easy, . But the second depends on which ace was drawn: a red ace removes a red card from the deck, a black ace does not. The branch value is unknown.
Split Until Every Branch Is Known
The fix is to split the first stage into cases that do determine the second stage: "red ace" and "black ace". These are mutually exclusive, so you compute both paths and add.
The general lesson: if a branch probability depends on a detail you have not tracked, split the previous stage on that detail. Notice the answer equals , as if the draws were independent. That is a coincidence of the numbers, not a rule, so you still need the split to know it.
Repeating Experiments
Many problems repeat the same basic experiment several times: draw 5 cards, roll 3 dice, send 10 packets. Two questions determine how to compute the probability:
| Question | Options |
|---|---|
| Is the item put back between draws? | Without replacement (dependent draws) or with replacement (independent draws) |
| Does the question fix the order? | Order fixed ("first X, then Y") or all orders count ("one X and one Y") |
Rolling dice behaves like drawing with replacement: every roll starts from the same situation.
Without Replacement, Order Fixed
Two cards, no replacement. What is the probability that the first is a black ace and the second is red? There is only one path:
The second factor has denominator because one card is gone.
Without Replacement, All Orders Count
What is the probability that one card is a black ace and the other is red? Now two orders qualify: ace then red, or red then ace. Both have the same probability (), so the answer is twice the single path:
Counting The Orders
For 5 cards, what is the probability of 2 black aces (A) and 3 red cards (R)? One specific order, AARRR, has probability
Every other order (ARARR, RRRAA, ...) has the same probability: the same numerators and denominators appear, just shuffled. So instead of listing them, count them. Placing 2 A's and 3 R's in a row is a permutation with repetition from "Combinatorics":
Here counts black aces and counts red cards, and the comma in means and.
The same result comes out of pure counting with Laplace: choose both black aces and 3 of the 26 red cards, out of all 5-card hands.
Getting the same answer by two independent methods is a strong check. The counting form is the hypergeometric pattern: for drawing "special" items when are drawn from containing special ones.
With Replacement
Now the card goes back each time, which is the same as drawing from a fresh deck every time. The draws are independent and the denominators stay at .
Order fixed, black ace then red:
All orders count, one black ace and one red: .
Five draws, 2 black aces and 3 reds:
With only two kinds of outcome per draw ("success" with probability , "failure" with ), this is the binomial pattern that comes back later in the course:
Side By Side
| Order fixed | All orders count | |
|---|---|---|
| Without replacement | Multiply along one path, denominators shrink | One path number of orders |
| With replacement | Multiply along one path, denominators stay | One path number of orders |
The structure is identical, only the denominators differ. The "number of orders" is always a permutation with repetition, .
Simulating To Check
When you are unsure whether a problem is "with" or "without" replacement, a simulation settles it. random.sample draws without replacement, random.choices with.
import random
deck = ["BA"] * 2 + ["R"] * 26 + ["O"] * 24 # black aces, reds, others
trials = 1_000_000
hits = sum(1 for _ in range(trials)
if sorted(random.sample(deck, 2)) == ["BA", "R"])
print(hits / trials, 2 / 51) # both about 0.0392Worked Exercises
These are taken from the exercise sets at the end of the probability part of the book.
Transfer Between Boxes
Box 1 holds 4 white and 3 black balls, box 2 holds 3 white and 5 black. One ball moves from box 1 to box 2, then a ball is drawn from box 2 (now 9 balls). Split on the colour that moved:
Three Children
Each child is a boy or girl with probability , independently. At least one girl: . All girls given at least one girl: . Exactly two boys: .
Drawing Without Replacement
A box with 6 red and 8 white balls; draw 5. .
5 storage disks, 2 defective, inspect 3: .
100 modules of which 20 have bugs, test 5: .
The Birthday Problem
In a group of 25, the chance that everyone has a different birthday (365 days, equally likely) is a chain of shrinking fractions, the same as drawing without replacement:
The same structure explains hash collisions. Ten keys in a hash table with 100 buckets all land in different buckets with probability , so more than a third of the time at least two keys collide, even though the table is only full. Four bus passengers choosing among 10 stops all get off at different stops with probability .
Independent Repetitions
A Bloom filter gives a false positive with probability . Over 100 independent queries for absent elements, .
An ID of 6 random digits contains exactly two zeros with probability , a direct binomial calculation.
Monty Hall
Three doors, one hides a computer. You pick a door, then the host, who knows where the computer is, opens one of the other two doors and shows it is empty. You may now switch. Sticking wins only if your first pick was right: . Switching wins whenever your first pick was wrong (), because the empty door that was opened leaves the prize behind the remaining one. Switch: .
A Dice Game
Roll two dice: a sum of 4, 7 or 11 wins, an 8 means "keep rolling until 8 (win) or 7 (lose)", anything else loses. . After an 8, only 8s and 7s matter, so the chance of hitting 8 first is . Total: .
Quick Recap
- Branches from one point sum to . First level: ordinary probabilities. Later levels: conditional probabilities.
- OR: add the favourable branches. AND: multiply along the path (the chain rule for free).
- Draw only the paths you need.
- If a branch value depends on an untracked detail, split the earlier stage on that detail.
- Without replacement: denominators shrink, draws are dependent. With replacement: denominators stay, draws are independent.
- Order fixed: one path. All orders count: one path number of orders .
- Counting check: without replacement matches , with replacement matches .