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.
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
Every shirt pairs with either pair of pants, so each shirt branch grows 2 new branches.
3 × 2 = 6 pairs of shirt and pants
Add shoes. Every shirt-pants pair grows 2 more branches, so the tree ends in 12 leaves.
3 × 2 × 2 = 12
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
cd svg-generator python3 -m svgmath render counting-tree --out /tmp/counting-tree
Source: svgmath/diagrams/counting.py