-
Notifications
You must be signed in to change notification settings - Fork 1
Exam 16
Exercise 16. Consider the following bimatrix game:
close all;
clear;
clc;
matlab.lang.OnOffSwitchState = 1;
This game is two-person non-cooperative game where the sets of pure strategies are finite, hence the sets of mixed stratergies are
16.3 Evaluate the gap function at the point (x, y), where x = (1/3, 2/3) and y = (1/4, 3/4), in order to check if it is a Nash equilibrium.
16.4 Plot the polyhedra P and Q related to the game and find all the mixed strategies Nash equilibria.
In game theory, The Karush-Kuhn-Tucker conditions are a set of necessary conditions for an optimization problem with contraints to have a solution.
syms x1 x2 x3 y1 y2 y3 mu1 mu2
C1 = [9 7 3
8 4 1
5 3 2];
C2 = [8 3 1
9 6 5
1 4 2]';
row_player = [x1
x2
x3];
column_player = [y1
y2
y3];
p = m*n*3 + 2;
equations = [];
for i = 1:m
equations = [ equations
C1(i,:) * (column_player) + mu1 >= 0
row_player(i) >= 0
row_player(i)*(C1(i,:) * (column_player) + mu1) == 0];
end
for i = 1:n
equations = [ equations
C2(i,:) * (row_player) + mu2 >= 0
column_player(i) >= 0
column_player(i)*(C2(i,:) * (row_player) + mu2) == 0];
end
equations = [ equations
row_player(1) + row_player(2) + row_player(3) == 1
column_player(1) + column_player(2) + column_player(3)== 1 ]
variables = [x1, x2, x3, y1, y2, y3, mu1, mu2]
[x1, x2, x3, y1, y2, y3, mu1, mu2] = solve(equations,variables)
Output