#!/usr/local/bin/maple # -*- maplev -*- # Nathaniel Shar # HW 19 # Experimental Mathematics # It is okay to link to this assignment on the course webpage. ############# # Problem 1 # ############# # If A cooperates, she gets payoff Ry + S(1-y). If she defects, she # gets payoff Ty + P(1-y). Cooperating is at least as good as # defecting iff Ry + S(1-y) >= Ty + P(1-y) [1]. Solving for y, we see # that if y(R-T-S+P) >= (P-S), then A can "rationally" # cooperate. Similarly, if y(R-T-S+P) <= (P-S), then A can # "rationally" defect. # Of course the exact same formula (with x replacing y) is correct for # Player B. ############# # Problem 2 # ############# # Are we supposed to assume that both players use the same payoff matrix? # It's not completely clear from the problem description. # If we do not assume that, we have to introduce new names # Ra, Sa, Ta, Pa and Rb, Sb, Tb, Pb for the various payoffs for player # A and B, respectively. # Now, there are several cases. First, there is the case when # cooperating is a (non-strictly) dominant strategy for # A. This happens when Ra >= Ta and Sa >= Pa. In that case, a Nash # equilibrium occurs at [1,1] if Rb >= Tb, and at [1,0] if Rb <= Tb. # Similarly, if defecting is a dominant strategy for A (which happens # when Ra <= Ta and Sa <= Pa), then a Nash equilibrium occurs at [0,1] # if Rb >= Tb, and at [0,0] if Rb <= Tb. # Similar results occur when B has a dominant strategy. # If neither player has a dominant strategy then (R-T-S+P) can't be # zero so the nash equilibrium occurs at the mixed strategy # [(Pb-Sb)/(Rb-Tb-Sb+Pb), (Pa-Sa)/(Ra-Ta-Sa+Pa)]. ############# # Problem 3 # ############# #From c19.txt: #BRA(A,y): The Best Response for A to B's decision to #cooperate with prob. y BRA:=proc(A,y) local x, PayOff,v: v:=[A[1][1]*y+A[1][2]*(1-y), A[2][1]*y+A[2][2]*(1-y)]: PayOff:=v[1]*x+v[2]*(1-x): if coeff(PayOff,x,1)>0 then RETURN(1, subs(x=1,PayOff)): elif coeff(PayOff,x,1)<0 then RETURN(0, subs(x=0,PayOff)): else RETURN(x,PayOff): fi: end: #BRB(B,x): The Best Response for B to A's decision to #cooperate with prob. x BRB:=proc(B,x) local y, PayOff,v: v:=[B[1][1]*x+B[2][1]*(1-x), B[1][2]*x+B[2][2]*(1-x)]: PayOff:=v[1]*y+v[2]*(1-y): if coeff(PayOff,y,1)>0 then RETURN(1, subs(y=1,PayOff)): elif coeff(PayOff,y,1)<0 then RETURN(0, subs(y=0,PayOff)): else RETURN(y,PayOff): fi: end: # It seems to be right.