{ "cells": [ { "cell_type": "markdown", "id": "6818538c", "metadata": {}, "source": [ "# Generating starting points for algorithms\n", "\n", "In the previous tutorial, we demonstrated how to calculate the Nash equilibria of a game set up using Gambit and interpret the `MixedStrategyProfile` or `MixedBehaviorProfile` objects returned by the solver.\n", "In this tutorial, we will demonstrate how to use a `MixedStrategyProfile` or `MixedBehaviorProfile` as an initial condition, a starting point, for some methods of computing Nash equilibria.\n", "The equilibria found will depend on which starting point is selected.\n", "\n", "To facilitate generating starting points, Gambit's `Game` class provides the methods `random_strategy_profile` and `random_behavior_profile`, to generate profiles which are drawn from the uniform distribution on the product of simplices. In other words, the profiles are sampled from a uniform distribution so that each possible mixed strategy profile (or mixed behaviour profile) is equally likely to be selected.\n", "\n", "As an example, we consider a three-player game from McKelvey and McLennan (1997), in which each player has two strategies.\n", "This game has nine equilibria in total, and in particular has two totally mixed Nash equilibria, which is the maximum possible number of regular totally mixed equilbria in games of this size.\n", "\n", "Pure and mixed strategies:\n", "\n", "- **Pure strategy**: A player chooses the action with probability 1 (always picks the same move)\n", "- **Mixed strategy**: A player assigns probabilities to their available actions (some actions may have probability 0)\n", "- **Totally mixed strategy**: Mixed strategy where every available action is chosen with strictly positive probability (no action has probability 0)" ] }, { "cell_type": "code", "execution_count": 1, "id": "493cafb8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| 1 | 2 | |
| 1 | 9,8,12 | 0,0,0 |
| 2 | 0,0,0 | 9,8,2 |