#BR is the procedure that entry the matrix of n players with m avaliable decisions they #have, and output the best payoff for k player BR:=proc(M,m,n,k) local rec1,rec,champs,champs1,A,B,i,j: A:=nops(M): B:=nops(M[1]): if not (1<=j and j<=B) then print(j, `is not a valid strategy for k player`): RETURN(FAIL): fi: champs:={1}: rec:=M[1][j][k]: for i from 1 to A do #first we get the best choice of each matrix and then we compare each matrix to get the #best choice for j player for h from 2 to B do if M[i][h][k]>rec then champs1:={h}: rec1:=M[i][h][k]: elif M[i][h][k]=rec1 then champs:=champus union {h}: fi: od: if M[i][j][k]>rec1 then champs:={i}: rec1:=M[1+m^(j-3)][j][k]: elif M[1+m^(j-3)][j][k]=rec then champs:=champs union {i}: fi: od: #We return the set of Champions champs: end: PNEn:=proc(M,m,n,k,j) local A,B,i,h,S: A:=nops(M): B:=nops(M[1]): S:={}; end: