Skip to content

Commit

Permalink
Merge pull request #1 from instadeepai/temp/test-workflow
Browse files Browse the repository at this point in the history
docs: add background on matrix games
  • Loading branch information
arnupretorius authored Sep 4, 2023
2 parents e101684 + 4a81670 commit 5c5e048
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests_linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
os: [ubuntu-latest]

steps:
- name: Checkout matrax
- name: Checkout matrax 😎
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand All @@ -27,4 +27,4 @@ jobs:
- name: Run coverage
run: |
coverage html --directory=coverage_html_report
coverage report --fail-under=0.97
coverage report --fail-under=0.97
25 changes: 25 additions & 0 deletions docs/games/background.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Matrix Games

Matrix games are a type of two-player, zero-sum game in game theory. In these games, each player has a set of strategies, and the outcomes are determined by a matrix of payoffs or utilities. The most common type of matrix game is a 2x2 matrix, where each player has two strategies. Here's a general description:

1. Players: There are two players in a matrix game, often referred to as Player A and Player B.

2. Strategies: Each player has a set of strategies they can choose from. In a 2x2 matrix game, each player typically has two strategies, labeled as Strategy 1 and Strategy 2.

3. Payoff Matrix: The core of the matrix game is the payoff matrix, which specifies the payoffs or utilities that each player receives for each combination of strategies chosen by both players. The matrix is usually presented as follows:

- Player A's Strategies
- Player B's Strategies

| | Strategy 1 | Strategy 2 |
|--------|------------|------------|
| Strategy 1 | (A1, B1) | (A2, B2) |
| Strategy 2 | (A3, B3) | (A4, B4) |

In this matrix, (A1, B1), (A2, B2), (A3, B3), and (A4, B4) represent the payoffs or utilities for Player A and Player B, depending on the strategies they choose. Player A's payoff is listed first, and Player B's payoff is listed second.

4. Objective: The objective of each player is to select a strategy that maximizes their own payoff while considering the choices made by the other player.

5. Nash Equilibrium: In matrix games, Nash equilibrium is a critical concept. It is a situation where neither player has an incentive to unilaterally change their strategy, given the strategy chosen by the other player. In a 2x2 matrix game, Nash equilibrium can often be identified by analyzing the payoffs.

Depending on the specific payoffs in the matrix, different strategies may emerge as dominant or Nash equilibrium strategies. Game theorists analyze these games to predict how rational players might behave and what outcomes are likely to occur.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
black==22.3.0
coverage
flake8==3.9.2
importlib-metadata<5.0
isort==5.11.5
mypy==0.991
pre-commit==2.17.0
pytest==7.0.1
pytest-cov
pytest-parallel
pytest-xdist
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _get_version() -> str:
keywords="matrix-games python jax",
packages=setuptools.find_packages(),
python_requires=">=3.8",
install_requires=_parse_requirements("requirements.txt"),
install_requires=_parse_requirements("requirements/requirements.txt"),
extras_require={
"dev": _parse_requirements("requirements/requirements-dev.txt"),
},
Expand Down

0 comments on commit 5c5e048

Please sign in to comment.