Combinatorics
Counting the ways…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Combinatorics
Counting the ways…
When decisions happen one after another, the number of outcomes is the product of the number of options at each stage. A decision tree shows why: every stage multiplies the leaves.
How many outfits can you make from 3 shirts, 2 pairs of pants and 2 pairs of shoes? Instead of listing them, build a decision tree: one level per decision, one branch per option. The root is the moment before any choice.
Each factor is coloured like its stage in the tree. A bracketed sum is an either-or stage: its groups add, and the result multiplies with everything else.