NAME

Game::Theory::TwoPersonMatrix - Analyze a 2 person matrix game

VERSION

version 0.1201

SYNOPSIS

use Game::Theory::TwoPersonMatrix;
my $g = Game::Theory::TwoPersonMatrix->new();
$g = Game::Theory::TwoPersonMatrix->new(
   1 => { 1 => 0.2, 2 => 0.3, 3 => 0.5 },
   2 => { 1 => 0.1, 2 => 0.7, 3 => 0.2 },
   payoff => [ [ 0, 1,-1],
               [-1, 0, 1],
               [ 1,-1, 0] ]
};
$g->expected_payoff();
$g->counter_strategy($player);
$p = $g->saddlepoint();
$g->row_reduce();
$g->col_reduce();

DESCRIPTION

A Game::Theory::TwoPersonMatrix analyzes a two person matrix game of player names, strategies and utilities.

The players must have the same number of strategies, and each strategy must have the same size utility vectors as all the others.

Players 1 and 2 are the "row" and "column" players, respectively. This is due to the tabular format of a matrix game:

                 Player 2
                 --------
        Strategy 0.5  0.5
Player |   0.5    1   -1  < Payoff
   1   |   0.5   -1    1  <

The above is the default - a symmetrical zero-sum game.

METHODS

new()

$g = Game::Theory::TwoPersonMatrix->new();
$g = Game::Theory::TwoPersonMatrix->new(
   1 => { 1 => '0.5', 2 => '0.5' },
   2 => { 1 => '0.5', 2 => '0.5' },
   payoff => [ [1,0],
               [0,1] ]
);

Create a new Game::Theory::TwoPersonMatrix object.

expected_payoff()

$g->expected_payoff();

Return the expected payoff value of the game.

s_expected_payoff()

$g = Game::Theory::TwoPersonMatrix->new(
   1 => { 1 => '(1 - p)', 2 => 'p' },
   2 => { 1 => 1, 2 => 0 },
   payoff => [ ['a','b'], ['c','d'] ]
);
$g->s_expected_payoff();

Return the expected payoff expression for a non-numeric game.

Using real payoff values, we solve the resulting expression for p in the eg/ examples.

counter_strategy()

$g->counter_strategy($player);

Return the counter-strategies for a given player.

saddlepoint()

$v = $g->saddlepoint;

If the game is strictly determined, the saddlepoint is returned. Otherwise undef is returned.

oddments()

Return each player's "oddments" for a 2x2 game.

row_reduce()

Reduce a game by identifying and eliminating strictly dominated rows.

col_reduce()

Reduce a game by identifying and eliminating strictly dominated columns.

SEE ALSO

"A Gentle Introduction to Game Theory"

http://www.amazon.com/Gentle-Introduction-Theory-Mathematical-World/dp/0821813390

http://books.google.com/books?id=8doVBAAAQBAJ

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Gene Boggs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.