The Price of Holding Cash

money demand · real money supply · LM curve · money market equilibrium

The central bank of Corrin issues M million crowns of money, and the price level is P (a price index; at P = 2 goods cost twice what they cost in the base year). What matters to households is the real money supply M / P: how many base-year goods the money could buy.

People want to hold more money when they buy more (output Y, millions of base-year crowns per year), and less when holding money means giving up interest on bonds. Real money demand is

L = k \, Y - h \, r

where r is the interest rate as a fraction (5 % is 0.05). The money market is in equilibrium when M / P = L. For each output, the rate that clears the money market traces the LM curve.

Write lm_curve(k, h, M, P, outputs) that returns a tuple (rates, Y_zero):

  • rates: the interest rate that clears the money market at each output in outputs, in the same order. In this problem the formula may give a negative rate; report it as it comes out;
  • Y_zero: the output at which the clearing rate is exactly 0.

Examples

Input:  k = 0.5, h = 4000, M = 1300, P = 2, outputs = [1300, 1700, 2100]
Output: ([0.0, 0.05, 0.1], 1300.0)
Explanation: the real money supply is 1300 / 2 = 650. At Y = 1700 people want
0.5 * 1700 = 850 at a zero rate, 200 more than there is, so r rises until
4000 * r = 200: r = 0.05.

Input:  k = 0.5, h = 4000, M = 1300, P = 2.5, outputs = [1000, 1700]
Output: ([-0.005, 0.0825], 1040.0)
Explanation: higher prices shrink the real money supply to 520.

Constraints

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

Goals

  • Turn a nominal money supply into a real one by dividing by the price level
  • Solve the money market for the interest rate at each level of output
  • Find the output at which the money market clears at a zero rate
Starting Python…