When the Harvest Fails

aggregate supply · aggregate demand · supply shock · short-run equilibrium · quadratic equation

In Ardley a bad harvest can raise firms' costs. Output Y is in millions of base-year crowns per year, the interest rate r is a fraction (5 % is 0.05), T is a fixed tax, G government purchases, M the money supply (fixed) and P the price level. Demand comes from IS-LM:

  • goods market: output equals planned spending, Y = C + I + G, with consumption C = c_0 + c_1 \, (Y - T) and investment I = i_0 - i_1 \, r;
  • money market: the real money supply equals real money demand, \dfrac{M}{P} = k \, Y - h \, r.

For each price level these give one output: the aggregate demand (AD). Supply in the short run follows the short-run aggregate supply (SRAS) line

P = P_e + a \, (Y - Y_n) + z

Pe is the price level firms expected when they set their prices, Y_n is natural output (what the economy produces when prices turn out as expected), a >= 0 says how strongly prices rise when output runs above Y_n, and z is a supply shock added to prices (positive when costs rise, negative when they fall, 0 for none). In this problem the model has no floor on r or I.

Write short_run(e, Pe, a, Y_n, z) that returns a tuple (Y, P): the output and the positive price level at which AD and SRAS hold together. The economy's own e["P"] is not used.

The tests build each economy with the helper economy(c0, c1, T, i0, i1, G, k, h, M, P), which returns the dict {"c0": c0, "c1": c1, "T": T, "i0": i0, "i1": i1, "G": G, "k": k, "h": h, "M": M, "P": P}; you may use it too.

Examples

Input:  e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), Pe = 2, a = 0.002, Y_n = 1700, z = 0
Output: (1700.0, 2.0)
Explanation: at P = 2 demand is 1700 (the IS-LM equilibrium), and at Y = 1700 the
SRAS line gives P = 2 + 0 + 0 = 2.

Input:  e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), Pe = 2, a = 0.002, Y_n = 1700, z = 0.3
Output: (1644.0971508067066, 2.188194301613413)
Explanation: the shock pushes prices up; the higher P shrinks real money and demand,
and the lower output pulls part of the price rise back.

Input:  e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), Pe = 2, a = 0, Y_n = 1700, z = 0.5
Output: (1570.0, 2.5)

Constraints

  • answers are compared with a tolerance of 1e-6; do not round

Goals

  • Combine an aggregate demand curve from IS-LM with a short-run aggregate supply line
  • Solve the resulting equation for the price level and pick the economically meaningful root
  • Trace how a supply shock raises prices and lowers output at the same time
Starting Python…