How to use a tree diagram for probability

By Jude Wallis · Published

Each branch carries a conditional probability given everything upstream of it. Multiply the branch probabilities along a path to get that path's joint probability, then add the paths that satisfy your event. Sampling without replacement changes the second-stage branches.

AP Statistics: Unit 2 (topics 2.6 Conditional Probability, 2.7 Independent Events and Unions of Events). Tree diagrams are not named in the Fall 2026 course framework, but the arithmetic they organize is: the general multiplication rule and conditional probability in topic 2.6, and the independence shortcut and union rule in topic 2.7.

What a tree diagram is doing

A tree diagram lays a multi-stage random process out as a set of complete paths, so a probability you cannot see directly becomes a product you can compute. Each split in the tree is one stage. Each complete path from the start to a tip is one outcome of the whole process.

Two rules run everything:

  1. Multiply along a path. The probability of one complete outcome is the product of the branch probabilities you pass through.
  2. Add across paths. The probability of an event is the sum of the path probabilities for every path that satisfies it.

Those rules work because the branches out of a single split are mutually exclusive and cover every possibility, and because each branch after the first carries a conditional probability. A tree and a two-way table hold the same information. The tree is easier when the process arrives in stages with rates attached, and the table is easier when you already have counts.

Branch probabilities are conditional probabilities

The branches leaving the starting point carry plain unconditional probabilities. Every branch after that carries a probability conditional on everything upstream of it.

That is worth saying with symbols, because it is what makes the multiplication legal. If the first stage lands on AA and a second-stage branch is labeled BB, the number written on that branch is P(BA)P(B \mid A), read "the probability of B given A", not P(B)P(B).

The probabilities leaving any one split add to 1. That holds at the start and at every later split, because at each split you have listed every way the next stage can go for that particular history. When a split does not add to 1, you have either lost a branch or miscounted what remains.

Multiply along a path

Multiplying along a path is the general multiplication rule applied one stage at a time. The AP formula sheet writes it as

P(AB)=P(A)P(BA)P(A \cap B) = P(A) \cdot P(B \mid A)

where P(AB)P(A \cap B), read "the probability of A and B", is the joint probability that both happen.

Notice what the rule does not say. It does not say P(A)P(B)P(A) \cdot P(B). That shorter version is a special case, true only when the events are independent, which is exactly the case where P(BA)=P(B)P(B \mid A) = P(B).

Because a tree writes the conditional probability on the branch, you get the general rule for free and never have to decide whether the shortcut applies. When to multiply probabilities works through that decision.

For a three-stage process the pattern continues: P(ABC)=P(A)P(BA)P(CAB)P(A \cap B \cap C) = P(A) \cdot P(B \mid A) \cdot P(C \mid A \cap B). Each factor is conditional on everything to its left, which is the same as everything upstream on the path.

Add across the paths that fit the event

Once every path has a probability, most questions reduce to deciding which paths belong.

Adding is legal because distinct paths are mutually exclusive: one run of the process ends at exactly one tip. Disjoint events add with no correction term, so P(AB)=P(A)+P(B)P(A \cup B) = P(A) + P(B), where \cup is read "or", and there is no overlap to subtract. Disjoint vs independent events sorts out that distinction.

This is how you get a total probability, meaning the probability of a later-stage outcome no matter which earlier branch produced it. Collect every path ending in that outcome and add. A motor is defective whether it came from supplier A or supplier B, so P(defective)P(\text{defective}) is the sum of the two defective paths.

The same move handles compound events. "At least one" is the sum of every path with one or more, or faster, 1 minus the single path with none.

Why the second stage changes when you sample without replacement

Sampling without replacement means the item you drew is not available on the next draw. The denominator of every second-stage branch drops by one, and the numerator drops on the branch that matches what you took, so which numerator changes depends on which path you are standing on.

Start with 10 granola bars in a bag, 6 peanut butter and 4 oat, and take two without looking.

The first split is 610\frac{6}{10} for peanut butter and 410\frac{4}{10} for oat. After that first bar is gone only 9 remain, so every second-stage branch has 9 on the bottom. What sits on top depends on the path:

  • After a peanut butter bar, 5 peanut butter and 4 oat are left, so the branches read 59\frac{5}{9} and 49\frac{4}{9}.
  • After an oat bar, 6 peanut butter and 3 oat are left, so the branches read 69\frac{6}{9} and 39\frac{3}{9}.

Each pair still adds to 1, which is the check that you counted the remaining bars correctly. With replacement, both second-stage splits would read 610\frac{6}{10} and 410\frac{4}{10} again, identical to the first split, and the two draws would be independent. With replacement vs without replacement compares the two setups in more detail.

Working backwards to a first-stage branch

A tree is drawn forwards in time, but questions often run backwards: you are told how the process finished and asked about the stage you did not see. That reversed conditional is still one path divided by a sum of paths.

