The mathematical conundrum called the ‘knapsack problem’