Write a MATLAB function that performs the reduce-by-dominance method. The functi
ID: 3538651 • Letter: W
Question
Write a MATLAB function that performs the reduce-by-dominance method. The function takes a payoff matrix of any size as an input, performs the method, and results a reduced payoff matrix as an output if the input is reducible. For instance, if the payoff matrix is 3x3, the function should compare the 1st row to 2nd and 3rd, 2nd to 3rd, 1st column to 2nd and 3rd, and 2nd to 3rd. This will be repeated until there is no either a row or column that dominates another. (Note: You should use loops.)
The instructor was kind enough to give us a starting point:
function [result_matrix] = reduce_by_dominance(payoff_matrix)
%payoff_matrix -> input
%result_matrix -> reduced matrix
%first store the size of the matrix
rows = size(payoff_matrix,1);
cols = size(payoff_matrix,2);
%Now check for dominant rows
for i=1:rows-1,
for j=i+1:rows,
temp_row1 = payoff (i,:);
temp_row2 = payoff (j,:);
What do we need to do next???
Definition of Reduction by Dominance
One row dominates another if every element in the row is greater than or equal to the corresponding element in the other. In other words, one row dominates another if it is always at least as good for the row player.
One column dominated another if every element in the column is less than or equal to the corresponding element in the other. In other words, one column dominates another if it is always at least as good for the column player.
Explanation / Answer
function [result_matrix] = reduce_by_dominance(payoff_matrix)
%payoff_matrix -> input
%result_matrix -> reduced matrix
%first store the size of the matrix
rows = size(payoff_matrix,1);
cols = size(payoff_matrix,2);
%Now check for dominant rows
for i=1:rows,
for j=i:rows,
if(payoff_matrix(i,:)>payoff_matrix(j,:)
%delete the dominated row
payoff_matrix(j,:) = [];
end;
end;
end;
%Now check for dominant columns
for i=1:cols,
for j=i:cols,
if(payoff_matrix(:,i)<payoff_matrix(:,j)
%delete the dominated column
payoff_matrix(:,j) = [];
end;
end;
end;
result_matrix = payoff_matrix;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.