(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 7807, 259]*) (*NotebookOutlinePosition[ 8882, 296]*) (* CellTagsIndexPosition[ 8838, 292]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{Cell[TextData["Game Theory"], "Title", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Hal Varian\nJanuary 1992"], "Subsubtitle", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["Computing Nash equilibria"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Computing Nash equilibria in a two-person game is a straightforward but \ tedious task. This is the kind of thing computers were made for. Luckily \ John Dickhaut and Todd Kaplan of the University of Minnesota have written a \ Mathematica package to solve for Nash equilibrium in two-person games. Let's \ load it into Mathematica and try it on a few examples from the text."], "Text",\ Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["<<~/", AspectRatioFixed->True], StyleBox["Mathematica", AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["/MicroAn/Nash.m", AspectRatioFixed->True] }], "Input", AspectRatioFixed->True], Cell[TextData["?Nash"], "Input", AspectRatioFixed->True], Cell[TextData["Nash[{{{2,1},{0,0}},{{0,0},{1,2}}}]"], "Input", AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["Dominated strategies example"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Nash[{{{3,3},{0,3},{0,0}},\n {{3,0},{2,2},{0,2}},\n \ {{0,0},{2,0},{1,1}}}]"], "Input", AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData["Chicken"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Nash[{{{-3,-3},{2,0}},\n {{0,2 },{1,1}}}]"], "Input", AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData["Coordination game"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Nash[{{{2,2},{-1,-1}},\n {{-1,-1},{1,1}}}]"], "Input", AspectRatioFixed->True]}, Open]]}, Open]], Cell[CellGroupData[{Cell[TextData["Solving for Bayes-Nash equilibria"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["We can use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" to solve the differential equation that arises in the text.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["DSolve[V'[b]*(V[b]-b) == V[b],V[b],b]"], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "We can use the same analysis to solve the symmetric game for other prior \ probability distribution on ", Evaluatable->False, AspectRatioFixed->True], StyleBox["v", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[". Let ", Evaluatable->False, AspectRatioFixed->True], StyleBox["P[v]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[" = probability that other player's valuation is less than ", Evaluatable->False, AspectRatioFixed->True], StyleBox["v", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[". The payoff to the first player if he bids ", Evaluatable->False, AspectRatioFixed->True], StyleBox["b", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[" is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["(v-b)P[V[b]]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox["; ", Evaluatable->False, AspectRatioFixed->True], StyleBox["b", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[ " must maximize this expression which yields the first-order condition ", Evaluatable->False, AspectRatioFixed->True], StyleBox["(v-b)P'[V[b]]*V'[b] - P[V[b]] = 0", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[". We can use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " to solve this differential equation, just as above. Suppose, for \ example, that ", Evaluatable->False, AspectRatioFixed->True], StyleBox["P[v]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[" is the exponential CDF", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["P[v_] := 1-E^(-v)"], "Input", AspectRatioFixed->True], Cell[TextData["The equation we want to solve is then"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["DSolve[(V[b]-b)*P'[V[b]]*V'[b] -P[V[b]]==0,V[b],b]"], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ " doesn't know how to solve this ODE, so we try a numerical solution. ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "solution=NDSolve[{(V[b]-b)*P'[V[b]]*V'[b] -P[V[b]]==0,\n \ V[0]==.001},V[b],\n {b,.001,.9}]"], "Input", AspectRatioFixed->True], Cell[TextData["Plot[Evaluate[V[b]/.solution],{b,.001,.9}]"], "Input", AspectRatioFixed->True], Cell[TextData[ "[Note: their appears to be a singularity at b=1. I'm not quite sure why, \ but I suspect that there is something funny about this solution. I should \ look at it in more detail, and probably choose a better behaved example.]"], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]]}, Open]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 640}, {0, 460}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 365}, WindowMargins->{{28, Automatic}, {Automatic, 31}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, Magnification->1.5, MacintoshSystemPageSetup->"\<\ AVU/IFiQKFD000000V8nh09RAj0000000OXQ<097PXP0AP1Y06`0I@1^0642HSkP 0V97`0000001nR4@0TN2R000000000000000009R?^0000000000000000000000 00000000000000000000000000000000\>" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 86, 2, 70, "Title", Evaluatable->False], Cell[1820, 55, 105, 2, 70, "Subsubtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[1948, 59, 102, 2, 70, "Section", Evaluatable->False], Cell[2053, 63, 456, 8, 70, "Text", Evaluatable->False], Cell[2512, 73, 240, 9, 70, "Input"], Cell[2755, 84, 58, 1, 70, "Input"], Cell[2816, 87, 88, 1, 70, "Input"], Cell[CellGroupData[{ Cell[2927, 90, 108, 2, 70, "Subsection", Evaluatable->False], Cell[3038, 94, 139, 3, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3209, 99, 87, 2, 70, "Subsection", Evaluatable->False], Cell[3299, 103, 100, 1, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3431, 106, 97, 2, 70, "Subsection", Evaluatable->False], Cell[3531, 110, 100, 1, 70, "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[3672, 113, 110, 2, 70, "Section", Evaluatable->False], Cell[3785, 117, 409, 14, 70, "Text", Evaluatable->False], Cell[4197, 133, 90, 1, 70, "Input"], Cell[4290, 136, 2287, 82, 70, "Text", Evaluatable->False], Cell[6580, 220, 70, 1, 70, "Input"], Cell[6653, 223, 111, 2, 70, "Text", Evaluatable->False], Cell[6767, 227, 103, 1, 70, "Input"], Cell[6873, 230, 342, 12, 70, "Text", Evaluatable->False], Cell[7218, 244, 163, 3, 70, "Input"], Cell[7384, 249, 95, 1, 70, "Input"], Cell[7482, 252, 304, 6, 70, "Text", Evaluatable->False] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)