Basic Guide to Game Theory
Language
- unknown
by James Smith (Golang Project Structure Admin)
The steganographic strategies we saw that prisoners could use to hide their communications in the previous post I wrote made me think about the somewhat related yet broader subject of game theory.
This field has its own very famous Prisoners’ Dilemma, as we shall see later.
This introduction to game theory is designed for a general audience, not just programmers. No requisite knowledge is needed. We will keep things fairly simple, without including any mathematical equations.
However, I do plan to write a follow-up post in future that builds on the knowledge we will have gained here by exploring some practical code examples that use game-theoretical ideas and principles.
Table of Contents
What Is Game Theory?
Game theory is the mathematical study of strategy.
It seeks to model the complex dynamics of decision-making, where the outcome for individuals depends not only on their own choices but also on the actions of others.
At its core, game theory examines how and why rational actors anticipate and respond to the actions of others, often uncovering counterintuitive truths — such as why cooperation can emerge in fiercely competitive environments or why seemingly irrational behaviour, like bluffing in a game of poker, can be a winning strategy.
What Are the Origins of Game Theory?
One of the earliest examples of strategic thinking comes from Sun Tzu’s The Art of War, written in the 5th century BCE. This ancient military treatise emphasizes deception, careful planning and anticipating an opponent’s moves—key principles that align with modern game theory.
Later, in the 16th century, Niccolò Machiavelli’s The Prince examined the nature of power and manipulation, highlighting how rulers could strategically maintain control by predicting and influencing the actions of others.

