Category: Probability Level: 301
P(A and B) = P(A) · P(B | A)
Draw one branch for each way a draw can go and write its chance on it. Multiply along a path to get the chance of that whole path, and add paths that answer the same question.
The bag holds 3 red marbles and 2 blue ones. Draw one, keep it out, then draw again. Since the first marble stays out, the second draw sees a smaller bag.
P(R) = 3/5, P(B) = 2/5
One branch per color, labeled with its chance. The two chances add to 1 because the first marble is surely red or blue.
3/5 + 2/5 = 1
After a red, the bag has 2 red and 2 blue. After a blue, it has 3 red and 1 blue. Each set of second-draw chances depends on the first draw.
P(R second | R first) = 2/4; P(R second | B first) = 3/4
Follow a path from start to end and multiply its chances. Over 20 equally likely ordered draws, each path claims its share.
P(RR) = 3/5 × 2/4 = 6/20
One of each color happens on two paths, RB and BR. Add them. All four paths together add to 1, a good check that no marble went missing.
P(one of each) = 6/20 + 6/20 = 12/20 = 3/5
cd svg-generator python3 -m svgmath render probability-tree --out /tmp/probability-tree
Source: svgmath/diagrams/probability.py