Datascience in Towards Data Science on Medium,

Game Theory, Part 3 — You are the average of the five people you spend the most time with

11/13/2024 Jesus Santana

Game Theory, Part 3 — You Are the Average of the Five People You Spend the Most Time With

Is Tit-for-tat the best strategy in the Iterated Prisoner’s Dilemma game?

This article will explore how Game Theory illustrates the popular saying, “You are the average of the five people you spend the most time with.” Through examples from the Iterated Prisoner’s Dilemma game, we can see how individual behavior and outcomes are shaped by the surrounding strategies — whether cooperative or not— of those in the same environment.

Image generated using GPT-4o

I discussed the Prisoner’s Dilemma Problem and Iterated Prisoner’s Dilemma games in the first two articles on the game theory series. This article is Part 3 of my game theory series, so if you haven’t read the first two articles, I recommend checking them out first.

Part 1 discusses the classic Prisoner’s Dilemma Problem and highlights Game Theory’s relevance in many real-world scenarios. Part 2 describes the Iterated Prisoner’s Dilemma game with the help of an example where Kratika and Ishita, the CEOs of two competing food delivery platforms, try different strategies to compete. It also discusses Robert Axelrod’s famous tournament, which revealed that the most successful strategies share key traits: they are “nice” (starting with cooperation), forgiving (but not overly so), willing to retaliate when provoked, and clear in their approach.

Different strategies

The Tit-for-tit strategy is when the player starts the game cooperating and mirrors the opponent’s move in the next move. The Tit-for-two-tats strategy is when the player starts by cooperating but defects if the opponent defects for two consecutive moves. There were similar strategies developed by Game Theorists like Two-tits-for-tat where the player starts by cooperating but defects twice if the opponent defects. There were strategies in which the player plays Tit-for-tat with a certain probability and defects occasionally, and Tit-for-n-tats where the player defects after the opponent defects n times.

For simplicity, Kratika simulates a tournament with ten strategies: Tit-for-tat, Tit-for-two-tats, Two-tits-for-tat, Always cooperate, Always defect, Pavlov, Grim trigger, Reverse tit-for-tat, Random, and Defect until cooperate.

def two_tits_for_tat(self, opponent_previous_moves):
if len(opponent_previous_moves) == 0:
return self.cooperate
if opponent_previous_moves[-1] == self.defect:
return self.defect
if (self.my_moves[-1] == self.defect and self.my_moves[-2] == self.defect):
return self.cooperate
if self.my_moves[-1] == self.defect:
return self.defect
return self.cooperate
Kratika’s Round-Robin Tournament with different strategies and their properties. Pic Credits — Author

The two-tits-for-tat finished last among the nicer strategies. This is because two-tits-for-tat is a highly retaliatory and less forgiving strategy. Kratika’s latest simulation further buttresses the conclusions of the previous article.

Is Tit-for-tat the best strategy?

The Tit-for-tat-type strategies have been the best in our games. Does that mean they are the best strategy?

The answer is no, surprisingly.

Let’s analyze Kratika’s games when the Tit-for-tat family of strategies was played.

Tit-for-tat scorecard from Kratika’s simulation. Pic Credits — Author
Tit-for-two-tats scorecard from Kratika’s simulation. Pic Credits — Author
Two-tits-for-tat scorecard from Kratika’s simulation. Pic Credits — Author

Observations —

  1. Tit-for-tat and Tit-for-two-tats didn’t win a single face-off. Two-tits-for-tat could only defeat the Random strategy. At their best, they managed to draw the opponent’s strategy. They focussed on maximizing profits even in a losing position.
  2. Tit-for-tat, Tit-for-two-tats, and Two-tits-for-tat lost to nasty strategies. Strategies that defect early take advantage of Tit-for-Tat’s initial cooperation, and once this early loss occurs, Tit-for-Tat cannot fully recover.

In the environment where Kratika simulated the tournament, participants each picked a different strategy.

What if the tournament happened in an environment where one player opted for Tit-for-tat and the rest always defected? The results would be catastrophic for the player with the Tit-for-tat strategy. This is Tit-for-tat’s weakness. Kratika performed the simulations and observed that the player with the Tit-for-tat strategy earned 174.125 units compared to 175.5 units each earned by others.

On the contrary, when Kratika tried to simulate games by replacing the strategy for the rest of the players with strategies relatively nicer and relatively more forgiving than Always defected (but still nasty since they all defected at the start), Tit-for-tat managed to score 437.5 and the rest scored 212.5 units each.

What’s the conclusion?

  • Tit-for-tat strategies excel in an environment of nice or like-minded strategies.
  • Tit-for-tat pursues cooperation in the form of niceness and forgiveness. Relatively nicer and more forgiving strategies helped raise the profits earned by every player (from 175.5 to 212.5)!
  • Tit-for-tat encourages progressiveness and controlled aggression. It starts with cooperation, quickly retaliates against defection, but forgives occasional defections.
  • Always Defect is a non-progressive and self-protective strategy. It creates stagnant and low-profit outcomes for everyone.
You are the average of the five people you spend the most time with.

In an environment dominated by nasty players, the overall profits for all players dropped to around 175, as the nasty strategies dragged everyone down, including those using nicer strategies. The players who initially chose cooperation might even feel tempted to adopt nastier tactics to keep up.

Conversely, when the environment included fewer players with the “always defect” strategy, those using “tit-for-tat” helped to raise the overall profits, benefiting everyone. This shows how nice strategies can elevate the group, while the nasty ones pull everyone down.

If Kratika and Ishita want to earn more profits, they must opt for a progressive strategy that begins with cooperation and encourages mutual growth. By quickly retaliating against selfish behavior but remaining open to forgiveness, players can cultivate a cooperative environment that benefits everyone in the long run.

I hope you found this article insightful and engaging. Veritasium’s excellent video on game theory inspired this three-part series of articles. I encourage you to watch this video.

I undertook a game theory class during my master's degree. This video reignited my interest in game theory. The upcoming articles in the game theory series will explore other games and interesting facets of game theory.

Stay tuned for the next articles! Thank you for reading this article!


Game Theory, Part 3 — You are the average of the five people you spend the most time with was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.



from Datascience in Towards Data Science on Medium https://ift.tt/C82UtBD
via IFTTT

También Podría Gustarte