Beruflich Dokumente
Kultur Dokumente
ec98e2.doc
Also, there are many approaches to use of computer. I pick up here three
approaches. The first is to make the computer programs to solve your economic problem.
The second is to use the economic simulation programs which are programmed by the
authorized programmers. The third is to use the spread sheet programs and/or the
econometric analysis programs including the statistical ones for your economic
problems.
1/36
98/12/30
ec98e2.doc
the accompanied
software to Stiglitz,J., Economics(W.W. Norton & Company, 1993). They are highly
evaluated and have large learning effectiveness for the students because the software
are made of the multimedia tools.
The second type of software is the economic simulation program for the students.
There are many software, too. I only pick up the software of Prof. Lovell(1995,1996)
explained later in 3.9. They are very interested in and are helpful to the learners
of economics.
The third type of software can help learners to understand economics by using
simulation and/or estimating the economic relationships on the actual data. Of course,
the second type of software have this character in common. There are many software
which covers programs of the introductory economics to econometric tools for
economics.
2/36
98/12/30
ec98e2.doc
In this section, we want to get the Cournot equilibrium and the Stackelberg
equilibriuim in duopoly by using Mathematica. As for Cournot model and Stakelberg
model you may consult with such a book as Friedman[1983]. See also Kon, Uzawa and
Yamamoto[1992], Okuno and Suzumura[1988], and Umehara and Hsiao[1997].
3/36
98/12/30
ec98e2.doc
When you exert Mathematica on your platform, you can see the following prompt:
In[1]:=
You may input the market demand curve as follows:
In[1]:= p = a - b (q1+q2)
Then you can see in the screen:
Out[1]= a - b (q1 + q2)
You can omit "Out[.]= " by putting semicolon[;] in the end of input.
The space between b and (q1 + q2) means the product operation of both items
in Mathematica.
Now we consider the case where two firms have identical cost function.
In particular, marginal cost equals average cost, say, m.
In[2]:= c1=m q1
Out[2]= m q1
In[3]:= c2=m q2
Out[3]= m q2
Amount of sales(revenue for firm) is the product of price and quantity produced.
So we can define that the profit equals revenue minus cost.
You can get profit for firm 1(profit1) by following manner:
In[4]:= profit1=p q1 - c1
Out[4]= -(m q1) + q1 (a - b (q1 + q2))
Please use "Simplify" to get the simplest expression.
4/36
98/12/30
ec98e2.doc
In[5]:= Simplify[profit1]
Or you may also use:
In[5]:= Simplify[%]
Out[5]= q1 (a - m - b q1 - bq2)
The "%" means the latest content, namely, profit1.
As for profit for firm 2(profit2) you can get the result by the same manner.
In[6]:= profit2=p q2 - c2
Out[6]= -(m q2) + q2 (a - b (q1 + q2))
Now we want to find the quantity that maximizes her profit given other firm's
quantity. This relationship is called by Cournot's reaction function, or the
best response function in the game theory.
In[7]:= foc ={D[profit1,q1]==0, D[profit2,q2]==0}
Out[7]= {a - m - b q1 - b (q1 + q2) == 0, a - m - b q2 - b (q1 + q2) == 0}
Expression of "D[profit1,q1]==0" means the partial derivative of profit1 with
respect to output q1. It is the first order condition of profit maximization
for firm 1.
The "foc" express both conditions of profit maximization for two firms.
In[8]:=D[profit1,{q1,2}]
Out[8]= - 2 b
Expression of "D[profit1,{q1,2}]" means the twice partial derivatives of
profit1 with respect to output q1. Its value is negative because b is positive
by assumption.
5/36
98/12/30
ec98e2.doc
The profit function of firm 1(profit1) is the concave function of output q1.
We have the profit curve to be convex to the top.
The second order condition for maximization is satisfied in this case.
The same is true for the condition of firm 2.
In[9]:= r1=Solve[foc [[1]],q1][[1]]
a - m - b q2
Out[9]= {q1 -> ------------}
2 b
In[10]:= r2=Solve[foc [[2]],q2][[1]]
a - m - b q1
Out[10]= {q2 -> ------------}
2 b
Expression of "Solve[foc [[1]],q1]" shows you the output q1 which solves the
first part of foc, namely, D[profit1,q1]==0. In effect, we get q1 from the expression
of "a - m - b q1 - b (q1 + q2) == 0".
Please notice that [[1]] attached to the above expression can eliminate the redundant
"{}" from the output expression.
You can get r1 for firm 1's reaction function and r2 for firm 2's
reaction function, respectively.
We define new functions such as reaction1[a,b,m] and reaction2[a,b,m] as
follows;
In[11]:= reaction1[a_,b_,m]:=(a - m - b q2)/(2 b)
In[12]:= reaction1[a,b,m]
a - m - b q2
Out[12]= -----------2 b
6/36
98/12/30
ec98e2.doc
a - m
3 b
a - m
q1 = -----, q2 = ----3 b
3 b
We define the Cournot-Nash equilibrium output for both firms as Q1C[a,b,m] and
Q2C[a,b,m], respectively:
In[16]:= Q1C[a_,b_,m_]:=(a - m)/(3 b)
In[17]:= Q1C[a,b,m]
a - m
Out[17]= ----3 b
7/36
98/12/30
ec98e2.doc
8/36
98/12/30
ec98e2.doc
In[25]:= pai2C[a,b,m]
2
(a - m)
Out[25]= -------9 b
Here we collect the Cournot equilibrium(CournotEquilibrium) and the associated
profits for both firms(CournotProfits) as follows:
In[26]:= CournotEquilibrium={Q1C[a,b,m],Q2C[a,b,m],PC[a,b,m]}
a - m
a - m
a + 2 m
3 b
In[27]:= CournotProfits={pai1C[a,b,m],pai2C[a,b,m]}
2
(a - m)
2
(a - m)
9 b
9/36
98/12/30
ec98e2.doc
In[28]:= a=25;b=1;m=1;
In[29]:= RE1=D[profit1,q1]
Out[29]= 24 - 2 q1 -q2
In[30]:= RE2=D[profit2,q2]
Out[30]= 24 - q1 -2 q2
Expression of "RE1 and RE2" shows the marginal profit(= marginal revenue marginal cost) for both firms.
Marginal revenue means the increment(positive or negative) of revenue when
firm can sell one more unit of output. Marginal cost means the increment of
cost when firm can make one more unit of output.
The locus of the points which are equal to zero marginal profit shows the
reaction curve for the firm. You may get the result by using Mathematica.
In[31]:= GrRE1=ContourPlot[RE1,{q1,0,24},{q2,0,24}, Contours->{0},
ContourShading->False, FrameLabel->{q1,q2}]
Out[31]= -ContourGraphicsYou can see the reaction curve(in this case, linear segment) for firm 1
in Figure 1. You may obtain the reaction curve(in this case, linear segment, too)
for firm 2 in Figure 2(See the Figures in Appendix).
In[32]:= GrRE2=ContourPlot[RE2,{q1,0,24},{q2,0,24}, Contours->{0},
ContourShading->False, FrameLabel->{q1,q2}]
Out[32]= -ContourGraphicsGood messages help you understand the graphical representation.
Now we posit the ""C" on the cross of the two reaction curves to represent
the Cournot-Nash equilibrium.
10/36
98/12/30
ec98e2.doc
You can easily obtain the coordinates of the crossing point of two reaction
curves.
In[33]:= Q1C[a,b,m]
Out[33]= {8}
In[34]:= Q2C[a,b,m]
Out[34]= {8}
In this case, the output pair of Cournot-Nash equilibrium is {{8,8}.
You may input the following manner to get representation of "C".
In[35]:= tC=Show[Graphics[Text[C,{8+0.5,8+0.5}]]]
Out[35]= -GraphicsYou can see the "C" a little bit right-upward way to the cross point of two
reaction curves(See the Figure 3 in the Appendix).
In[36]:= tReaction1=Show[Graphics[Text[Firm 1's Reaction Curve,{6,23}]]]
Out[36]= -GraphicsIn[37]:= tReaction2=Show[Graphics[Text[Firm 2's Reaction Curve,{20,3}]]]
Out[37]= -GraphicsNow we can show you the graphical representation of Cournot-Nash equilibrium.
In[38]:= GrCournotE=Show[GrRE1,GrRE2,tC,tReaction1,tReaction2,
PlotLabel->Cournot Equilibrium]
Out[38]= -Graphics-
11/36
98/12/30
ec98e2.doc
You can see the graph of two crossing reaction curves in the Figure 3(See the
Figure 3 in the Appendix).
Next, we show you the isoquant through the Cournot-Nash equilibrium, C.
The isoquant of firm 1 is defined to be the output pair,{q1,q2}, that keeps
the firm 1's profit constant. The same definition applies to the isoquant of firm
2.
You can obtain the isoquant of firm 1 by using Mathematica following ways.
Here we use the option value of 50 as PlotPoints because the default value of
25 shows you the non-smoothed graph of lines.
In[39]:= ISO1C=ContourPlot[profit1,{q1,0,24},{q2,0,24},
Contours->{pai1C[a,b,m]},ContourShading->False,
PlotPoints-> 50, FrameLabel->{q1,q2}]
Out[39]= -ContourGraphicsIn[40]:= ISO2C=ContourPlot[profit2,{q1,0,24},{q2,0,24},
Contours->{pai2C[a,b,m]},ContourShading->False,
PlotPoints-> 50, FrameLabel->{q1,q2}]
Out[40]= -ContourGraphicsWe represent the reaction curves and the isoquant of firm 1 on the same screen.
The gradient of the isoquant of firm 1, D[profit1,q1], takes value of zero on
the point of the firm 1's reaction curve.
The same is true. The gradient of the isoquant of firm 2, D[profit2,q2], takes
value of infinity on the point of the firm 2's reaction curve.
In[41]:= GrCournotISO=Show[Graphics[GrRE1,GrRE2,tC,tReaction1,
tReaction2, ISO1C,ISO2C]
Out[41]= -GraphicsPlease compare the Figure 4 with default value of 25 as PlotPoints with Figure
5 with option value of 50(See the Figures in Appendix). Two profit levels of isoquant
are the same, that is, 64 for both firms.
12/36
98/12/30
ec98e2.doc
Please note that the lower the isoquant of firm 1, the more profit for firm 1.
Also you can see that the lefter the isoquant of firm 2, the more profit for
firm 2.
The output pairs that are in the region enclosed by two isoquants through the
Cournot-Nash equilibrium are preferred by both firms because they can get more profit
than profit in the Cournot-Nash equilibrium, respectively.
For example, if they produce at the output pair,{6,6}, then they get profit of
72=(13-1)*6 ,respectively, because the price for this case is 13=25-(6+6).
Namely, if they could cooperate to produce the output pair,{6,6}, then they
could get the profit pair,{72,72}.
Here you are position to consider the situation.
If your opponent firm produces 6 output, then you can get more profit by producing
9 output instead of the cooperated 6 output. You can check this at once.
Suppose firm 2 produces 6 output.
Now we rewrite the firm 1's profit as rijun1. ["rijun" means profit in Japanese.]
In[42]:= rijun1=profit1/.q2->6
Out[42]= (18 - q1) q1
This is the profit for firm 1.
Now you can get the output that maximizes his profit defined in Out[42].
The first order condition for profit maximization is the following:
In[44]:= D[rijun1,q1]==0
Out[44]= 18 - 2 q1 == 0
To solve for q1 of above equation you may use Solve operation of Mathematica.
In[45]:= Solve[%,q1][[1]]
Out[45]= {q1 -> 9}
You can get 9 output that maximized firm 1's profit if the firm 2 produces
6 output.
13/36
98/12/30
ec98e2.doc
The second order condition for profit maximization is satisfied in the following:
In[46]:= D[rijun1,{q1,2}]
Out[46]= -2
In[47]:= rijun1/.q1->9
Out[47]= 81
You can see that firm 1 gets 81 profit by producing 9 output with deviation
from producing of 6 output. The profit of 81 is larger than the cooperated profit
of 72.
In this case the firm 2's profit, rijun2, is obtained as follows:
In[48]:= rijun2=profit2/.q1->9
Out[48]= (15 - q2) q2
In[49]:= rijun2/.q2-> 6
Out[49]= 54
The profit of 54 is accrued by firm 2.
In summary, if two firms cooperate by producing the output pair,{6,6}, then
they get the profit pair,{72,72}. However, if the opponent firm keep the cooperation
by producing 6 output, then you can get 81 of the profit pair,{81,54} by producing
9 output with deviation from the cooperated 6 output.
There is no incentives to keep the cooperative agreement. However, if both firms
deviate from the cooperative agreement, then they may be only the Courot-Nash
equilibrium and get the profit pair,{64,64}.
This situation is the same as "Prisoner's Dilemma" in the game theory.
14/36
98/12/30
ec98e2.doc
15/36
98/12/30
ec98e2.doc
In[52]:= reaction2[a,b,m]
a - m - b q1
Out[52]= -----------2 b
You can substitute this value as q2 in the expression of firm 1's profit1.
In Mathematica, you may input the following manner, where the profit1S1 means the
firm 1's profit when she is the Leader.
In[53]:= profit1S1=profit1/.q2->reaction2[a,b,m]
a - m - b q1
Out[53]= -(m q1) + q1 (a - b (q1 + ------------))
2 b
In[54]:= Simplify[profit1S1]
q1 (a - m - b q1)
Out[54]= ----------------2
You can get the simplified expression of profit1S1.
Both conditions of profit maximization for two firms are as follows.
Please note that the second order condition for profit maximization is satisfied
for both firms.
In[55]:= focS1={D[profit1S1,q1]==0, foc [[2]]}
b q1
a - m - b q1
2 b
a - m - b q2 - b (q1 + q2) == 0}
16/36
98/12/30
ec98e2.doc
To solve for q1 and q2 from above equations, you may use Solve function in
Mathematica.
In[56]:= S1=Solve[focS1,{q1,q2}][[1]]
a - m
a - m
2 b
17/36
98/12/30
ec98e2.doc
a - m
a + 3 m
4 b
In[68]:= StackelbergS1Profits{pai1S1[a,b,m],pai2S1[a,b,m]}
2
(a - m)
2
(a - m)
16 b
18/36
98/12/30
ec98e2.doc
19/36
98/12/30
ec98e2.doc
Out[72]= -ContourGraphicsAlso you can get firm 2's isoprofit curve in which she gets 36 profit.
In[73]:= ISO2S1=ContourPlot[profit1,{q1,0,24},{q2,0,24},
Contours->{pai2S1[a,b,m]}, ContourShading->False,
PlotPoints-> 50,
FrameLabel->{q1,q2}]
Out[73]= -ContourGraphicsNow you are position to express the Stackelberg equilibrium S1.
In[74]:= tStackelbergS1=Show[Graphics[Text[S1,{Q1S1[a,b,m]+0.5,
Q2S1[a,b,m]+0.5}]]]
Out[74]= -GraphicsYou may overlap the Stakelberg equilibrium onto the graph of Cournot-Nash
equilibrium.
In[75]:= GrStackelberg=Show[GrRE1,GrRE2,tC,tReaction1,tReaction2,
ISO1S1, ISO2S1,tStackelbergS1]
Out[75]= -GraphicsYou can get the Figure 6(See the Figure in Appendix). From this Figure, you have
more information concerning the relationships between the Cournot-Nash equilibrium
and Stackelberg equilibrium.
It is more preferable for firm 1 as Leader in the Stackelberg equilibrium of
profit 72 than the Cournot-Nash equilibrium of profit 64.
It is evident from the fact that the lower isoprofit curve, the more profit for
firm 1. On the other hand, it is more preferable for firm 2 as Follower in the CournotNash equilibrium of profit 64 than the Stackelberg equilibrium of profit 36.
20/36
98/12/30
ec98e2.doc
You can also compare the outputs in both equilibria, C and S1.
The sum of the outputs at the Cournot-Nash equilibrium is 8+8=16.
The sum of the outputs at the Stackelberg equilibrium is 12+6=18.
The price level at the Cournot-Nash equilibrium(25-(8+8)=9) is higher than the
one at the Stackelberg equilibrium(25-(12+6)=7).
21/36
98/12/30
ec98e2.doc
3.3
NetEc
This server has been managed by the MIDAS service of Manchester Computing and has
several mirror sites such as Washington University and Hitotsubashi University.
URL: http://netec.mcc.ac.uk/NetEc.html
The object of NetEc is to proceed to economic research and communications through
the electric means and following 7 activities are conducted by volunteers.
22/36
98/12/30
ec98e2.doc
23/36
98/12/30
ec98e2.doc
Also you may find it interesting in the following site of Economic Resources for K-12
Teachers:
URL: http://ecedweb.unomaha.edu/teach2.htm
These sites are good starting points to learn economics by students as well as
teachers.
24/36
98/12/30
ec98e2.doc
(1)MICRO Monop(MONOP.EXE)
By using this program you can have experience of the simulation in which you are the
monopolist.
(2)MICRO Call(HAND.EXE)
By using this program you may exert classroom experiment such as a uniform price,
or "call" auction.
(3)ESL Double Auction(ESLDA143.EXE)
By using this program you can learn theories of supply and demand and equilibrium
in the network.
(4)Voluntary Contribution Mechanism(VCM110.EXE)
By using this program you can have experience of the investment decision between
private good and public good under the give resources. Because the yield from the
investment of public good is accrued by all member of this game, you can have a strong
incentives for Free Rider.
(5)Normal Form Game(NFG2.EXE)
By using this 2 person game you can learn several concepts in game theory.
25/36
98/12/30
ec98e2.doc
He is a leading scholar in this field in Japan and also encourages young researchers
in Japan in addition to his own contribution to Experimental Economics.
26/36
98/12/30
ec98e2.doc
References:
Asari, Kubo, Ishibashi, and Yamashita[1995],"Mathematica-de keizaigaku
(Learning Economics by using Mathematica)," (1)-(6)Keizai Seminar(Economic
Seminar),(Nihon Hyouronsha,Tokyo),Nos.485-491June-December,1995,
(in Japanese).
27/36
98/12/30
ec98e2.doc
28/36
98/12/30
ec98e2.doc
URL: http://econwpa.wustl.edu/EconFAQ/EconFAQ.html
29/36
98/12/30
ec98e2.doc
[Summary]
Computer Assisted Learning(CAL) in Economics by using Mathematica and Internet
Resources on Economics
By Masaru Uzawa
(Otaru University of Commerce)
Abstract: In this paper we talk about CAL in Economics by using Mathematica and
Internet Resources on Economics. In section 2, we can use Mathematica to obtain the
Cournot Equilibrium and Stackelberg Equilibrium. Both computational operations and
graphical representations in Mathematica can be done so easily. We can understand
the oligopoly theory by using Mathematica. In section 3, we can pick up the Internet
Resources on Economics. Several interested URL(Uniform Resource Locator) are shown.
Please try it. You will find it very interesting and useful.
30/36
98/12/30
ec98e2.doc
31/36
98/12/30
ec98e2.doc
32/36
98/12/30
ec98e2.doc
33/36
98/12/30
ec98e2.doc
34/36
98/12/30
ec98e2.doc
35/36
98/12/30
ec98e2.doc
36/36