Sub topic 14
Tree Diagrams and Probability Tables
Assume you know fractions, ratios, basic counting, conditional probability, and the multiplication rule for sequential events. A tree diagram organizes a multi-stage experiment. Each branch represents one possible outcome at that stage. A probability table organizes the same information in rows and columns.
Reading a tree diagram
Suppose a bag contains 3 red marbles and 2 blue marbles. You draw two marbles without replacement.
The first draw has probabilities \(3/5\) and \(2/5\). After the first draw, the probabilities on the second stage change because one marble has been removed.
To find the probability of one complete path, multiply the branch probabilities:
\[ P(\text{two red})=\frac35\cdot\frac24=\frac3{10} \]
To find the probability of several paths, add their probabilities:
\[ P(\text{one red and one blue}) = \frac35\cdot\frac24+\frac25\cdot\frac34 = \frac6{20}+\frac6{20} = \frac35 \]
The phrase “and then” usually identifies one path, so multiply. The phrase “or” usually identifies multiple paths, so add after calculating each path.
Probability tables
A table can show the joint outcomes of two events. Suppose 60 students are classified by whether they study and whether they pass:
| Row | Pass | Do not pass | Total |
|---|---|---|---|
| Study | 36 | 9 | 45 |
| Do not study | 6 | 9 | 15 |
| Total | 42 | 18 | 60 |
From the table:
\[ P(\text{study and pass})=\frac{36}{60}=\frac35 \]
\[ P(\text{pass})=\frac{42}{60}=\frac7{10} \]
The conditional probability of passing given that a student studied restricts the sample space to the 45 students who studied:
\[ P(\text{pass}\mid\text{study})=\frac{36}{45}=\frac45 \]
A table is especially useful when the problem gives counts or percentages. A tree is often clearer when outcomes occur in a specific sequence.
The law of total probability
If an event can occur through separate categories, calculate each category’s path probability and add:
\[ P(A)=P(B)P(A\mid B)+P(\text{not }B)P(A\mid\text{not }B) \]
For example, if 40% of applicants take a preparation course, 75% of those pass, and 50% of those who do not take it pass:
\[ P(\text{pass})=(0.40)(0.75)+(0.60)(0.50)=0.60 \]
from fractions import Fraction
p_two_red = Fraction(3, 5) * Fraction(2, 4)
p_one_each = (
Fraction(3, 5) * Fraction(2, 4)
+ Fraction(2, 5) * Fraction(3, 4)
)
print(p_two_red) # 3/10
print(p_one_each) # 3/5Exercise
A machine produces 2% defective items. An inspector correctly identifies a defective item 90% of the time. What is the probability that an item is both defective and correctly identified?
Show answer
Multiply along the path: \(0.02 \times 0.90 = 0.018\), or 1.8%.