Compound experiments and tree diagrams
A compound experiment is one carried out in several stages, one after another, and the tree diagram is the tool that orders everything: each branch carries a probability, multiplying along a path gives the probability that the whole path happens, and adding paths gives the probability of an event. In the IB exam it almost always appears with a tree already drawn and gaps to fill in, and with a final conditional probability question.
Experiments in several stages
Much real probability does not happen all at once but in steps: you draw one card and then another, you choose a supplier and then check whether the part fails, it rains or it does not, and then the team wins or loses. Each step is a stage. The set of possible outcomes of the whole experiment is the set of pairs (or triples…) of outcomes, one from each stage.
To organise the outcomes, draw a tree that is read from left to right:
- From a starting point come as many branches as there are outcomes in the first stage.
- At the end of each branch comes a new group of branches, with the outcomes of the second stage in that case.
- Each complete path, from the start to the right-hand end, is one outcome of the compound experiment.
The probabilities on the branches
This last check is the most useful one in the topic: if the probabilities at a node do not add up to 1, there is an error (or a branch is missing). It also lets you fill in gaps: if a branch leaving a node has a known probability, the other one is the known one.
Probability of a complete path
The intuition: the fraction of the total goes through branch , and of that fraction only a part continues along branch . A part of a part is a product.
The probabilities of all the complete paths add up to 1, since they cover every possible outcome. It is a second check to make once the tree is finished.
Probability of an event: adding paths
An event often occurs by several different paths. As those paths cannot occur together (they are mutually exclusive), their probabilities are added.
With and without replacement
When objects are taken from a set (balls, cards, chocolates, students), everything depends on whether the object taken is returned or not.
If a group of 10 objects has 4 of one type, the probability that the first one is of that type is . With replacement, the probability for the second is also . Without replacement, it is if the first was of that type (3 of 9 are left) and if it was not (4 of 9 are left). In both cases, at each node the branches still add up to 1.
Conditional probability read from the tree
A tree says "first this, then that". But sometimes the question is asked the other way round: you already know how it ended and want to know how it began.
The idea is one of sharing: of all the cases that end in , what part goes through branch ? This is the logic of Bayes: you do not need to learn another formula, you only divide one path by the sum of the paths that meet the condition.
There is a fact that surprises at first. is a probability you read directly from the branch, but is not on the tree: you have to calculate it by dividing. They are not equal, and confusing them is a very frequent mistake (see the common mistakes).
Worked examples
Two chocolates from a box
A box contains 10 chocolates: 4 are liqueur and 6 are chocolate. Two chocolates are taken at random, one after the other, without replacement (the first one is not returned).
a) Calculate the probability that both are liqueur.
b) Calculate the probability that they are of different types (one liqueur and one chocolate, in either order).
c) Calculate the probability that at least one is liqueur.
d) If the first chocolate were returned to the box before the second is taken, what would the probability be that both are liqueur?
Solution
Let be "liqueur" and be "chocolate". There are two stages. As the first one is not returned, in the second stage 9 chocolates are left.
a) Multiply along the path :
b) There are two paths, and , which are added:
c) It is quicker to use the complement: "no liqueur" is the path .
d) With replacement, the probabilities of the second stage are again and : This is greater than in a): by not returning the chocolate, fewer liqueur ones are left and it is harder to repeat.
Batteries from three factories
A shop receives mobile phone batteries from three factories, F1, F2 and F3. Half of the batteries come from F1, 30% from F2 and the rest from F3. The probability that a battery is faulty is if it comes from F1, if it comes from F2 and if it comes from F3. A battery is chosen at random from the shop.
a) Calculate the probability that the battery is from F3 and faulty.
b) Calculate the probability that the battery is faulty.
c) A battery is found to be faulty. Calculate the probability that it came from F2.
Solution
The first stage is the factory and the second is the state of the battery. F3 gets the rest: .
a) Multiply along the path F3 and faulty:
b) Three paths end in "faulty", and they are added:
c) The possible cases are the three faulty paths, which add up to . Of these, the one through F2 is :
Although F2 supplies only 30% of the batteries, among the faulty ones it is the most likely factory.
A spam filter
An email filter either marks a message as "spam" or lets it through. 30% of the messages that arrive in an inbox are spam. The filter marks as spam 90% of the messages that really are spam, and wrongly marks 4% of the messages that are not. A message is chosen at random.
a) Draw the tree diagram and calculate the probability that the message is spam and the filter marks it.
b) Calculate the probability that the filter marks the message.
c) Given that the filter has marked the message, calculate the probability that it really is spam. Give the exact answer and the answer to 3 significant figures.
d) Given that the filter has not marked the message, calculate the probability that it is spam.
Solution
Let be "the message is spam" and "the filter marks it". Data: , and (the 4%). The missing branches follow because each pair adds up to 1: , and .
a) .
b) There are two paths that end in "marked":
c) Among the messages that are marked, what fraction are spam?
d) Now the possible cases are the paths that end in "not marked". The path "spam and not marked" is , and the other one is . Therefore and
To 3 significant figures, c) is 0.906: 90.6% of what the filter marks is spam, and only 4.27% of what it lets through is.
In the exam: marks are given for drawing the tree (or the products of the branches) and, in the conditional parts, for showing the quotient with the numerator and the denominator separately. The most common mistake is to answer c) with , which is , the probability the other way round. If the tree is complete and the quotient is set up correctly, a later arithmetic error loses only that part.
Common mistakes
Summary
- A compound experiment has several stages; the tree diagram orders them from left to right, with one branch for each outcome.
- In the first stage the branches carry ordinary probabilities; in the later stages, conditional probabilities. The branches leaving a node add up to 1.
- Multiplying along a path gives the probability of the complete path: .
- Adding the paths that satisfy an event gives its probability (total probability): .
- With replacement the probabilities repeat at each stage; without replacement they must be recalculated according to what has already been taken.
- For "given that ": . This is the logic of Bayes.
- Always check that the branches of each node add up to 1 and that all the complete paths add up to 1.
Want to work on it together?
Free first consultation: we look at your level and your exam, and build a plan. Álvaro replies on WhatsApp.
Message us on WhatsApp