# Strategies¶

## Motivating example: Strategy for Rock Paper Scissors¶

The game of Rock Paper Scissors is a common parlour game between two players who pick 1 of 3 options simultaneously:

1. Rock which beats Scissors;

2. Paper which beats Rock;

3. Scissors which beats Paper

Thus, this corresponds to a Normal Form Game with:

1. Two players ($$N=2$$).

2. The action sets are: $$\mathcal{A}_1=\mathcal{A}_2=\{\text{Rock}, \text{Paper}, \text{Scissors}\}$$

3. The payoff functions are given by the matrices $$A, B$$ where the first row or column corresponds to $$\text{Rock}$$, the second to $$\text{Paper}$$ and the third to $$\text{Scissors}$$.

$\begin{split}A = \begin{pmatrix} 0 & -1 & 1 \\ 1 & 0 & -1\\ -1 & 1 & 0\\ \end{pmatrix}\end{split}$
$\begin{split}B = - A = \begin{pmatrix} 0 & 1 & -1 \\ -1 & 0 & 1\\ 1 & -1 & 0\\ \end{pmatrix}\end{split}$

If we consider two players, assume the row player always chooses $$\text{Paper}$$ and the column player randomly chooses from $$\text{Rock}$$ and $$\text{Paper}$$ (with equal probability) what is the expected outcome of any one game between them?

• The expected score of the row player will be: $$-1 \times 1/2 + 0 \times 1/2 = -1/2$$.

• The expected score of the column player will be: $$1 \times 1/2 + 0 \times 1/2 = 1/2$$.

In Game theoretic terms, the behaviours described above are referred to as strategies. Strategies map information to actions. In this particular case, the only available information is the game itself and the actions are $$\mathcal{A}_1=\mathcal{A}_2$$.

## Definition of a strategy in a normal form game¶

A strategy for a player with action set $$\mathcal{A}$$ is a probability distribution over elements of $$\mathcal{A}$$.

Typically a strategy is denoted by $$\sigma \in [0, 1]^{|\mathcal{A}|}_{\mathbb{R}}$$ so that:

$\sum_{i=1}^{\mathcal{A}}\sigma_i = 1$

Question

1. What is the strategy $$\sigma_r$$ that corresponds to the row player’s behaviour of always choosing $$\text{Paper}$$?

2. What is the strategy $$\sigma_c$$ that corresponds to the column player’s behaviour of always randomly choosing between $$\text{Rock}$$ and $$\text{Paper}$$?

## Definition of support of a strategy¶

For a given strategy $$\sigma$$, the support of $$\sigma$$: $$\mathcal{S}(\sigma)$$ is the set of actions $$i\in\mathcal{A}$$ for which $$\sigma_i > 0$$.

Question

For the following strategies $$\sigma$$ obtain $$\mathcal{S}(\sigma)$$:

1. $$\sigma = (1, 0, 0)$$

2. $$\sigma = (1/3, 1/3, 1/3)$$

3. $$\sigma = (2/5, 0, 3/5)$$

## Strategy spaces for Normal form Games¶

Given a set of actions $$\mathcal{A}$$ the space of all strategies $$\mathcal{S}$$ is defined as:

$\mathcal{S} = \left\{\sigma \in [0, 1]^{|\mathcal{A}|}_{\mathbb{R}}\;\left|\; \sum_{i=1}^{\mathcal{A}}\sigma_i = 1\right.\right\}$

## Calculation of expected utilities¶

Considering a game $$(A, B) \in \mathbb{R} ^{(m\times n) ^ 2}$$, if $$\sigma_r$$ and $$\sigma_c$$ are the strategies for the row/column player, the expected utilities are:

• For the row player: $$u_{r}(\sigma_r, \sigma_c) = \sum_{i=1}^m\sum_{j=1}^nA_{ij}\sigma_{r_i}\sigma_{c_j}$$

• For the column player: $$u_{c}(\sigma_r, \sigma_c) = \sum_{i=1}^m\sum_{j=1}^nB_{ij}\sigma_{r_i}\sigma_{c_j}$$

This corresponds to taking the expectation over the probability distributions $$\sigma_r$$ and $$\sigma_c$$.

Question

For the Rock Papoer Scissors:

What are the expected utilities to both players if $$\sigma_r=(1/3, 0, 2/3)$$ and $$\sigma_c=(1/3, 1/3, 1/3)$$.

## Linear algebraic calculation of expected utilities¶

Given a game $$(A, B) \in \mathbb{R} ^{(m\times n) ^ 2}$$, considering $$\sigma_r$$ and $$\sigma_c$$ as vectors in $$\mathbb{R}^m$$ and $$\mathbb{R}^n$$. The expected utilities can be written as the matrix vector product:

• For the row player: $$u_{r}(\sigma_r, \sigma_c) = \sigma_r A \sigma_c^T$$

• For the column player: $$u_{c}(\sigma_r, \sigma_c) = \sigma_r B \sigma_c^T$$

Question

Calculate the expected utilities to both players if $$\sigma_r=(1/3, 0, 2/3)$$ and $$\sigma_c=(1/3, 1/3, 1/3)$$ using a linear algebraic approach.

## Using Nashpy¶

See Calculate utilities for guidance of how to use Nashpy to calculate utilities.