P(first-stage branchobserved outcome)=the single path with boththe total probability of the outcomeP(\text{first-stage branch} \mid \text{observed outcome}) = \frac{\text{the single path with both}}{\text{the total probability of the outcome}}

That is the definition P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)} with the numerator read off one path and the denominator read off a group of paths. No new formula is needed, and you do not have to invoke Bayes' theorem by name.

The answer often surprises people, because the reversed conditional can sit a long way from the forward one. A supplier that ships most of the parts can still account for less than half of the defective parts, which is what the first worked example below shows. P(A|B) vs P(B|A) explains why the two directions come apart.

One check comes free. The reversed conditionals across all the first-stage branches add to 1, because the item came from somewhere.

Three checks that catch tree mistakes

Trees fail in a small number of ways, and three quick checks catch nearly all of them.

  1. Every split adds to 1. Check the first split, then check each second-stage split on its own. A split that adds to anything else means a missing branch or a miscount of what is left.
  2. All path products add to 1. The tips of the tree are every possible outcome of the process, so their probabilities form a probability distribution. This one catches an arithmetic slip inside a single path.
  3. Each set of reversed conditionals adds to 1. If P(Adefective)P(A \mid \text{defective}) and P(Bdefective)P(B \mid \text{defective}) do not add to 1 when AA and BB are the only two suppliers, something upstream is wrong.

One habit prevents most arithmetic slips: keep fractions as fractions until the last line. 610×59=3090=130.3333\frac{6}{10} \times \frac{5}{9} = \frac{30}{90} = \frac{1}{3} \approx 0.3333 is exact. Rounding 59\frac{5}{9} to 0.560.56 first and computing 0.6×0.56=0.3360.6 \times 0.56 = 0.336 is already wrong in the third decimal, and that error compounds across a three-stage tree.

AP note: where tree diagrams show up

Tree diagrams are scratch work rather than a listed topic. The Fall 2026 course framework does not name them in the required content for Unit 2. What it does require is the arithmetic a tree performs.

  • Topic 2.6, conditional probability, gives both P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)} and the general multiplication rule P(AB)=P(A)P(BA)P(A \cap B) = P(A) \cdot P(B \mid A). Every branch after the first, and every path product, is one of those two.
  • Topic 2.7, independent events and unions of events, is where the shortcut P(AB)=P(A)P(B)P(A \cap B) = P(A) \cdot P(B) lives, together with P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B).

Unit 2 is 15 to 25 percent of the multiple-choice section, and the free-response section rewards organized work, so a labeled tree is worth drawing even when you could do the algebra in your head. Put probabilities on the branches, not just names, and write the path product at each tip. Then practice on the conditional probability set. The official framework is at AP Central.

Two suppliers: a joint probability, a total probability, and a reversed conditional

A robotics team buys motors from two suppliers. Supplier A ships 70 percent of the motors, and 4 percent of those are defective. Supplier B ships the other 30 percent, and 10 percent of those are defective. Find the probability that a motor is from supplier A and defective, the probability that a motor is defective, and the probability that a defective motor came from supplier A.

  1. Set up the first split. P(A)=0.70P(A) = 0.70 and P(B)=0.30P(B) = 0.30, and 0.70+0.30=1.000.70 + 0.30 = 1.00.

  2. Set up the second split on each branch. Given supplier A, P(defectiveA)=0.04P(\text{defective} \mid A) = 0.04 and P(goodA)=0.96P(\text{good} \mid A) = 0.96. Given supplier B, P(defectiveB)=0.10P(\text{defective} \mid B) = 0.10 and P(goodB)=0.90P(\text{good} \mid B) = 0.90. Each pair adds to 1.

  3. Multiply along the four paths. P(Adefective)=0.70×0.04=0.028P(A \cap \text{defective}) = 0.70 \times 0.04 = 0.028. P(Agood)=0.70×0.96=0.672P(A \cap \text{good}) = 0.70 \times 0.96 = 0.672. P(Bdefective)=0.30×0.10=0.030P(B \cap \text{defective}) = 0.30 \times 0.10 = 0.030. P(Bgood)=0.30×0.90=0.270P(B \cap \text{good}) = 0.30 \times 0.90 = 0.270.

  4. Check the tips: 0.028+0.672+0.030+0.270=1.0000.028 + 0.672 + 0.030 + 0.270 = 1.000.

  5. Add across the paths that end in a defective motor: P(defective)=0.028+0.030=0.058P(\text{defective}) = 0.028 + 0.030 = 0.058.

  6. Reverse the conditional. The condition is now "defective", so the denominator is 0.0580.058, and the numerator is the single path with supplier A and defective: P(Adefective)=0.0280.058=2858=14290.4828P(A \mid \text{defective}) = \frac{0.028}{0.058} = \frac{28}{58} = \frac{14}{29} \approx 0.4828.

  7. Check the reversal. P(Bdefective)=0.0300.058=15290.5172P(B \mid \text{defective}) = \frac{0.030}{0.058} = \frac{15}{29} \approx 0.5172, and 0.4828+0.5172=1.00000.4828 + 0.5172 = 1.0000.

  8. Read the result. Supplier A ships 70 percent of the motors but accounts for only about 48.28 percent of the defective ones, because supplier B's defect rate of 0.100.10 is 2.5 times supplier A's rate of 0.040.04.

