Equilibrium output in Marrowby (millions of crowns per year) satisfies
Y = c_0 + c_1 \, (Y - T) + I + G
with a fixed tax T, planned investment I, government purchases G and a marginal propensity to consume c1 with 0 <= c1 < 1. The treasury wants equilibrium output to equal target, and it may pull one lever:
"G": change government purchases by some amountx;"T": change taxes by some amountx;"both": change purchases and taxes by the same amountx, so the budget balanceT - Gstays as it is.
Write lever(c0, c1, I, G, T, target, tool) that returns the change x that moves equilibrium output exactly to target (negative for a cut). Return None if no change of the chosen lever can do it: if the lever has no effect on output (even when output is already at the target), or if the change needed would make purchases or taxes negative (ending exactly at 0 is allowed).
Examples
Input: c0 = 80, c1 = 0.75, I = 120, G = 150, T = 120, target = 1200, tool = "G"
Output: 40.0
Explanation: output is now (80 - 90 + 120 + 150) / 0.25 = 1040, so it must rise by 160;
each crown of purchases raises it by 4.
Input: c0 = 80, c1 = 0.75, I = 120, G = 150, T = 120, target = 1200, tool = "T"
Output: -53.333333333333336
Input: c0 = 80, c1 = 0.75, I = 120, G = 150, T = 120, target = 1500, tool = "T"
Output: None
Explanation: the tax cut needed, 153.33, is more than the 120 collected.
Constraints
- answers are compared with a tolerance of
1e-6; do not round
Goals
- Turn a desired change in output into the policy change that produces it
- Use the spending, tax and balanced-budget multipliers side by side
- Detect policy changes that are impossible in the model