Similarly, in 1776, Adam Smith’s The Wealth of Nations discussed the dynamics of competition and cooperation in economic systems.
Though these early works were not formal mathematical studies, they all recognized that success often depends on not just one’s own actions, but also on how others react.
The mathematical underpinnings of game theory only really began to take shape in the early 18th century. In 1713, Charles Waldegrave analyzed a card game known as le her, providing an effective solution for a two-player version—a problem that has since become known as the Waldegrave problem.
In the following century, Antoine Augustin Cournot introduced a model of business competition within an oligopolistic marketplace, predicting how firms may set prices based on decisions made by their competitors.
The real transformation of game theory into a formal discipline occurred in the 20th century.
In 1928, mathematician John von Neumann published a ground-breaking paper introducing the minimax theorem, proving that in zero-sum games — where one player’s gain is another’s loss — there is always an optimal strategy.
This work became the foundation of Theory of Games and Economic Behavior, a book he co-authored with economist Oskar Morgenstern in 1944. This book systematically developed game theory and demonstrated many of its applications within the field of economics.
Another major milestone came in 1950 when mathematician John Nash introduced the concept of Nash equilibrium. Unlike earlier theories that focused mainly on zero-sum situations, Nash’s work showed that in many real-world scenarios, there exist stable outcomes where no player can benefit by changing their strategy unless others do as well.
The Three Basic Elements of Game Theory
Players, Strategies and Payoffs
Game theory provides a structured framework for analysing strategic interactions, where rational decision-makers—known as players—must choose from a set of available strategies in pursuit of desirable payoffs.
These three elements form the foundation of any game-theoretic model and can serve as the building blocks for understanding the dynamics of competition and cooperation in various different arenas.
A player is any entity capable of making strategic decisions within a game. This could be an individual, a firm, a nation-state or even an automated system.
Each player is presented with a range of possible strategies, each of which is a set of actions or choices that they may adopt in response to the anticipated behaviour of others.
The payoff structure quantifies the consequences of these strategic decisions, often expressed numerically to capture gains, losses or relative utility-values.
A player’s ultimate objective is to select a strategy that maximises his or her expected payoff, taking into account the potential responses of their opponents.
What Is the Difference Between Cooperative and Non-cooperative Games?
Games can be broadly categorised into two main types: there are non-cooperative games and cooperative games.
In a non-cooperative game, each player acts independently, often in direct competition with others, and strategic choices are typically driven by self-interest.
This is the domain of classic game-theoretic models such as the Nash equilibrium, which explores stable outcomes where no player has an incentive to unilaterally deviate from their chosen strategy.
By contrast, cooperative game theory investigates how players can form alliances or coalitions to negotiate mutually beneficial agreements, often by employing mechanisms such as binding contracts or tacit understandings to ensure collaboration.
Introducing the The Prisoner’s Dilemma
To illustrate the game-theoretic concepts that we’ve just discussed in practice, let’s look at a classic scenario called The Prisoner’s Dilemma.
This paradoxical example demonstrates how two rational players, acting in their own self-interest, may easily arrive at an outcome that is suboptimal for both.
Imagine two criminal suspects, Alice and Bob, who have been apprehended for a serious crime.
The police, lacking sufficient evidence to secure a conviction on the primary charge, decide to exploit the suspects’ strategic incentives by offering each a Faustian bargain.
Separated from one another and unable to communicate, Alice and Bob are each given a choice: either to confess and betray the other (i.e. to defect) or to remain silent (i.e. to cooperate).
Their fates hinge upon their respective decisions, leading to the following possible outcomes.
- If one suspect confesses while the other remains silent, the defector is rewarded with immediate freedom, while the silent suspect bears the full weight of punishment, receiving a harsh ten-year sentence.
- If both confess, they each receive a five-year sentence. This is worse than mutual silence but better than being a lone cooperator.
- If both remain silent, they each serve only a one-year sentence on a lesser charge, achieving the most favourable collective outcome.
This dilemma can be elegantly encapsulated in the following payoff matrix, where negative values can be seen as representing years of imprisonment:
Bob Stays Silent | Bob Confesses | |
---|---|---|
Alice Stays Silent | -1, -1 | -10, 0 |
Alice Confesses | 0, -10 | -5, -5 |
From a standpoint of pure rationality, Alice and Bob, acting independently, will each recognise that confessing is the best strategy.
Regardless of what the other chooses, defecting always results in a shorter sentence: if the other stays silent, defecting leads to immediate freedom, while if the other also defects, at least the sentence is mitigated to five years rather than ten.
Thus, in the absence of trust or enforceable agreements, we can see that both prisoners will rationally choose to defect.
However, this leads to a suboptimal outcome — each prisoner will serve five years instead of the collectively preferable one-year term that would result from mutual cooperation.
As we mentioned previously, this paradox encapsulates a central insight of game theory: rational self-interest does not always lead to the best overall outcome for all players.
The Prisoner’s Dilemma reveals how competitive incentives can thwart cooperation, even when collaboration would quite clearly yield superior results.
Real-World Applications of Game Theory
Of course, game theory extends far beyond the prison cell, influencing our understanding of everything from corporate competition to the dynamics of biological evolution.
Below, we explore several key domains where game-theoretic principles play a pivotal role.
Strategic Decision-Making in Business
In the corporate arena, strategic decision-making is a matter of survival. It can mean the difference between dominance and decline.
Firms must anticipate not only consumer behaviour but also the moves of their competitors and regulators, which shape the markets they operate in.
The choices that business-leaders make — whether concerning pricing, the development of products or any other such strategic decisions — are rarely made in isolation.
Instead, businesses are always working with an intricate web of interdependent decisions, where success depends as much on understanding rival strategies as on their own internal capabilities.
Price Wars and Market Competition
Pricing strategy offers a striking example of game theory in action.
Consider two dominant firms in a given industry. If both maintain high prices, they enjoy stable profits.
However, if one firm slashes its prices to capture greater market share while the other maintains its pricing, the price-cutter gains a competitive advantage.
And if both engage in aggressive price reductions, they risk eroding their profit margins in a mutually destructive race to the bottom.
This dynamic is particularly evident in industries such as aviation, where airlines continually adjust ticket prices in response to their competitors’ pricing strategies.
Supermarkets and consumer goods companies also frequently engage in strategic pricing battles, leveraging discounts and promotions to attract price-sensitive customers while carefully balancing profit margins.
Such interactions closely resemble the Prisoner’s Dilemma — each firm would be better off maintaining higher prices, yet the incentive to undercut rivals often leads to a collectively worse outcome.
Research and Development Arms Races
Innovation-driven industries offer another curious case of game theory at work.
Take, for example, the ongoing technological rivalry between Apple and Samsung in the smartphone industry.
Both firms face a strategic decision: to invest heavily in research and development (R&D), allowing them to push the boundaries of innovation, or to scale back and reduce costs.
If only one company chooses to innovate while the other cuts back, the innovator gains a decisive edge in market dominance.
However, if both invest aggressively, they enter into an R&D arms race — one that may not necessarily shift market share but that ensures neither firm falls behind.
This phenomenon is common across high-tech industries, from biotech to semiconductors, where companies must balance the high cost of innovation against the competitive risk of stagnation.
The decision of a pharmaceutical company to develop a new drug, for instance, hinges not only on its internal research capacity but also on competitors’ willingness to bring rival treatments to market.
Governments and regulatory bodies frequently intervene in these strategic dynamics, introducing patent protections or subsidies to ensure that innovation is sustained without rendering markets unnecessarily unviable.
Game Theory in Politics and Diplomacy
Politics is a high-stakes game in which national leaders, diplomats and policymakers must continuously anticipate the actions of other states.
Decision-making in this arena is rarely unilateral; rather, it takes place within a complex web of alliances, rivalries and negotiations, and outcomes often depend not only on one’s own choices but also on the strategic responses of others.
Whether in matters of war and peace, trade agreements or international treaties, game theory provides a powerful analytical framework for understanding the intricate dynamics of cooperation, competition and strategic deterrence.
The Cold War and Mutually Assured Destruction
One of the most striking applications of game theory in international relations was during the Cold War, when the United States and the Soviet Union found themselves locked in an existential strategic standoff.
The doctrine of Mutually Assured Destruction (MAD) epitomised a game-theoretic equilibrium: if either superpower launched a nuclear strike, the other would retaliate with equal or greater force, ensuring the complete annihilation of both nations.
This terrifying balance of power was underpinned by the principles of deterrence theory, which argued that the sheer cost of nuclear war rendered pre-emptive strikes irrational.

