Example
Read item weights and values for a tiny knapsack. The knapsack problem asks which items to pack to maximize total value without exceeding a weight limit. Laying out each item's weight and value side by side sets up that tension: heavier items may be worth more, so the best choice balances value gained against the capacity it consumes.
highlighted = computed this step
Step 1 — Capacity
Set up the exact small combinatorics values.
capacity7
Step 2 — Items
Compute the highlighted combinatorics value.
item, weight, value((A, 2, 6), (B, 3, 7), (C, 4, 10), (D, 5, 12))
combinatorics-search
Every row is intentionally ordered and pinned to the lesson specification.