Probability Trees

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.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Look in the bag

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

Step 1: Look in the bag

Step 2: Branch for the first draw

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

Step 2: Branch for the first draw

Step 3: Branch again from what is left

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

Step 3: Branch again from what is left

Step 4: Multiply along each path

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

Step 4: Multiply along each path

Step 5: Add the paths you want

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

Step 5: Add the paths you want

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render probability-tree --out /tmp/probability-tree

Source: svgmath/diagrams/probability.py