MatrixGamePlot
MatrixGamePlot[mgame]
generates a plot of the MatrixGame mgame.
MatrixGamePlot[mgame,strat]
highlight the game strategy strat.
更多信息和选项
- MatrixGamePlot is typically used to communicate and understand a matrix game.
- In a two-player game, there is a matrix of payoff vectors. Each vector represents the payoff for each player.
- The following is a plot of a two-player game where payoffs are plotted as charts and colored according to the player:
- Strategies may also be represented by the thickness of the line over each player row or column. The order of the player action is from top to bottom and from left to right:
- When there are multiple players on rows or columns, a row or column is used for each combination for player actions:
- MatrixGamePlot has the same options as Graphics, with the following additions and changes: [所有选项的列表]
-
ColorFunction Automatic how to color payoffs for each player ColorFunctionScaling False whether to scale arguments to ColorFunction GameActionLabels Automatic labels to use for actions GamePlayerLabels Automatic labels to use for players PlotLayout Automatic specifies the layout of squares and rows PlotLegends False legends for payoff values - Possible settings for PlotLayout are:
-
"BarChart" plot each payoff square as a BarChart "SplitSquare" plot each payoff square as a split square {{r1,…,rk},{c1,…,cn-k}} change the row players and column players {"SplitSquare",{{…},{…}}} combine the two previous options - Note that the payoff array may be reshaped to become a matrix with players {r1,…,rk} as row players and {c1,…,cn-k} as column players. For example, if there are five players, the default ordering may divide the first two players ({1,2}) on rows and the three other players ({3,4,5}) on columns. This order may be changed using this option.
所有选项的列表
范例
打开所有单元关闭所有单元基本范例 (4)
Generate a two-player matrix game:
Generate the Prisoner's Dilemma:
Plot the game using split squares:
Show strategies using an array of the same dimensions as the GameActionLabels array:
Scope (5)
Two-Player Games (3)
Options (6)
ColorFunction (1)
Specify the color scheme used as seen in ColorData:
ColorFunctionScaling (1)
GameActionLabels (1)
PlotLayout (1)
Applications (9)
Recreational Games (2)
Rock Paper- Scissors is a zero-sum game, where either one player wins and the other loses, or there is a tie. The plot style "SplitSquare" is best for two-player games:
This plot uses gray for the losing player (lowest value), a vibrant blue or orange for the winning player (highest value) and a pale orange or blue for a tie (average value).
Generalize Rock Paper Scissors to Rock Paper Scissors Fire Water by setting up dominance order using a graph:
Social Games (1)
The Volunteer's Dilemma describes a situation where each player can either volunteer or defect. If at least one player volunteers, all other players marginally benefit from defecting. If no player volunteers, all players have a very low payoff. Generate a Volunteer's Dilemma game with four players:
The best way to visualize most games of more than two players is using the default "Barchart" style. Plot the game:
However, in the "SplitSquare" style, it is not clear what happens to players based on their choices:
A better visualization can be given by isolating a player:
The difference between volunteering and defecting is marginal,except where all players defect:
Prisoner's Dilemma (2)
Consider a Prisoner's Dilemma game:
Consider that each player has a dominating strategy: to defect.
Naturally, the intersection of dominating strategies is a Nash equilibrium:
Consider an Optional Prisoner's Dilemma game:
Attempt to find the Nash equilibria:
As indicated, the number of solutions is infinite, thus requiring further analysis:
The player strategy {0,0,1} is not a dominating strategy, as one may verify:
However, the strategy {{0,0,1},{0,0,1}} is a Nash equilibrium:
Economics Games (3)
Three hungry men go to the restaurant and decide to split the bill evenly before ordering. There are three meal options, Cheap, Mediocre and Expensive. Represent this situation as a MatrixGame:
The Cournot Oligopoly game describes a situation where a group of firms produces the same good. Each firm must consider the production cost and the quantity the other firms are producing. Only the firms with the lowest price sell goods.
Generate a Cournot Oligopoly game:
Find the optimal game strategies in this game:
This is intuitive when considering for all players, the payoffs are largest for the second action:
A price war refers a game where multiple firms have an interest in offering the lowest price, but the payoff of any firm is directly correlated to the price chosen. Consider a price war between three firms where each firm has the choice between a low price and a high price:
Despite the common interest of having the price as high as possible, competition creates a Nash equilibrium at the low price:
Symmetry in Games (1)
An easy way to visualize the symmetry or differences between player payoffs is to plot them using different row and column players. For example, consider the difference between pure coordination and dangerous coordination games. In the former, players have the same payoffs:
If a game is symmetric over players, then any permutation that maintains the shape of the plot should show equivalent payoffs:
文本
Wolfram Research (2025),MatrixGamePlot,Wolfram 语言函数,https://reference.wolfram.com/language/ref/MatrixGamePlot.html.
CMS
Wolfram 语言. 2025. "MatrixGamePlot." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/MatrixGamePlot.html.
APA
Wolfram 语言. (2025). MatrixGamePlot. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/MatrixGamePlot.html 年