Four harbour towns on the same coast share the capital exponent alpha (0 < \alpha < 1) and the depreciation rate delta, but each has its own productivity A, saving rate s, workforce growth n (fractions: 2 % is 0.02) and current capital per worker k0. Each follows the Solow model: output per worker is y_t = A\,k_t^{\alpha} and
k_{t+1} = k_t + s\,y_t - (\delta + n)\,k_t
Each town i heads for its own steady state k_i^* = \left(s_i A_i / (\delta + n_i)\right)^{1/(1-\alpha)}, with steady-state income y_i^* = A_i\,(k_i^*)^{\alpha}.
countries is a list of tuples (name, A, s, n, k0). Write rank_towns(alpha, delta, countries) that returns a tuple of two lists of names:
- the towns ordered by steady-state output per worker y^*, highest first;
- the towns ordered by the growth rate of output per worker from year 0 to year 1, y_1 / y_0 - 1, highest first.
In both lists, towns with exactly equal values are listed in alphabetical order of name.
Examples
Input: alpha = 0.5, delta = 0.05,
countries = [("Ardel", 1, 0.2, 0.05, 1), ("Bosk", 1, 0.3, 0.01, 12),
("Cerra", 1.2, 0.1, 0.03, 0.5), ("Dorn", 0.9, 0.25, 0.02, 1)]
Output: (["Bosk", "Dorn", "Ardel", "Cerra"], ["Dorn", "Ardel", "Cerra", "Bosk"])
Explanation: steady-state incomes are 5, 2.89, 2 and 1.8. Cerra is the poorest today
(y0 = 0.85) yet grows more slowly (4.39 %) than Ardel (4.88 %): it is close to its
own low steady state. Dorn grows fastest (7.47 %): it is furthest below its own.
Input: alpha = 0.3, delta = 0.06,
countries = [("Zell", 1, 0.2, 0.01, 2), ("Yarrow", 1, 0.2, 0.01, 2)]
Output: (["Yarrow", "Zell"], ["Yarrow", "Zell"])
Explanation: identical towns tie, so alphabetical order decides.
Constraints
- names are distinct
Goals
- Compute each economy's steady-state income from its own parameters
- Compute each economy's growth rate of output per worker in the coming year
- See that growth depends on the distance to an economy's own steady state, not on how poor it is