The underlying logic of MAD can be understood through the lens of game theory. Each side faced a choice: to launch a nuclear attack (i.e. to defect) or to refrain from doing so (i.e. to cooperate).
While neither nation could necessarily trust the other’s long-term intentions, both recognised that initiating conflict would guarantee their own destruction.
The result was a tense but stable equilibrium, in which neither side had an incentive to act rashly, thus preventing full-scale war.
However, this precarious balance also gave rise to secondary strategic considerations, such as the development of second-strike capabilities, arms control negotiations and brinkmanship, where leaders pushed crises to the edge of disaster in an attempt to extract concessions from their adversaries.
Climate Agreements and the Free-Rider Problem
While the Cold War illustrated game theory’s role in deterrence, modern geopolitical challenges, such as climate change, highlight its application in fostering international cooperation.
Global climate agreements operate within a strategic framework where nations must decide whether to reduce carbon emissions (i.e. to cooperate) or continue prioritising economic growth at the expense of environmental sustainability (i.e. to defect).
This dilemma is complicated by the free-rider problem, a classic issue in game theory whereby individual actors benefit from a public good without contributing to its provision.
In the context of climate policy, if one country invests heavily in reducing emissions while others continue polluting, the benefits of a cleaner environment are shared globally, but the economic costs are borne disproportionately by the cooperating nation.
This creates an incentive for some states to shirk their responsibilities, hoping that others will shoulder the burden. This dynamic has historically hindered the effectiveness of international climate agreements.
The 2015 Paris Agreement represented a global attempt to shift the strategic equilibrium towards cooperation. By establishing voluntary commitments and attempting to foster international accountability, the agreement sought to align national incentives with collective environmental goals.
However, enforcement remains a challenge, since there are few mechanisms to compel compliance, and the temptation to defect remains strong, particularly for major economies that are reliant on fossil fuels.
Trade Wars, Alliances, and Negotiation Strategies
Beyond nuclear deterrence and environmental policy, game theory also plays a crucial role in international trade and diplomatic negotiations.
Trade wars, for instance, can be modelled as a repeated game where nations impose tariffs in response to protectionist policies enacted by their trading partners.
If both sides escalate retaliatory measures, the result is a mutually damaging outcome akin to the Prisoner’s Dilemma, on the assumption that free trade would have been the preferable cooperative strategy.
Similarly, military alliances, such as NATO, rely on principles of collective security, where member states pledge to defend one another in the event of an attack.
Here, game theory helps to explain both the strength and fragility of alliances: while mutual defence commitments deter aggression, individual nations may be tempted to free-ride on the security provided by others, contributing less to defence spending while still benefiting from collective protection.
At the negotiation table, game theory informs strategies for diplomatic bargaining, treaty-making, and crisis resolution.
Concepts such as the Nash bargaining solution illustrate how parties can reach agreements that reflect their relative power and preferences, while credible commitments, involving the ability to convincingly signal one’s willingness to follow through on promises or threats, play a critical role in shaping the behaviour of states.
Designing Auctions and Marketplaces
Auction theory, a sophisticated subfield of game theory, underpins many of the world’s most critical economic transactions.
From the art market to financial trading, from government contracts to digital advertising, auctions allocate resources efficiently while harnessing the power of strategic competition.
Though they may seem like simple transactions, auctions are, in reality, finely tuned strategic environments where bidders must carefully and competitively weigh risk, all while there are asymmetries of information in play.
Types of Auctions and Strategic Bidding
A wide array of auction formats exists, each encouraging different strategic behaviours.
Among the most influential is the Vickrey auction, which is a sealed-bid mechanism in which the highest bidder wins but pays the second-highest bid.
At first glance, this structure may appear counterintuitive; however, it ensures that bidders have no incentive to misrepresent their valuation.
Since the price paid is determined by the second-highest bid rather than their own, participants are encouraged to bid truthfully, leading to an outcome that reflects genuine market valuations.
Similar principles underpin generalised second-price (GSP) auctions, which govern digital advertising platforms such as Google AdWords.
Here, companies bid for search keywords, but the cost they pay per click is determined by the bid of the next-highest competitor.
This structure forces firms to navigate a delicate balance between maximising visibility and controlling advertising expenditure.
The Winner’s Curse in Common-Value Auctions
Not all auctions involve purely private valuations, where each bidder knows exactly what an item is worth to them.
Many high-stakes auctions — such as those for oil drilling rights, spectrum licenses, or mineral extraction permits — are common-value auctions, where the true value of the asset is uncertain and only becomes apparent after the auction concludes.
However, a notorious phenomenon within such auctions is the winner’s curse. This occurs when the winning bidder, in their enthusiasm to secure the asset, inadvertently overpays.
Since each bidder forms their valuation based on imperfect information, the winner is, by definition, the one who has most overestimated the item’s true worth.
If they fail to account for this risk, they may suffer significant financial losses, as has historically happened in oil lease auctions, where firms have occasionally bid aggressively, only to discover that the reserves were far less valuable than anticipated.
Mitigating the winner’s curse requires strategic foresight. Rational bidders must adjust their valuations downward to avoid overbidding—a principle known as Bayesian updating, where players refine their beliefs based on the knowledge that other bidders possess similar but incomplete information.
Government Auctions and Market Efficiency
Governments frequently employ auction theory to allocate scarce resources, from radio frequencies to carbon emission permits.
Spectrum auctions, used to distribute broadcasting and telecommunications rights, exemplify how well-designed auction mechanisms can prevent monopolistic inefficiencies while maximising public revenue.
The Federal Communications Commission (FCC) in the United States, for example, has pioneered combinatorial clock auctions, enabling bidders to express preferences for specific package deals rather than individual licenses, thereby reducing inefficiencies and fostering fairer competition.
Similarly, carbon trading schemes operate on an auction-based principle, where companies bid for the right to emit pollutants.
By capping total emissions and allowing firms to trade permits, these systems introduce market discipline into environmental policy, aligning profit incentives with sustainability goals.
Yet, the effectiveness of such schemes hinges on game-theoretic design: if emissions allowances are too abundant or mispriced, the market mechanism collapses, rendering the system ineffective.
Understanding Strategies in Nature
Game theory extends far beyond the realm of human strategizing. It permeates the natural world, shaping the behaviours of biological species through evolutionary pressures.
Evolutionary game theory applies mathematical principles to biological interactions, explaining how strategies of competition, cooperation and reciprocity emerge and persist over generations.
Unlike traditional game theory, where rational players make conscious choices, evolutionary game theory operates on the principle of natural selection, where successful strategies proliferate through reproductive success, and ineffective ones tend to diminish over time.
Aggression vs. Cooperation in the Hawk-Dove Game
One of the most famous models in evolutionary game theory is the Hawk-Dove Game, which illustrates the balance between aggression and cooperation within a species.
In this scenario, individuals compete for a shared resource and can adopt one of two primary strategies.
The Hawk strategy represents aggressive behaviour: an individual will fight for the resource, potentially winning outright but at the risk of costly injury if it encounters another Hawk.
The Dove strategy, by contrast, represents a more peaceful approach: a Dove will concede the resource if confronted by a Hawk but will share it amicably if facing another Dove.
If an entire population were composed of Hawks, the cost of frequent aggressive encounters would be unsustainable, leading to injury and death that reduce overall fitness.
Conversely, if every individual were a Dove, resources would be shared peacefully, but the strategy would be vulnerable to the invasion of a single Hawk, who could exploit the pacifism of others.
Evolution thus selects for a mixed equilibrium — known as an Evolutionarily Stable Strategy (ESS) — where a certain proportion of the population adopts each strategy, thereby maintaining a balance between conflict and cooperation.
This model helps to explain territorial disputes in animals, from birds defending nesting sites to deer engaging in ritualised antler clashes rather than outright combat.
The Evolution of Altruism and Reciprocity
At first glance, altruism presents a difficult-to-explain paradox in evolutionary theory.
If natural selection favours individuals that maximise their own survival and reproductive success, why do so many species exhibit cooperative or even self-sacrificing behaviours?
Evolutionary game theory helps resolve this puzzle by showing that cooperation can be an adaptive strategy when it enhances the survival of related individuals (i.e. kin selection) or fosters shared benefits over time (i.e. reciprocal altruism).
The Iterated Prisoner’s Dilemma, a repeated version of the classic Prisoner’s Dilemma, provides a framework for understanding the evolution of reciprocal altruism.
In a single encounter, selfishness may well appear to be the dominant strategy.
However, when interactions are repeated over an extended period, cooperation becomes advantageous, because individuals who help others today are more likely to receive help in return in the future.
This mechanism appears to underpin many cooperative behaviours in nature.
A compelling example can be found in vampire bats, which rely on blood meals to survive.
On nights when a bat fails to feed, it risks starvation, but well-fed bats have been observed regurgitating blood to nourish their hungry roost-mates.

