Demand & Supply

Given

We work with the following linear functions:

\[Q_{demand}(P) = 100 - 2P, \qquad Q_{supply}(P) = 20 + 3P.\]

Part A — Basic functions (4 points)

\[\min_{P} \; \big| Q_{demand}(P) - Q_{supply}(P) \big|\]

over the interval

\[P \in [p_{min}, p_{max}]\]

with step size step.

The function returns a 4-tuple:

\[\left(P^*, \; Q_{demand}(P^*), \; Q_{supply}(P^*), \; \Delta \right), \qquad \Delta = \big| Q_{demand}(P^*) - Q_{supply}(P^*) \big|.\]

Part B — Equilibrium (2 points)

Determine the equilibrium by calling the function with

\[(p_{\min}, p_{\max}, \text{step}) = (0, \; 100, \; 0.5).\]

Report the values of (P^) and (Q^), where

\[Q^* = \frac{Q_{demand}(P^*) + Q_{supply}(P^*)}{2}.\]

Part C — Equilibrium with tax (4 points)

The government imposes a specific per‑unit tax of

\[t = 2\]

per unit. Producers then effectively receive

\[P_{\text{net}} = P - t\]

and the supply changes to

\[Q_{supply}^{t}(P) = 20 + 3(P - t).\] \[(p_{\min}, p_{\max}, \text{step}) = (0, \; 100, \; 0.5).\]

Report the values of (P^) and (Q_t^) and the total tax revenue (R):

\[R = t \times Q_t^*.\]