Below is a program that will provide you with a practically infinite number of two player games. To start, click the new game button below. This will give you a new two-by-two game with each of the players payoffs.

Using this program you will be able to test your understanding of the following topics:

Simultaneous Games

Best responses for each player

Finding dominant strategies

Finding pure strategy Nash Equilibria

Find mixed strategy Nash Equilibria

Sequential Games (assume player A is the leader)

Drawing the extensive form

Finding the Nash equilibria

For the mixed strategy game:

Let p be the probability that player A plays top.

Let q be the probability that player B plays left.

Once you finish solving for each of these outcomes, click the box next to them to see the correct answer. Once you finish the problem and check your work, click new game and you can start a new problem.

Manipulate[Module[{ADTL,ADTR,AD,BDTL,BDBL,BD,NETL,NETR,NEBL,NEBR,NE,AEF,BEF,qO,pO,AMS,BMS},
ADTL=If[ATL>=ABL,1,0];
ADTR=If[ATR>=ABR,1,0];
AD=If[ADTL==1&&ADTR==1,"Top",If[(ADTL==0||ATL==ABL)&&(ADTR==0||ATR==ABR),"Bottom","None"]];
BDTL=If[BTL>=BTR,1,0];
BDBL=If[BBL>=BBR,1,0];
BD=If[BDTL==1&&BDBL==1,"Left",If[(BDTL==0||BTL==BTR)&&(BDBL==0||BBL==BBR),"Right","None"]];
NETL=If[ADTL==1&&BDTL==1,1,0];
NETR=If[ADTR==1&&(BDTL==0||BTL==BTR),1,0];
NEBL=If[(ADTL==0||ATL==ABL)&&BDBL==1,1,0];
NEBR=If[(ADTR==0||ATR==ABR)&&(BDBL==0||BBL==BBR),1,0];
AEF=If[ATL*BDTL+ATR*(1-BDTL)>=ABL*BDBL+ABR*(1-BDBL),"Top","Bottom"];
BEF=If[AEF=="Top",BDTL*"Left"+(1-BDTL)*"Right",BDBL*"Left"+(1-BDBL)*"Right"];
qO=If[BD=="Left",1,If[BD=="Right",0,N[q/.Last@Solve[ATL*q+ATR(1-q)==ABL*q+ABR*(1-q),q]]]];
pO=If[AD=="Top",1,If[AD=="Bottom",0,N[p/.Last@Solve[BTL*p+BBL(1-p)==BTR*p+BBR(1-p),p]]]];
AMS=If[ATL*(1.01qO)+ATR(1-(1.01qO))>ABL*1.01qO+ABR*(1-1.01qO),1,0];
BMS=If[BTL*(1.01pO)+BBL(1-(1.01pO))>BTR*1.01pO+BBR*(1-1.01pO),1,0];
NE=DeleteCases[If[AD=="None"&&BD=="None",{NETL*{"Top","Left"},NETR*{"Top","Right"},NEBL*{"Bottom","Left"},NEBR*{"Bottom","Right"}},If[AD=="Top",{NETL*{"Top","Left"},NETR*{"Top","Right"}},If[AD=="Bottom",{NEBL*{"Bottom","Left"},NEBR*{"Bottom","Right"}},If[BD=="Left",{NETL*{"Top","Left"},NEBL*{"Bottom","Left"}},If[BD=="Right",{NETR*{"Top","Right"},NEBR*{"Bottom","Right"}}]]]]],{0,0}];
Grid[{{Style["Simultaneous Game: Pure Strategy",Bold,Large],SpanFromLeft},{Grid[{{"","",Style["Player B",ColorData[97][1]],SpanFromLeft,SpanFromLeft,SpanFromLeft},{"","","Left",SpanFromLeft,"Right",SpanFromLeft},{Style["Player A",ColorData[97][2]],"Top",Style[ATL,ColorData[97][2],If[BR==1&&(ADTL==1),{Underlined,Bold},ColorData[97][2]]],Style[BTL,ColorData[97][1],If[BR==1&&(BDTL==1),{Underlined,Bold},ColorData[97][1]]],Style[ATR,ColorData[97][2],If[BR==1&&(ADTR==1),{Underlined,Bold},ColorData[97][2]]],Style[BTR,ColorData[97][1],If[BR==1&&(BDTL==0||BTL==BTR),{Underlined,Bold},ColorData[97][1]]]},{SpanFromAbove,"Bottom",Style[ABL,ColorData[97][2],If[BR==1&&(ADTL==0||ATL==ABL),{Underlined,Bold},ColorData[97][2]]],Style[BBL,ColorData[97][1],If[BR==1&&(BDBL==1),{Underlined,Bold},ColorData[97][1]]],Style[ABR,ColorData[97][2],If[BR==1&&(ADTR==0||ATR==ABR),{Underlined,Bold},ColorData[97][2]]],Style[BBR,ColorData[97][1],If[BR==1&&(BDBL==0||BBL==BBR),{Underlined,Bold},ColorData[97][1]]]}},Frame->{None,None,{{{3,3},{3,4}}->Thick,{{4,4},{3,4}}->Thick,{{3,3},{5,6}}->Thick,{{4,4},{5,6}}->Thick}},Spacings->{1, 1}],Grid[{{Style["Dominant Strategies:",Bold,Medium],Style["Pure Strategy Nash Equilibria:",Bold,Medium]},{If[DS==1,TextGrid[{{"Player A:",AD},{"Player B:",BD}}],""],If[NEI==1,NE,""]}},Frame->{None,None,{{{1,2},{1,1}}->True,{{1,2},{2,2}}->True}}]},{},{},{Style["Simultaneous Game: Mixed Strategy",Bold,Large],SpanFromLeft},If[MS==1,If[AD=="Top"||AD=="Bottom",{TextGrid[{{StringJoin["Because player A has a dominant strategy, they will play ",AD," with certainty (p=",ToString[If[AD=="Top",1,0]],")."]} ,{StringJoin["This implies that player B will play ",If[AD=="Top",BDTL*"Left"+(1-BDTL)*"Right",BDBL*"Left"+(1-BDBL)"Right"]," with certainty (q=",ToString[If[AD=="Top",BDTL*1+(1-BDTL)*0,BDBL*1+(1-BDBL)0]],")"]}}]},If[BD=="Left"||BD=="Right",{TextGrid[{{StringJoin["Because player B has a dominant strategy, they will play ",BD," with certainty (q=",ToString[If[BD=="Left",1,0]],")."]} ,{StringJoin["This implies that player A will play ",If[BD=="Left",ADTL*"Top"+(1-ADTL)*"Bottom",ADTR*"Top"+(1-ADTR)"Bottom"]," with certainty (p=",ToString[If[BD=="Left",ADTL*1+(1-ADTL)*0,ADTR*1+(1-ADTR)0]],")"]}}]},{TextGrid[{{"Player A's expected pay-off from playing top:",ATL*q+ATR*(1-q)},{"Player A's expected pay-off from playing bottom:",ABL*q+ABR*(1-q)},{"Player A must be indifferent between playing top and bottom:" ,ATL*q+ATR*(1-q)==ABL*q+ABR*(1-q)},{"Therefore the optimal q for player B to choose is:",StringJoin["q'=",ToString[qO]]},{If[ATL*(1.01qO)+ATR(1-(1.01qO))>ABL*1.01qO+ABR*(1-1.01qO),"If q>q', player A should always choose top because it yields a higher payoff","If q>q', player A should always choose bottom because it yields a higher payoff"],SpanFromLeft}}],TextGrid[{{"Player B's expected pay-off from playing left:",BTL*p+BBL*(1-p)},{"Player B's expected pay-off from playing right:",BTR*p+BBR*(1-p)},{"Player B must be indifferent between playing left and right:" ,BTL*p+BBL*(1-p)==BTR*p+BBR*(1-p)},{"Therefore the optimal p for player A to choose is:",StringJoin["p'=",ToString[pO]]},{If[BTL*(1.01pO)+BBL(1-(1.01pO))>BTR*1.01pO+BBR*(1-1.01pO),"If p>p', player B should always choose left because it yields a higher payoff","If p>p', player B should always choose right because it yields a higher payoff"],SpanFromLeft}}]}]],{}],If[MS==1&&AD=="None"&&BD=="None",{Show[{Plot[-1,{x,0,1},PlotRange->{{-.025,1.1},{-0.025,1.1}},AxesLabel->{"p","q"}],Graphics[{ColorData[97][2],Thick,Line[{{0,qO},{1,qO}}],Line[{{AMS,qO},{AMS,1}}],Line[{{1-AMS,qO},{1-AMS,0}}],ColorData[97][1],Dashed,Line[{{pO,0},{pO,1}}],Line[{{pO,BMS},{1,BMS}}],Line[{{0,1-BMS},{pO,1-BMS}}]}]},ImageSize->Medium],SpanFromLeft},{}],{},{},{Style["Sequential Game: Player A is Leader",Bold,Large],SpanFromLeft},{If[EF==1,TreeGraph[{Labeled[1,Placed[Style["Player A",ColorData[97][2]],Above]],Labeled[2,Placed[Style["Player B",ColorData[97][1]],Before]],Labeled[3,Placed[Style["Player B",ColorData[97][1]],After]],Labeled[5,Placed[Style[{Style[ATL,ColorData[97][2]],Style[BTL,ColorData[97][1]]},Bold,Medium],Below]],Labeled[4,Placed[Style[{Style[ATR,ColorData[97][2]],Style[BTR,ColorData[97][1]]},Bold,Medium],Below]],Labeled[6,Placed[Style[{Style[ABL,ColorData[97][2]],Style[BBL,ColorData[97][1]]},Bold,Medium],Below]],Labeled[7,Placed[Style[{Style[ABR,ColorData[97][2]],Style[BBR,ColorData[97][1]]},Bold,Medium],Below]]},{Labeled[1\[DirectedEdge]2,Style["Top",Bold,Medium]],Labeled[1\[DirectedEdge]3,Style["Bottom",Bold,Medium]],Labeled[2\[DirectedEdge]4,Style["Right",Bold,Medium]],Labeled[2\[DirectedEdge]5,Style["Left",Bold,Medium]],Labeled[3\[DirectedEdge]6,Style["Left",Bold,Medium]],Labeled[3\[DirectedEdge]7,Style["Right",Bold,Medium]]},ImageSize->Medium],""],If[EF==1,TextGrid[{{Style["Nash Equilibrium:",Bold,Medium],AEF,BEF}}]]}}]],
Button["New Game",{ATL=RandomInteger[{-20,20}],ATR=RandomInteger[{-20,20}],ABL=RandomInteger[{-20,20}],ABR=RandomInteger[{-20,20}],BTL=RandomInteger[{-20,20}],BTR=RandomInteger[{-20,20}],BBL=RandomInteger[{-20,20}],BBR=RandomInteger[{-20,20}],BR=0,DS=0,NEI=0,MS=0,EF=0}],Delimiter,Style["Answers",Bold],{{BR,0,"Best Response"},{0,1}},{{DS,0,"Dominant Strategies"},{0,1}},{{NEI,0,"Nash Equilibria"},{0,1}},{{MS,0,"Mixed Strategy"},{0,1}},{{EF,0,"Extensive Form"},{0,1}}]