Counting Tree

Category: Discrete Math   Level: 101

3 × 2 × 2 = 12 outfits

Draw one branch for each choice at each stage. The number of leaves is the product of the number of choices, which is the multiplication principle.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Pick a shirt: 3 branches

Each shirt is one branch out of the start. Shirt color also colors every branch that follows it, so you can trace any outfit back.

3 shirts

Step 1: Pick a shirt: 3 branches

Step 2: Each shirt splits 2 ways

Every shirt pairs with either pair of pants, so each shirt branch grows 2 new branches.

3 × 2 = 6 pairs of shirt and pants

Step 2: Each shirt splits 2 ways

Step 3: Each pair splits 2 ways

Add shoes. Every shirt-pants pair grows 2 more branches, so the tree ends in 12 leaves.

3 × 2 × 2 = 12

Step 3: Each pair splits 2 ways

Step 4: Count the leaves

Each leaf is one full outfit, read from left to right. There are 12 leaves, and multiplying gets there without drawing a single branch.

3 × 2 × 2 = 12 outfits

Step 4: Count the leaves

All steps at once

Storyboard

Generate it yourself

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

Source: svgmath/diagrams/counting.py