Max in every row and column in bimatrix game

I want to find the maximum value in each column by comparing only the first elements (-8 and 10) and (0 and -1) and maximum value in each row by comparing only the second elements {-8 and -10) and (0 and -1).Apparent (-8,-8) is the cell where are the max in both cases.So i want this result.I do not know how to do it with a matrix of this kind so I split the matrix into two A={{-8,0},{-10,-1}}and B={{-8,-10},{0,-1}} and I found max Relust is {0,-8} {0,-8} but i want to show {-8,-8} and if possible you do not have to separate the matrix like this.

• I find it hard to grasp what you want. Please be more precise. For example: What do you want to find? A value as you said or a position? Nov 28, 2018 at 17:41
• Nash equilibria, such as the ones discussed here, are reported according to positions, not payoffs. The correct answer is not {-8,-8} but {1,1}. Nov 28, 2018 at 22:57

(* payoff matrix: *)
payoff = {{{-8, -8}, {0, -10}}, {{-10, 0}, {-1, -1}}}
(* player 1 payoffs: *)
p01 = Map[First, payoff, {2}]
(* conditional best moves for player 1: *)
moves01 = Last /@ Ordering /@ Transpose[p01]
(* conditional payoffs for player 1: *)
payoffs01 = Extract[p01, MapIndexed[{#1, First@#2} &, moves01]]


I improved upon the answer by @Alan to show Player 2's responses and the coordinates of the equilibria (joint maxima). For a 2*3 (i,j) matrix,

payoff = {{{-8, -8}, {0, -10}}, {{-10, 0}, {-1, -1}}, {{-12, 0}, {1, 1}}};
p01 = Map[First, payoff, {2}];
p02 = Map[First, RotateLeft[payoff, {0, 0, -1}], {2}];
moves01 = Last /@ Ordering /@ Transpose[p01]
moves02 = Last /@ Ordering /@ p02
eq = Flatten /@ Table[If[{moves01[[i]], i} == {j, moves02[[j]]},{moves01[[i]], i}, Nothing],
{i, 1, 2}, {j, 1, 3}]


The output is the optimal moves for each player and the position of the equilibria in the matrix.

{1, 3}

{1, 1, 2}

{{1, 1}, {3, 2}}

The code does NOT take into account indifference (two equal maximum values in each column). It will report only one.

The payoffs at equilibria are given by (apologies for elegance)

Table[Extract[payoff, eq[[i]]], {i, 1, 2}]


{{-8, -8}, {1, 1}}

• When I run this code Table[Extract[payoff, eq[[i]]], {i, 1, 2}], it gives me these mistakes Part::partd: Part specification eq[[1]] is longer than depth of object. >>Extract::psl: Position specification eq[[1]] in Extract[{{{-8,-8},{0,-10}},{{-10,0},{-1,-1}},{{-12,0},{1,1}}},eq[[1]]] is not an integer or a list of integers. >>Part::partd: Part specification eq[[2]] is longer than depth of object. >> and I do not know how to fix them. Could this be for my version Wolfram mathematica 8.0? Nov 29, 2018 at 18:30
• add eq= before the line Flatten/@etc. Nov 29, 2018 at 19:04
• I did it but again, such a mistake and no result. Nov 29, 2018 at 19:21
• You are supposed to use both the first and the second block of code I provide, not just the last single line. I just tested it and it works fine. Nov 29, 2018 at 19:23