Groups
Category
The partition function p(n) counts the number of ways to write n as a sum of positive integers where order does not matter.
Knapsack problems ask how to pick items under a weight (or cost) limit to maximize value or to check if a target sum is reachable.