Advanced maths

Zero sum matrix game calculator with mixed strategies

Solve a finite two-player zero-sum payoff matrix using exact primal-dual linear programs, with equilibrium probabilities and best-response checks.

Your numbers

A rational 1–6 by 1–6 matrix. The row player maximizes this payoff and the column player minimizes it; the other player receives its negative.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A finite zero-sum matrix game describes two players whose payoffs are exact opposites. The row player wants the displayed payoff high, while the column player wants it low. Mixed strategies are probability distributions over pure rows or columns. This calculator solves the row player’s maximum guaranteed payoff and the column player’s minimum exposure as separate exact rational linear programs. Their equal values and verified best-response inequalities certify an equilibrium pair. A mixed strategy is a distribution to randomize over, not a fractional execution of several actions at once.

THE FORMULAmax over p in the probability simplex of minⱼ ΣᵢpᵢAᵢⱼ = min over q in the probability simplex of maxᵢ ΣⱼAᵢⱼqⱼ.

A worked example

For matching pennies with payoff matrix ((1,−1),(−1,1)), either pure row can be answered by a column producing payoff minus one. A half-half row mixture instead guarantees zero against either pure column. A half-half column mixture likewise keeps every pure row’s expected payoff at zero. The game value is therefore zero and both displayed probability vectors are (1/2,1/2). The realized payoff of one play can still be plus one or minus one; zero is the equilibrium expected value, not a prediction of every outcome.

Good to know

Rational payoff matrices with 1–6 rows and columns under the bounded exact parser. Payoffs are to the row maximizer, and the column player receives their negative. Returns one equilibrium pair, which need not be unique. Zero-probability pure strategies are valid. Exact simplex pivot and fraction-growth limits apply. This is not a general-sum Nash-equilibrium solver, repeated-game strategy optimizer, behavioral model or guarantee about how a real opponent will act. No monetary transaction or external game is executed.

Each player’s program provides the other side of an optimality bound

For a proposed row mixture p, evaluate its expected payoff against every pure column. The smallest of those values is what the mixture guarantees. The row program maximizes that lower bound. For a column mixture q, evaluate every pure row response and take the largest value; the column program minimizes that upper bound. When both exact bounds agree, neither player can improve by changing its mixture alone against the displayed opponent distribution.

Checking pure responses is enough because expected payoff is linear in a player’s mixing probabilities. A mixture of pure responses cannot exceed their largest payoff or fall below their smallest. The result table therefore includes each pure strategy’s expected payoff against the opponent mixture, not only probability vectors whose interpretation would otherwise be difficult to inspect. Nonnegative probabilities summing to one are also verified rather than assumed from rounded output.

Half-half mixtures equalize the two pure responses in matching pennies1−1−111/21/21/21/2p = q = (1/2,1/2)Pure responses: 0Game value: 0
Payoff to the row maximizer is ((1,−1),(−1,1)). Both players mix their two actions with probability 1/2 each. Every pure response has expected payoff 0, proving the game value 0.

An equilibrium can be nonunique and still have a well-defined value

Duplicate or strategically equivalent rows can allow several optimal ways to distribute probability. A displayed zero probability is not necessarily a universal claim that the corresponding action is useless in every equilibrium. Likewise, a pure saddle point is a legitimate equilibrium represented by a probability vector with one entry equal to one. The calculator returns one verified solution and does not enumerate the entire equilibrium set.

The model also requires the zero-sum convention. If two players have independent payoff tables, negating one table does not faithfully represent their incentives. A sign reversal or transposed interpretation can swap who maximizes and minimizes, so preserve the row-player payoff convention when entering data. The Linear and mixed integer programming calculator from constraints exposes the general optimization machinery, while this page constructs the specific probability and worst-response constraints needed for a zero-sum game and explains their strategic meaning.

A few questions, answered

Does a game value of zero mean the players always tie?

No. It is an expected payoff under equilibrium mixtures. Individual randomized plays can have nonzero outcomes.

Can this solve a game where both players can gain together?

Not in general. The page assumes one player’s payoff is exactly the negative of the other’s, so a general-sum game requires a different equilibrium model.

Find your calculator

Start typing to explore the library.