TL;DR
A minimax game is a contest between two players whose gains are exactly opposite: whatever one player wins, the other loses. Each player picks a strategy to protect themselves against the other's best reply. The row player maximises the worst outcome they can be handed, and the column player minimises the best outcome the row player can reach. With randomised strategies, these two guarantees meet at one number, the value of the game.
Where you'll see it: in the training objective of generative adversarial networks, in robust optimisation where you plan for the worst case, and in the game-theory analysis of bluffing and betting.
Intuition
Start with a game you can play with your hands. Two players each show one of two options, and a referee pays one player what the other owes. Rock-paper-scissors is a familiar example. Every outcome nets to zero, so there is no shared prize to split, only a contest where one side's gain is the other's loss. Such a game is called zero-sum.
The question is how to play it well. Always making the same move is a bad idea, because an opponent who notices the habit will exploit it. Being unpredictable is worth something, and the minimax idea gives a clean way to reason about it. Assume your opponent will answer you as well as they possibly can. Then pick the plan whose worst case is as good as possible. That is the cautious plan, and in a zero-sum game it is the right kind of caution, because no hidden cooperation can rescue you from a bad answer.
Here is the surprising part. If both players are allowed to randomise, the cautious plan of the first player and the cautious plan of the second player always give the same number. Neither side can do better than that number against a sensible opponent, and neither side is forced to give it up. Von Neumann proved this, and the result is called the minimax theorem.
flowchart LR A["Row player picks a mixed strategy"] --> C["Payoff matrix"] B["Column player picks a mixed strategy"] --> C C --> D["Row player maximises the worst case"] C --> E["Column player minimises the best case for the row player"] D --> F["Both values agree (the game value)"] E --> F
The same shape appears in machine learning. A generative adversarial network has a generator that tries to produce realistic samples and a discriminator that tries to tell them apart from real data. One side's gain is the other side's loss, so training is a minimax game, not an ordinary minimisation problem.
The math
Zero-sum games and the payoff matrix
A game with a row player R and a column player C. R chooses a row from options, and C chooses a column from options at the same time. The payoff goes to R, and C pays the same amount, so the total is always zero. The matrix of all payoffs is the payoff matrix.
A strategy is a rule for choosing. A pure strategy picks one row or column every time. A mixed strategy is a probability distribution over the options. R's mixed strategy is a vector of probabilities that sum to 1, with the chance of row . C's mixed strategy is a vector with the chance of column . If the two choices are made independently, then the expected payoff, in the sense of Expected Value, is
Here and are the random choices of the two players, and is written as a row vector.
The two guarantees
R wants a strategy whose worst case is as high as possible. For a mixed , the worst case is the smallest expected payoff over all of C's replies:
C wants the mirror image: a strategy whose worst case, measured from R's side, is as low as possible.
The first is called the maximin value and the second the minimax value. There is always an easy inequality between them. For any and , the minimum over is no larger than the particular value , which is no larger than the maximum over . So always holds.
The minimax theorem says the inequality is an equality for mixed strategies, for any finite payoff matrix:
The common number is the value of the game. R can guarantee at least and C can guarantee at most .
Why pure strategies are not enough
Equality often fails for pure strategies. Write the pure maximin as and the pure minimax as . When these two numbers are different, there is no saddle point, and the game can only be solved with mixing. The worked examples below show this.
Continuous games and saddle points
For a function where the first player chooses to make small and the second chooses to make large, a saddle point is a pair with
for every and . Neither player gains by moving away from it. The minimax theorem extends to this setting when is convex in and concave in and the sets of choices are convex (and one of them is compact), which is the setting of Sion's theorem.
- worst case over y
Training a GAN as a minimax game
In a generative adversarial network, the generator maps noise to a fake sample, and the discriminator outputs a probability that its input is real. Goodfellow and co-authors wrote the training problem as one value function:
The discriminator maximises by telling real from fake well. The generator minimises by making close to 1. In practice both are neural networks, and training alternates a gradient step for upward on with a gradient step for downward on . This is gradient descent-ascent, the minimax form of Gradient Descent.
Worked examples
Let R be the row player and C the column player. The payoff matrix is
- Check for pure strategies. The row minima are and , so the pure maximin is . The column maxima are and , so the pure minimax is .
- Since , there is no saddle point. R must mix. Let be the chance R plays row 1, so row 2 has chance .
- Against column 1, R's expected payoff is . Against column 2 it is .
- R's guarantee is the smaller of these two lines, . The lines cross where , which gives . At that point the guarantee is .
- Check: at , the payoff against column 2 is as well. Both columns give 1, so R's guarantee is exactly 1.
- Now C's side. Let be the chance C plays column 1. Against row 1, the payoff is . Against row 2, it is . Setting them equal: , so , and the value is .
- Both sides agree: . R plays row 1 with probability , and C plays column 1 with probability .
Interpretation: against a sensible opponent, neither player can expect more than 1 per round, and the mixed plan is what makes that guarantee hold. Any fixed row would let C punish R.
- payoff vs column 1
- payoff vs column 2
Each player shows heads or tails. R wins if the coins match, and C wins if they differ. The payoff matrix, with rows heads and tails for R and columns heads and tails for C, is
- Pure maximin: the row minima are and , so the value is .
- Pure minimax: the column maxima are and , so the value is . The gap means there is no saddle point.
- Let R play heads with probability . Against C's heads, the payoff is . Against C's tails, it is .
- These two are equal when , which gives . At that point both are 0.
- By symmetry C also plays on each side, and the value is .
Interpretation: a predictable player always loses to an opponent who notices the pattern. The fair coin is the only way to make each side's worst case equal.
Tradeoffs and failure modes
The minimax theorem is strong, but it covers a narrow case. The table below sorts common situations.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Two players, finite zero-sum matrix | Pure strategies may have no saddle point | Solve for mixed strategies, which is a linear program |
| Non-zero-sum game, such as a bargaining problem | The two values differ, so minimax no longer describes the outcome | Use a Nash equilibrium |
| Deep GAN training, non-convex and non-concave | No theorem guarantees a stable value; the updates can cycle or collapse | Careful optimisers, regularisers, and variant losses |
| Robust planning against an adversary | Worst-case plans can be too cautious and give up too much average performance | A tuned mix of worst-case and average-case objectives |
A common failure is that simultaneous gradient steps move away from the equilibrium instead of toward it. Take the simple game , where the first player minimises and the second maximises. The equilibrium is . If both players take a simultaneous gradient step with size , the new point is , and its squared distance from the origin is
Every step multiplies the distance by , so the iterates spiral away from the equilibrium. This is why training a GAN with plain simultaneous updates can be unstable, even when the equilibrium exists.
History
John von Neumann proved the minimax theorem for finite zero-sum games in 1928. The paper appeared in the journal Mathematische Annalen. He was working on the mathematics of parlour games, and the result established that a finite two-player zero-sum contest has a well-defined value.
In 1944 von Neumann and the economist Oskar Morgenstern published Theory of Games and Economic Behavior. The book used the minimax theorem as the foundation for a theory of rational choice under conflict, and it made game theory a standard tool in economics.
Linear programming, developed in the late 1940s by George Dantzig and others, gave a practical way to compute mixed strategies for finite games. A matrix game can be written as a pair of dual linear programs, which is one reason the minimax theorem is closely tied to optimisation.
John Nash extended the idea in 1950 to games with any number of players and no zero-sum restriction, introducing the Nash equilibrium. Minimax remained the special case where the two players' interests are exactly opposite.
In 2014 Ian Goodfellow and co-authors proposed generative adversarial networks, with training written as a minimax problem over neural networks. That brought the old idea into deep learning, where the theorem's guarantees no longer apply in general, and much later work is about making the game behave.
Check yourself
QuestionWhat is the defining property of a zero-sum game, in one sentence?Show answer
In every outcome, the payoffs of the two players add up to zero. What one player gains, the other loses. This is why each player can reason about the other as a rival who plays their best reply, and why a cautious plan protects against the worst case.
QuestionFor the matrix A = [[2, 0], [0, 2]] with the row player maximising, compute the pure maximin value and the pure minimax value, and say whether a saddle point exists.Show answer
The row minima are 0 and 0, so the pure maximin is 0. The column maxima are 2 and 2, so the pure minimax is 2. The two values differ, so there is no pure saddle point. The mixed value is 1, reached by playing each row with probability 1/2, and each column also with probability 1/2 against the opponent's mix. Check: if R plays 1/2 and 1/2, every column gives the same expected payoff, 1.
QuestionIn the 2 by 2 example, why must R's guarantee equal the value where the two lines cross, rather than at the endpoints p = 0 or p = 1?Show answer
At p = 0 the guarantee is the smaller of 0 and 2, which is 0. At p = 1 it is the smaller of 3 and -1, which is -1. Both endpoints are worse than the crossing point. The guarantee is a minimum of two straight lines, so it is a tent shape whose peak is where they cross. The crossing at p = 1/3 gives the highest point of the tent, 1.
QuestionWhy does a fair coin appear in the matching pennies game, and what goes wrong if one player always shows heads?Show answer
A fair coin makes the opponent indifferent: heads and tails give the same expected payoff, 0. If R always shows heads, C simply shows tails every round and wins every time. A predictable pattern gives the opponent a sure gain, so the mixed strategy is the only one with a guaranteed worst case of 0.
QuestionIn a GAN, the discriminator wants V to be large and the generator wants it small. If the discriminator becomes perfect, what does the value V equal, and why does that make the generator's gradient signal weak?Show answer
If D is perfect, it outputs D(x) = 1 on real data and D(G(z)) = 0 on fake data, so log D(x) = 0 and log(1 - D(G(z))) = 0, giving V = 0 in the limit. This is the discriminator's best possible value, so the generator is pushed to change. In practice a perfect discriminator also gives the generator a very flat signal, since the log term saturates, which is one reason GAN training needs careful loss choices.