Let's apply the aforementioned principle to a particular choice that I faced on Friday night: buying savoury snacks before a party. I have a five pound budget for these snacks, and the off-licence presents me with a choice of crisps and nachos (we'll ignore the different flavours and brands for the purpose of this analysis). My choice is how many of each pack to buy.
At this point, to make it a well-formed problem, I need to define the utilities. I will do so using two assumptions.
The first is the assumption of diminishing marginal utility: the additional utility due to one extra item is smaller the greater the quantity of that product you already have. Desirable as a sports car is, it is usually less desirable once you have won the lottery and bought ten of them. Applying this to our scenario, the tenth pack of crisps, for example, does not provide as much additional utility as the second pack of crisps.
The second is an independence assumption; that my utility of having a certain number of packs of nachos does not depend on how many packets of crisps I have, and vice versa. This is less realistic but simplifies the mathematics, in that total utility is just the sum of the utilities due to each good.
It does not matter which particular utility function we use, so long as it obeys these constraints. Call the number of packs of crisps purchased n1 and the number of packs of nachos n2. We will arbitrarily choose the following function:
Here we are considering only positive roots, ignoring the fact that a negative number squared is positive.
The numbers n1 and n2 are related in that, as mentioned earlier, I have a five pound budget for both kind of snack.
By increasing n1 or n2 in the first equation, you can see that buying a pack always has a positive effect on utility, so I will buy as many packs as I can. So n2 is the largest whole number which satisfies this rearrangement of the above: