When your problem seems to be about maximizing or minimizing a value while satisfying constraints, linear programming might help you.
Cupcakes need 1 part chocolate, 3 parts flour, 1 part butter. Brownies need 2 parts chocolate, 2 parts flour, 1 part butter. We only have 20 parts of chocolate, 13 parts of flour, and 11 parts of butter in our kitchen. Cupcakes earn you 5 coins, and brownies 3. How many of each to bake for most profit?
The resulting model outlines a solution space that satisfies all constraints.