to solve in Matlab, we must rearrange the constraints to include v as a variable (right). The game matrix is:
A = [0 -1 1 1; 1 0 -1 1; -1 1 0 1];
b = [0 0 0];
Aeq = [1 1 1 0];
beq = 1;
lb = [0 0 0 -inf]; % here the lower bound of v has not to necessarily zero, but in a general game could be minus infinity.
% Objective function
f = [0 0 0 -1];
% Solve the LP
z = linprog(f,A,b,Aeq,beq,lb);
% Payoff
v = z(4)
% Probability of the variables
x = z(1:3)
v =
0
x =
0.3333
0.3333
0.3333
No comments:
Post a Comment