The Prisoner's Dilemma feature image

The Prisoner's Dilemma

Written by Tasos Piotopoulos
Lead Software Engineer | M.Sc. | Published Author | Meetup Organizer

An optimal decision for an individual and an optimal decision for a group often look quite different. That is the conclusion of a famous cognitive experiment, part of Game Theory, known as The Prisoner’s Dilemma.

I’m an optimist in the sense that I believe humans are noble and honorable, and some of them are really smart. I have a somewhat more pessimistic view of people in groups. – Steve Jobs

Imagine you were a seasoned robber and had a partner in crime; let’s call her Alice. One day, while robbing a bank, as usual, your escape plan goes south, and both of you get captured by the police. Although they don’t have enough evidence to convict you for robbery, they put you in separate jail cells and make each of you the following offer, starting with Alice:

“If neither of you speaks, you will both be convicted for illegally possessing firearms and spend one year in prison each. If you snitch on your partner, we shall consider him the sole responsible for the robbery, you will walk free, and he will serve thirty years in prison. That is unless he does the same and snitches on you, in which case you will split the sentence and be imprisoned for fifteen years each.” Two robbers holding loot

Alice assesses her only two options: to betray you or to remain silent. If you betray her, then her best option is to do the same. That way, she will be imprisoned for fifteen years instead of thirty. Even if you choose to remain silent, it is still in her best interest to betray you, allowing her to walk free, as opposed to staying in prison for one year.

No matter how you choose to act, the dominant strategy for Alice - what rationally looks like the best option - is to betray you, and of course, that works both ways; on your end, you reach the exact same conclusion.

You and Alice may have robbed plenty of banks together, but you don’t exactly trust each other. So, acting rationally and in your own best interest, you betray each other and spend fifteen rough years in prison.

From a mathematical standpoint, each party’s choice was solid. But the result of your non-cooperation is much worse than the result you would enjoy if you stood together in unity.

What can we learn from an imaginary robbery?

As it turns out, we deal with situations like the Prisoner’s Dilemma all the time, in various forms and sizes. By acting in our self-interest and focusing on immediate rewards, we can easily undermine the outcome of a whole group, with potentially devastating long-term consequences.

A typical example would be the use of pirated software. In theory, a creator should be able to survive financially, even if a small number of individuals use unauthorised copies of his software. For any individual, the ideal scenario would be to use the software for free and let everyone else deal with supporting the creator.

But if everyone were to use the software for free, the creator wouldn’t survive in their profession, hence it wouldn’t be viable to create the software in the first place. Preventing software to be created is a negative outcome for all parties, so perhaps in the long run it is preferable for everyone to do their part and support creativity, rather than punish it.

If everyone waits for everyone else to act, then nobody will.

Another example, from the corporate world this time, is for different teams or executives of the same company to compete for turf. Rather than working together towards their common mission and vision, they choose to engage in micropolitics and foul practices with the sole purpose of promoting their localized agendas. And it doesn’t stop there.

Sometimes a team expresses the need to feel superior to the rest of the company. The members of such a team are usually more interested in continuously demonstrating their “superiority” to others, rather than working towards achieving the company’s goals. A peacock

Even within the boundaries of a team, members may be acting as adversaries, antagonizing each other, fighting for the next promotion, blaming, finger-pointing, and turning the workplace into another version of Hunger Games. Of course, all in the expense of meaningful work getting done.

Any short-term benefits deriving from such approaches are never a good trade-off. From introducing blockers and derailing projects, to creating a toxic environment and destroying morale, the long-term consequences of such narcissistic behaviors can be dire for a company and its net results.

On the other hand, when every group member is on the same page and works towards the same set of goals, everyone’s force is amplified and multiplied, shifting focus from quick and shallow personal wins to a far more positive outcome for the whole group. To paraphrase Aristoteles:

When a group works in harmony towards a common set of goals, the whole is greater than the sum of its parts.

In an ideal world, such an aspiration would be more than enough to put us in the right path. As you can imagine, that is not the case; we need something more.

A practical solution to the Prisoner’s Dilemma

Given the frequency humanity comes across the Prisoner’s Dilemma, we have created some practical solutions to help us. Perhaps the most prevalent one is what we call society.

Every society has members, rules, and mechanisms to ensure that members adhere to the rules or, in some cases, that members are incentivised towards desired objectives. In Game Theory, this is called mechanism design.

Imagine that you and Alice are members of a criminal organisation called The Mafia. The Godfather, an authority who can change the rules of the game, makes you an offer you can’t refuse: “If you betray your partner, you will sleep with the fishes”. Two robbers holding loot

Now, if either of you chooses to snitch on the other, there is a huge risk of doing so for the last time. Once you get captured, the dominant strategy is to cooperate without hesitation, and strangely enough, the fear of death leads both of you to the optimal solution.

Fear is not the only effective mechanism though. If Alice had more robberies planned, she would soon face the same dilemma again. Hence, her choice to betray you or not would have a significant impact on all her future endeavours.

According to an experiment by Robert Axelrod, described in The Evolution of Cooperation, the prevalent strategy in a repeating Prisoner’s Dilemma is not betrayal, but that of tit for tat. A player always starts as trustworthy and loyal, then subsequently imitates the other player’s previous action; if he got trusted, he would trust again, but if he got betrayed, he would betray. Five star rating

Therefore, another effective mechanism of society is accountability through reputation. Even with The Godfather out of the picture, if word gets out that Alice is a snitch, she will undoubtedly struggle to work as a robber again.


So that is The Prisoner’s Dilemma. Sometimes our dominant strategy is far from optimal. And even though cooperation would bring everyone to a much more advantageous position, anti-social behaviour can be observed everywhere.

Don’t just expect others to act; do your part and lead by example. Build trust, credibility, and rapport with others in your groups, as the reputation you build for yourself follows you everywhere. It doesn’t only hold you personally accountable, but it also affects the decision-making process of others, contributing to the overall success or failure of your group’s objectives.

Whenever possible, look for games where the dominant strategy is integrity, then just act naturally. And the one thing that I really want to leave you with is that, in a sense, the best thing we can do for ourselves is to stop caring only about ourselves.

p.s. The Prisoner’s Dilemma is extensively described in the book Algorithms to Live By, which I highly recommend.

Until next time!