Sub topic 5
Comparative advantage: who gives up less
This chapter assumes you already know three things from earlier in the tutorial. The first is opportunity cost, the value of the best alternative you give up when you choose something. The second is absolute advantage, the ability to produce more of a good with the same inputs. The third is how a straight-line production possibilities frontier (PPF) gets its slope. Here you will turn those ideas into one test: who has the comparative advantage in which good.
The definition
A producer has a comparative advantage in a good when its opportunity cost of making that good is lower than another producer's opportunity cost of making the same good.
Absolute advantage compares output: who makes more per hour, per worker-day, or per acre. Comparative advantage compares what each producer sacrifices. The sacrifice is measured in the other good, so you cannot read it off a single column of the table. You need both goods for both producers.
An absolute advantage is a statement about one good. A comparative advantage is a statement about a pair of goods and a pair of producers.
Computing opportunity cost from an output table
Suppose each producer works for one day and can make the following amounts if they spend the whole day on one good.
| Producer | Wheat per day | Cloth per day |
|---|---|---|
| X | 10 | 5 |
| Y | 4 | 4 |
X is better at both goods, so X has an absolute advantage in both. Now compute what each unit costs in terms of the other good.
If X spends a day on wheat, it gives up 5 cloth to get 10 wheat. One wheat therefore costs 5 / 10 = 0.5 cloth. The same logic gives the cost of one cloth: 10 / 5 = 2 wheat.
The general rule for a straight-line PPF is:
- Opportunity cost of good A, measured in good B = (output of B) / (output of A).
- Opportunity cost of good B, measured in good A = (output of A) / (output of B), which is the reciprocal.
The two costs are reciprocals of each other because they describe the same trade-off along the same straight line from opposite directions. This code does the calculation for both producers.
# Output per worker-day for two producers, X and Y.
output_per_day = {
"X": {"wheat": 10, "cloth": 5},
"Y": {"wheat": 4, "cloth": 4},
}
for name, o in output_per_day.items():
cost_of_wheat = o["cloth"] / o["wheat"] # cloth given up per unit of wheat
cost_of_wheat_unused = None
cost_of_cloth = o["wheat"] / o["cloth"] # wheat given up per unit of cloth
print(name, "1 wheat costs", cost_of_wheat, "cloth;", "1 cloth costs", cost_of_cloth, "wheat")
# Output:
# X 1 wheat costs 0.5 cloth; 1 cloth costs 2.0 wheat
# Y 1 wheat costs 1.0 cloth; 1 cloth costs 1.0 wheatCompare the producers one good at a time.
| Good | X's opportunity cost | Y's opportunity cost | Lower cost |
|---|---|---|---|
| Wheat | 0.5 cloth | 1.0 cloth | X |
| Cloth | 2.0 wheat | 1.0 wheat | Y |
X has the comparative advantage in wheat, and Y has it in cloth. Y is worse at both goods in absolute terms, yet Y still has a comparative advantage in cloth. That is the central result of the chapter.
Why a producer who is worse at everything still has one
Y is not good at cloth. Y is just less bad at cloth than at wheat, relative to X. X is 2.5 times as productive in wheat (10 against 4) but only 1.25 times as productive in cloth (5 against 4). X's edge is large in wheat and small in cloth.
Every day X spends making cloth means giving up wheat, where its edge is biggest. Every day Y spends making wheat means giving up cloth, where its relative position is best. So the resources are used best when X makes the wheat and Y makes the cloth.
The comparison of ratios is what matters. Compare the productivity ratios directly:
- Wheat: X / Y = 10 / 4 = 2.5
- Cloth: X / Y = 5 / 4 = 1.25
The good with the larger ratio is the one where X has the comparative advantage (wheat). The good with the smaller ratio is where Y has it (cloth).
The reciprocal property
With two goods and two producers, comparative advantage always splits cleanly, unless the costs are exactly equal. The reason is that the cost of cloth is the reciprocal of the cost of wheat for each producer.
Take X's cost of wheat, 0.5, and Y's, 1.0. X's is lower. Take reciprocals to get the costs of cloth: X's becomes 2.0 and Y's becomes 1.0. Taking reciprocals reverses the order, so X's cost is now higher. If X has the lower cost in one good, it must have the higher cost in the other. Neither producer can hold the comparative advantage in both goods.
This is why an absolute advantage in everything does not mean a comparative advantage in everything.
A decision procedure
Here is the same procedure as a function. It uses Fraction so that equal costs are detected exactly, without floating-point rounding.
from fractions import Fraction
def comparative_advantage(output, good_a, good_b):
"""Return which producer has the lower opportunity cost of each good.
output maps producer name -> {good: units per day}. Exactly two producers.
A value of None means the two costs are equal.
"""
(p, o_p), (q, o_q) = output.items()
result = {}
for good, other in ((good_a, good_b), (good_b, good_a)):
cost_p = Fraction(o_p[other], o_p[good]) # units of `other` given up per unit of `good`
cost_q = Fraction(o_q[other], o_q[good])
if cost_p < cost_q:
result[good] = p
elif cost_q < cost_p:
result[good] = q
else:
result[good] = None
return result
xy = {"X": {"wheat": 10, "cloth": 5}, "Y": {"wheat": 4, "cloth": 4}}
xz = {"X": {"wheat": 10, "cloth": 5}, "Z": {"wheat": 4, "cloth": 2}}
print(comparative_advantage(xy, "wheat", "cloth"))
print(comparative_advantage(xz, "wheat", "cloth"))
# Output:
# {'wheat': 'X', 'cloth': 'Y'}
# {'wheat': None, 'cloth': None}In the second case Z is exactly 40% as productive as X in both goods. Both producers face the same trade-off, so neither has a comparative advantage. Z is worse in absolute terms, but there is nothing to gain by reallocating production between them.
A second example outside production
The same logic applies to people and their time. A lawyer can write 1 legal brief in an hour or type 120 pages. An assistant can type 60 pages in an hour or write 0.1 of a brief, since the assistant is not trained for it.
| Person | Cost of typing 1 page (in briefs) |
|---|---|
| Lawyer | 1 / 120, about 0.0083 |
| Assistant | 0.1 / 60, about 0.0017 |
The lawyer is better at typing in absolute terms (120 pages against 60). But the lawyer gives up about five times as much legal work per typed page. The assistant has the comparative advantage in typing, and the lawyer has it in briefs. Lawyers who do their own typing are not being efficient, even if they type faster than anyone they could hire.
Comparative advantage is pairwise
Comparative advantage depends on who you compare against. Add a third producer, W, who makes 6 wheat or 2 cloth per day.
| Producer | Cost of 1 wheat (in cloth) | Cost of 1 cloth (in wheat) |
|---|---|---|
| X | 0.5 | 2.0 |
| Y | 1.0 | 1.0 |
| W | about 0.33 | 3.0 |
Against Y, X has the comparative advantage in wheat (0.5 is below 1.0). Against W, X does not: W's cost of wheat, about 0.33, is lower than X's 0.5. W is worse than X at both goods in absolute terms (6 against 10 wheat, 2 against 5 cloth), but W has the comparative advantage in wheat over X.
With more than two producers, you cannot say that a producer "has" a comparative advantage in a good without saying compared to whom. The sensible way to read the table is as a ranking. Sort the producers by their cost of each good, and the cheapest ones are the natural suppliers of that good. Here the ranking for wheat, lowest cost first, is W, X, Y. The ranking for cloth is Y, X, W.
The same holds with more than two goods. Each producer has a cost for every good, and the ranking comes from comparing those costs, one pair of goods at a time.
Common errors
Dividing the wrong way. The cost of wheat in cloth is cloth output divided by wheat output. If you divide wheat by cloth, you get the cost of cloth in wheat, and the comparison flips. Write the units down ("cloth per wheat") before you compare.
Comparing output instead of cost. Saying "X has the advantage in wheat because it produces 10 against 4" is an absolute-advantage statement. It would also be true of cloth. It gives no way to assign goods.
Concluding that the weaker party has nothing to offer. A producer with lower output in every good still has a comparative advantage in one of them, unless the ratios are exactly equal.
Treating ties as an advantage. If both producers have the same ratio, as in the X and Z case, neither has a comparative advantage and specialising brings no gain.
Mixing inputs. The table must use the same input for each producer, such as one worker-day or one hour. If X's column is per day and Y's is per week, the costs are meaningless until you convert them.
Forgetting what the calculation assumes. The shortcut of dividing outputs only works when the opportunity cost is constant, which means the PPF is a straight line. If costs rise as you make more of a good, the cost depends on where you are on the frontier. Later chapters return to that limit.
Summary of the method
- Put the output per unit of input for each producer and good in a table.
- For each producer, divide the output of the other good by the output of the good you are pricing. That gives the cost in the other good.
- Compare the costs for the same good across producers.
- The producer with the lower cost has the comparative advantage in that good.
- With two goods and two producers, the other producer has it in the other good, unless the costs are equal.
Exercise
Producer A makes 12 bushels of corn or 6 tonnes of coal per day. Producer B makes 3 bushels of corn or 2 tonnes of coal per day. (a) Find each producer's opportunity cost of a bushel of corn, in tonnes of coal. (b) Who has the absolute advantage in each good? (c) Who has the comparative advantage in each good?
Show answer
(a) A gives up 6 / 12 = 0.5 tonnes of coal per bushel. B gives up 2 / 3, about 0.67 tonnes. (b) A has the absolute advantage in both goods, since 12 > 3 and 6 > 2. (c) A's cost of corn (0.5) is lower than B's (0.67), so A has the comparative advantage in corn. The costs of coal are the reciprocals: A gives up 2 bushels, B gives up 1.5 bushels. B's is lower, so B has the comparative advantage in coal.
Exercise
Producer C makes 8 shirts or 4 hats per day. Producer D makes 6 shirts or 3 hats per day. Does either have a comparative advantage? What does that imply for specialisation?
Show answer
C's cost of a shirt is 4 / 8 = 0.5 hats. D's cost of a shirt is 3 / 6 = 0.5 hats. The costs are equal, so neither has a comparative advantage. C is better at both goods in absolute terms, but because the trade-offs match, reallocating production between them creates no gain from specialising.
Exercise
A senior engineer can write 4 design documents or review 20 pull requests per day. A junior engineer can write 1 design document or review 10 pull requests per day. Who should do the reviews, and why is the senior's higher absolute output in reviews not the deciding factor?
Show answer
The senior gives up 4 / 20 = 0.2 documents per review. The junior gives up 1 / 10 = 0.1 documents per review. The junior's cost is lower, so the junior has the comparative advantage in reviews and the senior has it in design documents (cost of a document: senior 5 reviews, junior 10 reviews). The senior reviews faster in absolute terms (20 against 10), but each review costs the senior more design work.