P(Adefective)=0.028P(A \cap \text{defective}) = 0.028, P(defective)=0.058P(\text{defective}) = 0.058, and P(Adefective)=14290.4828P(A \mid \text{defective}) = \frac{14}{29} \approx 0.4828. About 5.8 percent of motors are defective, and slightly under half of the defective ones come from supplier A even though supplier A ships 70 percent of all motors.

Two granola bars drawn without replacement

A bag holds 10 granola bars: 6 peanut butter and 4 oat. You take two at random without replacement. Find the probability that both are peanut butter, the probability that the second bar is oat, and the probability that the first bar was peanut butter given that the second bar is oat.

  1. First split: P(PB first)=610P(\text{PB first}) = \frac{6}{10} and P(oat first)=410P(\text{oat first}) = \frac{4}{10}.

  2. Second split after a peanut butter bar: 5 peanut butter and 4 oat remain out of 9, so the branches are 59\frac{5}{9} and 49\frac{4}{9}.

  3. Second split after an oat bar: 6 peanut butter and 3 oat remain out of 9, so the branches are 69\frac{6}{9} and 39\frac{3}{9}.

  4. Multiply along the four paths, keeping a common denominator of 90. PB then PB: 610×59=3090\frac{6}{10} \times \frac{5}{9} = \frac{30}{90}. PB then oat: 610×49=2490\frac{6}{10} \times \frac{4}{9} = \frac{24}{90}. Oat then PB: 410×69=2490\frac{4}{10} \times \frac{6}{9} = \frac{24}{90}. Oat then oat: 410×39=1290\frac{4}{10} \times \frac{3}{9} = \frac{12}{90}.

  5. Check the tips: 30+24+24+1290=9090=1\frac{30 + 24 + 24 + 12}{90} = \frac{90}{90} = 1.

  6. Both peanut butter is a single path: 3090=130.3333\frac{30}{90} = \frac{1}{3} \approx 0.3333.

  7. The second bar is oat on two paths, so add them: 2490+1290=3690=25=0.40\frac{24}{90} + \frac{12}{90} = \frac{36}{90} = \frac{2}{5} = 0.40. That equals the starting proportion of oat bars, which is not a coincidence: before you look at anything, the second bar is exactly as likely to be oat as the first.

  8. Reverse the conditional. The condition is "second bar is oat", with total probability 3690\frac{36}{90}, and the path with peanut butter first contributes 2490\frac{24}{90}, so P(PB firstsecond is oat)=24/9036/90=2436=230.6667P(\text{PB first} \mid \text{second is oat}) = \frac{24/90}{36/90} = \frac{24}{36} = \frac{2}{3} \approx 0.6667.

  9. Sanity-check the direction. Knowing nothing, P(PB first)=0.60P(\text{PB first}) = 0.60. Learning that the second bar is oat raises it to about 0.66670.6667, because an oat bar turning up second is a little more likely when the oat bars were not already taken.

P(both peanut butter)=130.3333P(\text{both peanut butter}) = \frac{1}{3} \approx 0.3333, P(second is oat)=25=0.40P(\text{second is oat}) = \frac{2}{5} = 0.40, and P(peanut butter firstsecond is oat)=230.6667P(\text{peanut butter first} \mid \text{second is oat}) = \frac{2}{3} \approx 0.6667. With replacement the first answer would instead be 610×610=0.36\frac{6}{10} \times \frac{6}{10} = 0.36, and the last would stay at 0.600.60.

Frequently asked questions

Do the branches at each split have to add to 1?

Yes, at every split, including the ones deep in the tree. A split lists every way the next stage can go given the history along that path, so those probabilities are a complete probability distribution. A split adding to 0.90.9 or 1.11.1 means a branch is missing or a count is wrong.

When can I reuse the same probabilities at every stage?

Only when the stages are independent, which is the case for sampling with replacement, separate coin flips, or two machines running side by side. Sampling without replacement is the common exception: the pool shrinks, so the second-stage branches differ from the first and differ from each other.

Do I need Bayes' theorem for a reversed question?

No. The reversed conditional is the probability of the single path that has both features divided by the total probability of the observed outcome. That is just P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)} with numbers you already computed, and it is what Bayes' theorem does anyway.

Should I use a tree diagram or a two-way table?

Use a tree when the problem describes a staged process with rates, such as "70 percent come from supplier A, and 4 percent of those are defective". Use a table when the problem hands you counts already cross-classified by two variables. Either one converts into the other, since a path product is a joint probability and a joint probability is a cell.