Sub topic 10
Spreading a Budget: The Equimarginal Principle
This chapter assumes you know the marginal decision rule (act while marginal benefit is at least marginal cost), can read a table of marginal values, and understand diminishing returns. Basic Python helps with the code example but is not required.
One budget, several uses
The earlier chapters asked whether to do one more unit of a single activity. Real decisions usually involve a limited resource and several places to put it. Examples are hours of study across courses, dollars across ad channels, and units of output across factories.
The marginal rule alone does not settle these cases. Each use may look worthwhile, but you cannot fund all of them. The opportunity cost of an hour or dollar spent on one use is the best marginal benefit you give up elsewhere.
The equimarginal principle answers this. A fixed budget is best spent when no use has a higher marginal benefit than another. Equivalently, you cannot gain by moving one unit from one use to another.
The principle in one sentence
If you want the most total benefit from a fixed budget, keep giving the next unit to the use with the highest marginal benefit. Stop when the budget runs out. At the end, the last unit in each used option has roughly the same marginal benefit.
If one use still had a higher marginal benefit than another, you could move a unit to it and raise your total. So the allocation could not have been the best one.
Worked example: six hours of study
You have 6 hours to spend on three subjects. The table shows the extra exam points each additional hour earns. The numbers fall because of diminishing returns.
| Hour | Math | History | Chemistry |
|---|---|---|---|
| 1st | 10 | 9 | 4 |
| 2nd | 8 | 7 | 3 |
| 3rd | 6 | 5 | 2 |
| 4th | 4 | 3 | 1 |
| 5th | 2 | 2 | 1 |
| 6th | 1 | 1 | 0 |
Take hours one at a time, always from the best remaining value in the table:
- 10 (Math), 9 (History), 8 (Math), 7 (History), 6 (Math), 5 (History).
- That is 3 hours of Math, 3 of History, and none of Chemistry.
- Total points: (10 + 8 + 6) + (9 + 7 + 5) = 24 + 21 = 45.
An equal split of 2, 2, 2 hours gives 18 + 16 + 7 = 41 points. The marginal approach gains 4 points from the same 6 hours.
You can check the result with a swap test. Moving an hour from History (last hour worth 5) to Chemistry (next hour worth 4) loses 1 point. Moving an hour from Math (last worth 6) to Chemistry loses 2. No swap helps.
Notice that Chemistry gets nothing. Its best hour (4) is worth less than the last hour you gave to Math (6) or History (5). This is a corner solution: an option receives zero because even its first unit loses to the alternatives.
Checking it in code
The greedy loop below allocates hours one at a time. A brute-force search over every possible split confirms the result.
from itertools import product
marginal_benefit = {
"Math": [10, 8, 6, 4, 2, 1],
"History": [9, 7, 5, 3, 2, 1],
"Chemistry": [4, 3, 2, 1, 1, 0],
}
budget = 6
def next_value(name, hours):
"""Marginal benefit of the next hour for this subject, or -inf if none is left."""
values = marginal_benefit[name]
return values[hours[name]] if hours[name] < len(values) else float("-inf")
def greedy(budget):
hours = {name: 0 for name in marginal_benefit}
for _ in range(budget):
best = max(marginal_benefit, key=lambda n: next_value(n, hours))
hours[best] += 1
return hours
def total_benefit(hours):
return sum(sum(marginal_benefit[n][:h]) for n, h in hours.items())
plan = greedy(budget)
print(plan, total_benefit(plan)) # {'Math': 3, 'History': 3, 'Chemistry': 0} 45
# Brute force: try every split of 6 hours across the three subjects.
names = list(marginal_benefit)
best_total = max(
total_benefit(dict(zip(names, split)))
for split in product(range(budget + 1), repeat=len(names))
if sum(split) == budget
)
assert total_benefit(plan) == best_total == 45
equal = {"Math": 2, "History": 2, "Chemistry": 2}
print(total_benefit(equal)) # 41The assertion compares totals rather than allocations, because two different splits can tie for the best total.
When units cost different amounts
Above, every hour cost the same, so you could compare marginal benefits directly. When options have different prices, compare marginal benefit per dollar. A unit that adds 28 points but costs $4 is not automatically better than one that adds 12 points and costs $2.
Suppose you have $12 for two goods. Good A costs $2 per unit and Good B costs $4 per unit. The table shows the marginal benefit of each unit and the benefit per dollar.
| Unit | A: MB | A: MB per $ | B: MB | B: MB per $ |
|---|---|---|---|---|
| 1st | 12 | 6.0 | 28 | 7.0 |
| 2nd | 10 | 5.0 | 18 | 4.5 |
| 3rd | 8 | 4.0 | 12 | 3.0 |
| 4th | 6 | 3.0 | 8 | 2.0 |
Rank the units by benefit per dollar: B1 (7.0, $4), A1 (6.0, $2), A2 (5.0, $2), B2 (4.5, $4). These cost $4 + $2 + $2 + $4 = $12, so the budget is gone. You buy two units of each good for a total benefit of 22 + 46 = 68.
In symbols, the condition is MBA / PA = MBB / PB for every good you buy. This is the consumer's version of the principle. It is often written with marginal utility in place of marginal benefit.
The ratio is the benefit of the last dollar spent. At the optimum, the last dollar does equally well everywhere, so no reshuffling of dollars helps. The common value is also the benefit you would gain from one more dollar of budget.
Why it works
The argument is a swap test, and it has two parts.
- If the marginal benefit per dollar differs between two uses, move a dollar from the lower to the higher. You lose the low value and gain the high one, so the total rises. An allocation with unequal values cannot be the best.
- Diminishing returns make the swap stop. Each dollar you add to a use lowers its next value, and each dollar you remove raises it. Repeated swaps push the values toward each other until none is worth making.
The next diagram shows the greedy procedure as a loop.
The same idea for costs
The principle also works for minimizing cost. Suppose a firm must produce 5 units and has two plants. The table lists the marginal cost of each unit at each plant.
| Unit | Plant A: MC | Plant B: MC |
|---|---|---|
| 1st | 2 | 5 |
| 2nd | 4 | 7 |
| 3rd | 6 | 9 |
| 4th | 8 | 11 |
| 5th | 10 | 13 |
Here you pick the cheapest units: 2, 4, 5, 6, 7. Plant A makes 3 units (cost 2 + 4 + 6 = 12) and Plant B makes 2 units (cost 5 + 7 = 12). The total cost is 24.
The alternatives are worse. A 2-and-3 split costs 6 + 21 = 27, and a 4-and-1 split costs 20 + 5 = 25. At the optimum the last units cost 6 and 7, and the next units would cost 8 and 9. For cost minimization, the principle says to equalize marginal cost across plants, so no unit is made where another plant could make it more cheaply.
Edge cases and common errors
Using totals or averages. Allocating by which option has the highest total or average benefit gives the wrong answer. In the study example, Chemistry could have a high average for its first hour and still lose to the later hours of Math. Only the next unit's value matters.
Forgetting to divide by price. If options cost different amounts, compare benefit per dollar, not raw marginal benefit. Comparing raw values favors expensive options.
Expecting exact equality. With whole units, marginal values rarely match exactly. In the study example the last values were 6 (Math) and 5 (History), and Chemistry's next value was 4. The practical test is that no swap improves the total, not that all values are equal.
Increasing returns. The greedy method relies on marginal benefit falling as you add units. If it rises, as with a machine that is cheap to run only at large volume, the best answer may put the whole budget in one place. Then the "equal at the margin" condition can point at the worst allocation instead of the best.
Indivisible, lumpy items. When units are large and different prices do not fit the budget evenly, greedy ranking can leave money unspent or pick a worse bundle. In the $12 example the budget happened to fit exactly. In general, check a few nearby bundles, which is the knapsack problem from computer science.
Corner solutions. A zero allocation is a valid answer, as with Chemistry above. Do not force a share to every option just because it exists.
Unequal resources. The principle assumes the budget is the only limit. If you must also spend at least some minimum on each option, set that minimum first and then spread the remainder.
Summary of the method
- List the marginal benefit (or marginal cost) of each successive unit for each option.
- Divide by price if prices differ.
- Fill the budget starting from the best values, or the cheapest costs when minimizing.
- Check that no one-unit swap improves the total.
Exercise
You have 5 hours to split between two jobs. Job X pays marginal wages of 20, 16, 12, 8, 4 for hours 1 to 5. Job Y pays 18, 14, 10, 6, 2. How many hours go to each job, and what is the total pay?
Show answer
Take the five highest values from both lists: 20, 18, 16, 14, 12. Job X gets 3 hours (20 + 16 + 12 = 48) and Job Y gets 2 hours (18 + 14 = 32). The total is 80. The next values, 10 for Y and 8 for X, are lower than the last chosen value of 12, so no swap helps.
Exercise
You have $10 to spend on snacks. Chips cost $2 each and add 12, 8, 4 units of enjoyment for the first three bags. Candy bars cost $1 each and add 5, 4, 3, 2, 1 for the first five. What is the best bundle?
Show answer
Compute enjoyment per dollar. Chips: 6, 4, 2. Candy: 5, 4, 3, 2, 1. Rank the units: chips1 (6, $2), candy1 (5, $1), then chips2 and candy2 tie at 4 (chips2 costs $2, candy2 costs $1), candy3 (3, $1), then chips3 and candy4 tie at 2. Buying chips1, candy1, chips2, candy2, candy3 costs 2 + 1 + 2 + 1 + 1 = $7. The remaining $3 buys the units at 2 per dollar: chips3 ($2) and candy4 ($1), for exactly $10. The bundle is 3 bags of chips and 4 candy bars with total enjoyment 24 + 14 = 38. Check a tie: swapping chips3 for two candy bars gives 4 + (2 + 1) = 7 instead of 4 + 2 = 6 per... no, candy4 and candy5 give 2 + 1 = 3 for $2 versus chips3's 4, so chips3 is better and the bundle stands.