Macaulay2 » Documentation
Packages » GameTheory :: randomGame
next | previous | forward | backward | up | index | toc

randomGame -- construct a game of a given format with arbitrary payoffs

Description

The list $Di$ represents the format of the game. This example creates a random game of format $2 \times 2$.

i1 : X = randomGame({2,2});
i2 : peek X#0

o2 = Tensor{coefficients => QQ                         }
            format => {2, 2}
            indexes => {{0, 0}, {0, 1}, {1, 0}, {1, 1}}
                      3
            {1, 0} => -
                      4
                      7
            {1, 1} => -
                      4
                      9
            {0, 0} => -
                      2
                      9
            {0, 1} => -
                      4
i3 : peek X#1

o3 = Tensor{coefficients => QQ                         }
            format => {2, 2}
            indexes => {{0, 0}, {0, 1}, {1, 0}, {1, 1}}
                       7
            {0, 1} => --
                      10
                       7
            {1, 0} => --
                      10
                      7
            {0, 0} => -
                      9
                      7
            {1, 1} => -
                      3

The optional argument CoefficientRing allows to change the ring of payoffs. If no coefficient choice is specified, the payoffs will be rational numbers. This example creates a random game of format $2 \times 2$ with integer coefficients.

i4 : X = randomGame({2,2}, CoefficientRing => ZZ);
i5 : peek X#0

o5 = Tensor{{0, 0} => 6                                }
            {0, 1} => 0
            {1, 0} => 2
            {1, 1} => 6
            coefficients => ZZ
            format => {2, 2}
            indexes => {{0, 0}, {0, 1}, {1, 0}, {1, 1}}
i6 : peek X#1

o6 = Tensor{{0, 0} => 9                                }
            {0, 1} => 3
            {1, 0} => 5
            {1, 1} => 6
            coefficients => ZZ
            format => {2, 2}
            indexes => {{0, 0}, {0, 1}, {1, 0}, {1, 1}}

Outputs of this function can be used as input for the functions nashEquilibriumIdeal, spohnMatrices, spohnIdeal and konstanzMatrix.

See also

Ways to use randomGame:

  • randomGame(List) (missing documentation)

For the programmer

The object randomGame is a method function with options.


The source of this document is in GameTheory.m2:1620:0.