Tree diagrams

Tree diagrams can represent conditional probabilities very well.

Tree diagrams can be oriented in many ways, here the focus is on left-to-right tree diagrams with more branches on the right side.

Contents

Construction

Events or decisions that occur earlier are further to the left on tree diagrams, meaning causation is left to right.

If-then statements are insufficient to deduce the order of causation. It all depends on the context and common sense.

  • Are you choosing a bag first, or picking a marble first?
  • Is it raining first, or is the event getting cancelled first?

It is possible that the occurrence order is different from the order that information become known. As an analogy, if you wrap a gift first in tissue paper then wrapping paper and gave it to your friend. Then when your friend unwraps it, they see the wrapping paper before the tissue paper.

Each branch records the conditional probability that the event to the right occurs, given that all events from the root up to that branch, have occurred. P(BA)\text{P}(B\,\vert\, A) is represented by a branch from event AA to BB.

Use the formula

P(BA)+P(BA)=1\text{P}(B\,\vert\, A) + \text{P}(B^\prime\,\vert\, A) = 1

to figure out some of the missing branches. It basically says BB either occurs or does not occur.

In HL there may be three branches to an event, all branches from an event must add up to 11.

Typically there are two levels of branches.

HL students may expect up to three levels of branches.

Interpretation

The chance of a particular sequence of events occurring can be found by multiplying the conditional probabilities along the corresponding path of branches.

Calculations

All formulas from Venn diagrams apply.

In addition, Bayes’ theorem, which comes from the definitions of intersection and conditional probability, says

P(AB)=P(BA)P(A)P(B)\text{P}(A\,\vert\, B) = \frac{\text{P}(B \,\vert\, A)\cdot\text{P}(A)}{\text{P}(B)}

Since our BB is fragmented into two branches, from AA to BB and from AA^\prime to BB, this means

P(B)=P(BA)+P(BA)=P(BA)P(A)+P(BA)P(A)\begin{align*} \text{P}(B) &= \text{P}(B \cap A) + \text{P}(B \cap A^\prime) \\ &= \text{P}(B \,\vert\, A)\cdot\text{P}(A) + \text{P}(B \,\vert\, A^\prime)\cdot\text{P}(A^\prime) \end{align*}

and in turn

P(AB)=P(BA)P(A)P(BA)P(A)+P(BA)P(A)\text{P}(A\,\vert\, B) = \frac{\text{P}(B \,\vert\, A)\cdot\text{P}(A)}{\text{P}(B \,\vert\, A)\cdot\text{P}(A) + \text{P}(B \,\vert\, A^\prime)\cdot\text{P}(A^\prime)}

and this is a way to find the “reverse” conditional probability.

HL students may be asked up to three events, which often means up to three terms in the denominator, as opposed to two in the current form. The formula is not worth memorizing, rather simply apply the conversion between intersection and conditional events in a systematic manner.

But Bayes’ Theorem is not SL?

It just means at SL, instead of asking you P(AB)\text{P}(A\,|\, B) in one step, they’ll first ask you for the intersections and P(B)\text{P}(B) separately. Knowing Bayes’ theorem helps you understand why certain questions are asked.

Example: There are two identical bags. Bag A has two red marbles and a blue marble. Bag B has two red marbles and three blue marbles. Mary picks a bag at random and picks out a marble at random and puts it back. The marble is red.

a) What is the probability that the red marble is from Bag A?

Rebekah really likes red marbles. With the same bags, she picks a bag at random and a random marble from within. If it is blue, it is replaced; then she switches bags and tries again. The process continues, switching bags with each blue marble, until she finds a red marble.

b) What is the probability that the red marble is from Bag A?


a) Drawing a tree diagram for conditional events requires first identifying the order in which events happen. Here, Mary must first pick a bag, then pick a marble from the bag.

tree diagram with branching into bags A and B before branching into red and blue marbles
Tree diagram for part a)

The probability that the marble is red is

P(red)=P(redA)P(A)+P(redB)P(B)=2312+2512=815\begin{align*} \text{P}(\text{red}) &= \text{P}(\text{red}\,\vert\, A)\cdot\text{P}(A) + \text{P}(\text{red}\,\vert\, B)\cdot\text{P}(B) \\ &= \frac23\cdot\frac12 + \frac25\cdot\frac12 \\ &= \frac{8}{15} \end{align*}

The probability that it came from bag A, given it is red, is

P(Ared)=P(Ared)P(red)=2312815=58\begin{align*} \text{P}(A\,\vert\,\text{red}) &= \frac{\text{P}(A \cap \text{red})}{\text{P}(\text{red})} \\ &= \frac{\frac23\cdot\frac12}{\frac{8}{15}} \\ &= \frac{5}{8}\qed \end{align*}

It is worth noting that it is slightly more than 12\frac12.


b) Here the final marble will be red, it’s just a matter of whether it is from bag A or B. Suppose Rebekah is starting from bag A and there is a probability pp of eventually picking a red marble from A. Then if she happens to pick blue from bag A then blue from bag B, she’s back to probability pp as the problem resets. From this observation, we can make the following tree diagram.

abbreviated tree diagram with initial choice of bags A and B branching each blue into red and blue of other bag, stopping when red or for Bag B blue it splits into eventual Bag A red or eventual Bag B red
Initial tree diagram for part b), with dotted parts showing abbreviated recursive trees

Using the top part of the diagram, if Rebekah starts on A, to eventually pick a red marble from A, she can either pick red immediately, or pick two blues to reset.

P(end Astart A)=p=23+1335p\begin{align*} \text{P}(\text{end }A\,\vert\,\text{start }A) = p = \frac23 + \frac13\cdot\frac35\cdot p \end{align*}

Solving for pp yields

p=56p = \frac56

If instead Rebekah starts on B, then there is a 35\frac35 chance of picking blue to switch to A. So the probability of starting on B and eventually ending on A is 3p5=12{\frac{3p}{5} = \frac{1}{2}}. This allows us to simplify the tree diagram.

simplified tree diagram with initial choice of bags before directly branching the eventual bags from which a red marble is taken
Final tree diagram for part b), showing starting and end bags

Finally, the probability to end on A is

P(end A)=P(end Astart A)+P(end Astart B)=5612+1212=23\begin{align*} \text{P}(\text{end }A) &= \text{P}(\text{end }A\cap\text{start }A) + \text{P}(\text{end }A\cap\text{start }B) \\ &= \frac56\cdot\frac12 + \frac12\cdot\frac12 \\ &= \frac23 \qed \end{align*}

Applications

diagnosis

First the person either has or do not have the disease. Then a diagnosis (detection) is made, which can be right or wrong.

false positive:     P(tests positiveis negative)\;\;\text{P}(\text{tests positive} \,\vert\, \text{is negative})

false negative:     P(tests negativeis positive)\;\;\text{P}(\text{tests negative} \,\vert\, \text{is positive})