load(draw)$ 
set_draw_defaults(draw_realpart=false)$
 fpprintprec:5$ ratprint:false$kill(all)$

# Price-Searcher Markets

Three types of markets consist for firms whose output affects the firm's
(or firms') product price. We refer to these as price-searcher markets, 
for the firm must search for the profit-maximizing price.

The simplest type of such a market is the monopoly, in which the market
is served by a single firm, and in which no entry occurs. A second type
is monopolistic competition, in which each of many firms sells a 
slightly distinctive product, but in which entry can occur as long as 
profits are to be earned. 

In both of these cases, the firm ignores the effect of is output on the 
other firms' behavior. In the first case, no other firms exist. In the 
second case, no firm is large enough to significantly affect the price. 

This chapter treats these two cases. The next chapter addresses oligopoly, 
in which a few firms constitute the industry. In this case we must model 
the effect that each firm has on the decisions of other firms. 

## Monopoly

## Upward-sloping Marginal Revenue

## Monopolistic Competition

Monopolistic competition occurs when two conditions hold: firms are relatively 
small price-takers that sell slightly differentiated products, and entry can 
occur whenever profits exist. (Differentiation might involve location rather 
than product specifications.)

This section considers three cases: an industry in which all firms 
are identical and costs are independent of the number of firms, an industry
in which all firms are identical and costs depend on the number of firms
in the industry, and an industry in which each firm's costs are unique and 
do not depend on the number of firms in the industry.

### A Constant-Cost Industry

For simplicity, we specify a cost function tc=ac=1 when x=1.(That 
is, we specify money units and physical quantity units to generate
this result.) Also mc = x^c, so the marginal cost curve exhibits
constant elasticity. (When c = 1, the marginal cost is linear, mc = x; 
when c = 0, marginal cost is constant, mc = 1.

kill(all)$assume(c+1>0)$    mc(x,c):=x^c$
VC: integrate(mc(x, c), x)$
tc(x, c) := ''(ratsimp(subst(x=1,1 - VC))) + VC$
ac(x,c):=''(ratsimp(tc(x,c)/x))$       matrix(
  ["MC","Variable Cost","Total Cost","Average Cost"], 
  [mc(x, c), VC, ratsimp(tc(x, c)), ac(x, c)]);

The added cell illustrates the results when c = 1/2. Total cost, average
cost, and marginal cost all equal 1.0. Average variable cost = total 
variable cost = 2/3, so fixed cost = 1/3.

subst([c=1/2,x=1],[mc(x,c),VC,tc(x,c),ac(x,c)]);

Free entry and exit imply that price - ac(x,c) must equal zero. The
next cell formalizes this condition. The function for profit, named
zeroP because we find parameter values that generate zero profits,
is a function of c; of the demand parameters A and a; and of the 
number of firms, n. 

The nature of the determination of pavg, the average price, is explored below.

zeroP(n,pavg,A,a,c):=''(pavg-ac(x,c));

The next cell derives the inverse demand (price) expression and the
marginal revenue expression from the demand curve that faces the
individual firm. We use a constant-elasticity specification. 

The parameters of the demand curve are these: 
(1) the constant A; 
(2) a, the response if all firms' price move together; and
(3) b, the effect on the firm's quantity demanded of a one-unit deviation 
of the firm's price from the industry average.

x(p,n,A,a,b,pavg):=A*pavg^a*(1/n-b*(p-pavg))$  solve(
  x(p, n, A, a, b,pavg) - x,p)$  p(x,n,A,a,b,pavg):=''(rhs(%[1]))$ 
mr(x,n,A,a,b,pavg):=''(ratsimp(diff(p(x,n,A,a,b,pavg)*x,x)))$
transpose(matrix(["Demand","Price","Marginal Revenue"],
  [x(p,n,A,a,b,pavg),p(x,n,A,a,b,pavg),mr(x,n,A,a,b,pavg)]));

The next figure shows a demand curve and the associated marginal revenue 
curve for a set of parameter values, along with the average and marginal
cost curves. This illustration does not represent equilibrium, because
the 10 firms in the industry earn profits. 

[n0,A0,a0,b0,pavg0,c0]:[10,15,-0.25,0.5,1.2,0.5]$
wxdraw2d(yrange=[0,2],xlabel="x",ylabel="$ per unit",
 line_type=dots,points_joined=true,
 points([[0,1],[1,1],[1,0]]),line_type = solid,
 line_width=2,key="Average Cost and Marginal Cost",
 explicit(mc(x,c0),x,0,2),key = "",explicit(ac(x,c0),x,0,2),
 color=red,key = "Demand and Marginal Revenue",
 explicit(p(x,n0,A0,a0,b0,pavg0),x,0,2),key="",
 explicit(mr(x,n0,A0,a0,b0,pavg0),x,0,2) )$

The graph suggests the second of the three conditions for equilibrium: 
Each firm must produce the quantity at which its marginal revenue 
equals its marginal cost. The expression $xeq$ states that condition 
as an implicit equation of x and pavg.

solve(mr(x,n,A,a,b,pavg)= mc(x, c), x);
xeq(x, n, pavg, A, a, b, c) := ''(x - rhs(%[1]));

The third condition for equilibrium is that the individual output
decisions must add up: n*x = A*pavg^a. This expression is to be solved 
for n.

Xeq(x,n,pavg,A,a):=n*x-A*pavg^a;

### Equilibrium

mnewton( ) provides equilibrium values of x, n, and pavg. The table also 
shows each of the identical firms' price and average cost. Both p1 and 
ac1 must equal pavg if equilibrium is attained.

load(mnewton)$
mnewton([Xeq(x,n,pavg,A0, a0), xeq(x,n,pavg,A0,a0,b0,c0),
zeroP(n,pavg,A0,a0,c0)], [x, n, pavg], [1, 15, 1] )$
[x1,n1,pavg1]:[rhs(%[1][1]),rhs(%[1][2]),rhs(%[1][3])]$
p1:p(x1,n1,A0,a0,b0,pavg1)$     matrix(
  ["x1","n1","pavg","p1","mr1","mc1","ac1"],[x1,n1,pavg1,
   p1,mr(x1,n1,A0,a0,b0,pavg1), mc(x1,c0), ac(x1,c0)]);

### Efficiency

The table above contains evidence of two sources of 
inefficiency: 
(1) p > mc, signaling deadweight loss due to 
underproduction.  
(2) mc < ac implies that economies of scale are not fully exploited. 

The next cell shows the deadweight loss due to underproduction 
(p > mc)  in each firm along with the consumer surplus generated by 
each firm's production.

xeff1:find_root(p(x,n1,A0,a0,b0,pavg1)-mc(x,c0),
  x,0.0001,2)$    dwl1:float(integrate(
  p(x,n1,A0,a0,b0,pavg1)-mc(x,c0),x,x1,xeff1 ))$
cs1:float(integrate(p(x,n1,A0,a0,b0,pavg1)-p1,x,0,x1))$
matrix(["Efficient x","cs","dwl"],[xeff1,cs1,dwl1]);

For all firms the deadweight loss is $0.162.

n1*dwl1;

Minimum cost production occurs when each firm produces at the minimum
point on it ac curve, i.e., at x = 1. Therefore, n1 = x1 would yield 
minimum industry cost. Instead, industry cost equals n1*ac1, so that
cost is $0.164, or about 9.6%, higher than if x1 = n1.

TC1:n1*ac(x1,c0)*x1$ 
minTC1:n1*x1$ /*For all firms */
excesscost1:TC1-minTC1$
matrix(["Cost", "Minimum Cost", "Excess Cost"], 
    [TC1, minTC1, excesscost1]);

The graph below illustrates equilibrium in this industry. The vertical 
scale is exaggerated. The graph shows why no firm can produce x = 1: 
The price for which each firm can sell this output rate is below 
average cost.

wxdraw2d(yrange = [0.75,1.25],xlabel = "x",
 ylabel="$ per unit",line_type=dots,points_joined=true,
 points([[0,p1],[x1,p1],[x1,0]]),line_type = solid, 
 line_width=2,key="Average Cost and Marginal Cost", 
 explicit(mc(x, c0), x, 0, 2), key = "", 
 explicit(ac(x, c0),x,0,2),line_width=2,
 key ="Demand and Marginal Revenue",color=red,
 explicit(p(x,n1, A0,a0,b0, pavg1),x,0,2), key = "",
 explicit(mr(x,n1,A0,a0,b0,pavg1), x, 0, 2),
 dimensions=[640,480]  )$

The demand facing any one firm is much more elastic than the market demand
for this product.

matrix(["Demand elasticity for each firm's product -",
  diff(x(p, n1,A0,a0,b0,pavg1),p)*p1/x1]);

### Effects of Market Size

The cell below shows that increasing demand (replacing A0 with 2*A0) 
results in a price decrease. Now each firm's output increases from
0.814 to 0.891, so the firms more fully exploit economies of scale.

mnewton([Xeq(x,n,pavg,2*A0,a0),xeq(x,n,pavg,2*A0,a0,b0,c0),
  zeroP(n,pavg,2*A0,a0,c0)], [x, n, pavg], [1, 30, 1])$
[x2, n2, pavg2]:[rhs(%[1][1]),rhs(%[1][2]),rhs(%[1][3])]$
p2: p(x2, n2,2*A0,a0,b0,pavg2)$   matrix(
 ["x1","x2","p1","p2","n1","n2"],[x1,x2,p1,p2,n1,n2]);

### An Increasing-Cost Industry