#OK to post #Rebecca Embar, 2-11-2022, Homework 7 #2 TypeCounts22 := proc(K1,K2) local i,G,l,purenash: if K1 > 10000000 then l := [0,0,0,0]: purenash := {[0,0],[1,0],[0,1],[1,1]}: for i from 1 to K2 do G := RG(2,2,K1): #Exactly one pure if nops(purenash intersect MNE22(G)) = 1 then l[1] := l[1]+1: fi: if nops(purenash intersect MNE22(G)) = 2 then #Two pure no mixed if nops(MNE22(G) minus purenash) = 0 then l[2] = l[2]+1 fi: #Two pure one mixed if nops(MNE22(G) minus purenash) = 1 then l[4] = l[4]+1 fi: fi: #No pure and one mixed if nops(purenash intersect MNE22(G)) = 0 and nops(MNE22(G)) = 1 then l[3] := l[3]+1: fi: end: return evalf(l/K2): fi: return FALSE: end: #I think this program works since I ran it on smaller values of K2 and it outputted #correct-looking data, but it took too long to run for K1=10^8 and K2=10000 #3 #5 PayoffG:=proc(G,p1,p2) local x,i,j: if add(x,x in p1)=1 and add(x,x in p2)=1 then return add(x,x in seq(seq(p1[i]*p2[j]*G[i][j],j=1..nops(G[1])),i=1..nops(G))); fi: return FALSE: end: