# Equilibrium, Price Floor, and Price Support

These exercises relate directly to the material in the text. Use the
functions below.

fpprintprec:5$ ratprint:false$
[DQ(p,a,E):=a*p^E,    DP(q,a,E):=(q/a)^(1/E)];
[SQ(p,b,c):=b+c*p,    SP(q,b,c):=(q-b)/c];

Insert the set of parameter values [a0, E0, b0, c0] : [1200, -2.5, -5, 10].
Use find_root( ) to 

/*Input. Execute (ctrl-enter) for results */
[a0, E0, b0, c0] : [1200, -2.5, -5, 10]$  
qE0: find_root(DP(q,a0,E0)-SP(q,b0,c0),q,.001,500);

Confirm that when q = qE0, the heights of the demand curve and the supply
curve are the same. Assign one of these two the name pE0.

/*Input. Execute (ctrl-enter) for results */ 
DP(qE0, 1200, - 2.5);  SP(qE0, -5, 10);

Create an expression named eqline that has these characteristics:
for q < qE0, p = pE0; for q>= qE0, p = 0.

/*Input. Execute (ctrl-enter) for results */ 
eqline : if q < qE0 then pE0 else 0;

Graph the demand curve, the supply curve, and eqline.

/*Input. Execute (ctrl-enter) for results */ 
 wxdraw2d( yrange =   [0, 2.0*pE0],  
 ylabel = "$ per unit", 
 xlabel="Quantity: units per time period", 
 line_type=dots, key = "Equilibrium p and q",
 explicit (eqline,q,0,1.05*qE0),
 line_width=2,line_type=solid, key="Demand",
 explicit(DP(q,a0,E0),q,0,1.5*qE0), color=red,
 key = "Supply", explicit(SP(q,b0,c0),q,0,1.5*qE0) )$

Create a price floor be setting p > pE0. Name that nonequilibrium
price pNE. Determine the quantity demanded, qNED, and the 
quantity supplied, qNES given this nonequilibrium price.

/*Input. Execute (ctrl-enter) for results */ 
multiple : 1.25$       pNE : multiple*pE0;
[qNED, qNES]:[DQ(pNE,a0,E0),SQ(pNE,b0,c0)];

Create value maxq, which is the larger of the two quantities
defined above. Use this value to control the graph below.

/*Input. Execute (ctrl-enter) for results */ 
maxq : max(qNED, qNES);

Copy the graph above and show the excess supply that this
price floor generates.

/*Input. Execute (ctrl-enter) for results */ 
wxdraw2d(yrange=[0,2.5*pE0], ylabel="$ per unit",
 xlabel= "Quantity in units per time period",
 line_width=2,key="Demand", explicit (DP(q, a0, E0),
 q, .001, 1.25*maxq),key="Supply", color = red,  
 explicit(SP(q, b0, c0), q, 0, 1.25*maxq),point_size = 2, 
 points_joined=true,
 color=black,line_type=dots,line_width=1,key=
"Excess Supply", points([qNED,qNES],[pNE,pNE]),
  /* 
     The next two points( ) commands are not required 
  */
 key="", points([ [qNED,0],[qNED,pNE]]),
         points([ [qNES,0],[qNES,pNE]])
  )$

Suppose that the government purchases and costlessly destroys
the excess quantity. What is the tax cost of the program?

/*Input. Execute (ctrl-enter) for results */ 
TaxCost : pNE*(qNES - qNED);

A second cost of the program described above is the lost 
Consumer Surplus due to the program. Integrate  DP( ) - price
twice to determine how much Consumer Surplus falls.

/*Input. Execute (ctrl-enter) for results */ 
float(integrate(DP(q,a0,E0)-pE0,q,0,qE0) -
      integrate(DP(q,a0,E0)-pNE,q,0,qNED));

Partially offsetting these costs is the gain to sellers. 
Integrate the relevant expressions to determine how much
the sellers gain from this program.

/*Input. Execute (ctrl-enter) for results */ 
float(integrate(pNE - SP(q,b0,c0),q,0,qNES)) -
float(integrate(pE0 - SP(q,b0,c0),q,0,qE0));

Consider a price support program in which the government 
establishes the price pNE and pays sellers the difference
between the new market price and pNE. Determine (1) the 
cost to taxpayers, (2) the gain to buyers of this good,
and (3) the gain to sellers of this good.

/*Input. Execute (ctrl-enter) for results */ 
/*
Supply determines the quantity; demand determines the price 
*/
newP : DP(qNES,a0,E0);
taxCost: (pNE - newP)*qNES;

Answer (continued)
Buyers gain about 15.779.

/*Input. Execute (ctrl-enter) for results */ 
float(integrate(DP(q,a0,E0)-newP,q,0,qNES) - 
      integrate(DP(q,a0,E0)-pE0,q,0,qE0)     );

Answer (continued)
Sellers gain the same as under the previous program.

/*Input. Execute (ctrl-enter) for results */ 
float(integrate(pNE - SP(q,b0,c0),q,0,qNES)) -
float(integrate(pE0 - SP(q,b0,c0),q,0,qE0));

Answer (continued)
Taxpayers lose more than buyer and sellers gain.

/*Input. Execute (ctrl-enter) for results */ 
64.712 - (15.779 + 41.642);