This act of generosity is not random; bats tend to share with those who have previously helped them, creating a system of reciprocal altruism that ensures the long-term survival of the group.
Similarly, primates, such as chimpanzees and bonobos, engage in mutual grooming, a behaviour that not only fosters social bonds but also encourages future cooperative interactions, such as food sharing and alliance formation.
Game Theory and the Survival Strategies of Species
Beyond these specific examples, evolutionary game theory can help to explain broader survival strategies in nature.
The concept of frequency-dependent selection, where the success of a strategy depends on how common it is within a population, illustrates why certain traits, such as deceptive mimicry in butterflies or cooperative hunting in wolves, persist at stable levels.
Likewise, the study of signalling games explains how animals evolve honest communication mechanisms, such as the extravagant plumage of peacocks, which signals genetic fitness to potential mates.
Ultimately, evolutionary game theory reveals that nature is not merely a battleground of relentless competition but a dynamic interplay of adaptive strategies and equilibrium.
Cooperation and conflict are not opposing forces but complementary aspects of survival, finely honed through the mechanisms of natural selection.
Finding Stability in Strategy With the Nash Equilibrium
Let’s finish by looking at the concept of the Nash equilibrium, a state in which no player has an incentive to deviate from their chosen strategy, assuming that all others maintain theirs.
It is named after the renowned mathematician John Nash, whose ground-breaking work revolutionised the field of game theory.
And the Nash equilibrium encapsulates the idea of strategic stability. Once this equilibrium has been reached, no rational player can improve their outcome by unilaterally altering their decision.
The classic Prisoner’s Dilemma provides a compelling example. When both prisoners choose to defect, they arrive at a Nash equilibrium — not because it is the best possible outcome, but because neither can benefit from changing their choice while the other’s decision remains fixed.
This illustrates a crucial insight: a Nash equilibrium is not necessarily socially optimal.
Nash equilibria appear across diverse strategic settings, from competitive business environments to diplomatic standoffs.
As we discussed earlier, in oligopolistic markets, firms setting prices must consider their competitors’ strategies. If each company chooses its pricing optimally given the others’ prices, a Nash equilibrium is reached — altering prices unilaterally would only reduce profits.
Similarly, in international relations, nations may engage in military build-ups or trade stand-offs where no country has an incentive to shift its stance unless others do the same.