The treasury and the central bank of Lisk agree on a plan: reach a target output Y_target while the interest rate stays exactly where it is now. The treasury uses one fiscal tool, either government purchases G or the fixed tax T, and the bank changes the money supply M; the price level P stays fixed. Output Y is in millions of base-year crowns per year and the interest rate r is a fraction (5 % is 0.05):
- 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.
The IS-LM equilibrium is the one pair (Y, r) that clears both markets. The economy e is in its equilibrium now.
Write policy_mix(e, Y_target, tool) where tool is "G" or "T". Return a tuple (d_fiscal, dM): the change in G (or in T) and the change in M that together make the new equilibrium output Y_target with the same interest rate as now. If the plan would leave G or T below zero, or M at zero or below, return None.
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), Y_target = 1900, tool = "G"
Output: (50.0, 200.0)
Explanation: now (Y, r) = (1700, 0.05). With r and so investment fixed, 50 more of G raises
output by 50 / 0.25 = 200. Money demand at (1900, 0.05) is 950 - 200 = 750, so the real
money supply must rise by 100: M rises by 200.
Input: e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), Y_target = 1900, tool = "T"
Output: (-66.66666666666667, 200.0)
Input: e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), Y_target = 2300, tool = "T"
Output: None
Explanation: the tax would have to fall by 200, below zero.
Constraints
- answers are compared with a tolerance of
1e-6; do not round
Goals
- Find the fiscal change that moves output by a given amount when the rate does not move
- Find the money supply change that keeps the rate where it was
- Reject plans that would need negative purchases, taxes or money