Example
Enumerate every subset in binary mask order.
highlighted = computed this step
Step 1 — Subset
Compute the highlighted combinatorics value.
items, weight, value((empty), 0, 0)
Step 2 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A), 2, 6)
Step 3 — Subset
Compute the highlighted combinatorics value.
items, weight, value((B), 3, 7)
Step 4 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, B), 5, 13)
Step 5 — Subset
Compute the highlighted combinatorics value.
items, weight, value((C), 4, 10)
Step 6 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, C), 6, 16)
Step 7 — Subset
Compute the highlighted combinatorics value.
items, weight, value((B, C), 7, 17)
Step 8 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, B, C), 9, 23)
Step 9 — Subset
Compute the highlighted combinatorics value.
items, weight, value((D), 5, 12)
Step 10 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, D), 7, 18)
Step 11 — Subset
Compute the highlighted combinatorics value.
items, weight, value((B, D), 8, 19)
Step 12 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, B, D), 10, 25)
Step 13 — Subset
Compute the highlighted combinatorics value.
items, weight, value((C, D), 9, 22)
Step 14 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, C, D), 11, 28)
Step 15 — Subset
Compute the highlighted combinatorics value.
items, weight, value((B, C, D), 12, 29)
Step 16 — Subset
Compute the highlighted combinatorics value.
items, weight, value((A, B, C, D), 14, 35)
combinatorics-search
Every row is intentionally ordered and pinned to the lesson specification.