If You See Life as a Game, You Better Know How to Play It

Author:Murphy  |  View: 27516  |  Time: 2025-03-22 23:50:09
Image made by the author using Midjourney

Somewhere in an uncharted galaxy, you and your friend are being held prisoners by an enigmatic group of extraterrestrial beings. They promise to let you go if you beat them in one of their games. You sit at a cosmic table with one of the aliens who distributes bags containing both a black and a white rock. When the game starts, every player will select a rock and put it on the table. The winner is whoever picks the rock with a different color. This means, whoever chooses black when the other two choose white or whoever chooses white when the other two choose black. Every time someone wins, they will give you a coin to pile up on your side of the table. You will play the game a million times, and the ultimate winner is the one with more coins at the end. Besides the rules of the game, the only other information you have is that the alien always plays black with a 50% probability. Seconds before the game starts, your partner whispers the strategy you should follow. After a million games, the final score declares both of you as the winners. Was this pure luck? How important was your partner's strategy?

Introduction

It is highly improbable that you will end up in a situation like the one described above. However, the game proposed by the aliens can be extrapolated to a more realistic situation. Our lives are filled with multiple interactions in which we decide things either instinctively or deliberately. Many of these decisions depend on someone else's decision and many others depend on events we cannot control. In any case, our responses are rarely random and more a product of our rational analysis. This means that in each interaction we face, we decide depending on what brings us the bigger benefit. This also means that we can have different strategies according to different interactions. This article is about the strategies we take, the payoffs we get, and Game Theory.

Game Theory 101

You have likely seen the film A Beautiful Mind about the renowned mathematician John Nash or you have heard about the multiple Nobel prizes awarded to game theorists. Game Theory is an interesting field of Mathematics with many real-life applications. In Game Theory, strategic interactions between different agents are modeled mathematically and then these models are used to generate predictions or better understand a particular process. Depending on the type of interactions or number of players, the mathematical models can be very elaborate or a simple set of equations. Whichever the case, having a small glimpse into the world of Game Theory is not only interesting but useful.

Before going back to the alien's table let's analyze a simpler game. Is Friday night and you are trying to decide what to eat. A group of your friends wants pizza and a different group wants hamburgers. The pizza will take 30 minutes to arrive whereas the hamburgers are delivered in 15 min. These are the scenarios:

  • Both groups order pizza. In this case, there is a group that will not be happy with the choice
  • Both groups order hamburgers. In this case, there is a group that will not be happy with the choice
  • One group orders pizza and the other group orders hamburger. In this case, if both groups wait for all the food to arrive, one group will have to eat their food cold

Let's say that group A wants pizza and group B wants hamburgers. We can write this scenario in a matrix such as this one:

Table 1. Payoff matrix for the Pizza/Hamburger example. Numbers represent how happy each group is with their choices. (Graphics made by the author)

The numbers on each scenario are known as payoffs and represent the consequences of each combination of choices. The first number is the payoff for group A whereas the second number is the payoff for group B. Specifying the payoffs is a very important part of a Game Theory analysis and it is not always straightforward. Payoffs can represent multiple things. In this case, we are arbitrarily assigning a number that represents how happy each group is with their choices. It would be like asking each group beforehand how happy would they be if they had hamburgers or pizza on a scale of 0 to 5. As you can see, there is no way of having both groups with maximum happiness since in the case in which group A orders pizza and group B orders hamburgers, the pizza arrives late and group B will eat their hamburgers cold. However, this is not as bad as not eating hamburgers! The combination of group A ordering pizza and group B ordering hamburgers represents a solution from which neither of the groups wants to deviate. This is known as the Nash Equilibrium.

In a Nash Equilibrium, no one can increase one's own expected payoff by changing one's strategy while the other players keep theirs unchanged. In the previous example, the solution (5,3) represents a Nash Equilibrium because group A cannot increase its payoff (it is already the maximum) and group B cannot increase its payoff either, a change in strategy will only reduce the payoff. Another classic example that is used to explain the Nash Equilibrium is the famous Prisoner's Dilemma.

In the Prisoner's Dilemma, two prisoners are being interrogated by the police, they have the option of confessing or staying silent. The payoffs corresponding to each strategy change according to Table 2. In this case, the payoff is the number of years they would spend in jail. This means that the smaller the number, the better the payoff. Since neither of the prisoners knows what the other will do, the equilibrium corresponds to the scenario where both prisoners confess the crime. Here is the tricky part: At first glance, the payoff table indicates that the best strategy for both prisoners as a team is to stay silent. However, they do not know what their partner will do. Even if they know that their partner will stay silent, the best strategy from an individual point of view is to confess since confessing would reduce jail time from one year to nothing. This means that the Prisoner's Dilemma has only one Nash Equilibrium and is the strategy where both prisoners confess.

Table 2. Payoff matrix for the Prisoner's Dilemma. Numbers represent the number of years in jail. (Graphics made by the author)

Before going back to the aliens and their game it is important to note that some interactions might have more than one Nash Equilibrium whereas other interactions might not have a Nash Equilibrium if we only take into account pure strategies. Pure strategies correspond to a single and specific plan. This means staying silent or confessing or also buying pizza or buying hamburgers. On the other hand, mixed strategies assign a Probability to each plan. We could say that a prisoner has a 75% chance of staying silent and, consequently, a 25% chance of confessing. In any finite game, we can be sure that there is, at least, one Nash Equilibrium. This equilibrium might be in a pure or mixed strategy form or also a combination of them. Now that we know this, it is time to sit back at the cosmic table with the aliens.

Back to the cosmic game

Figure 1 explains the payoffs and the game's strategies. This game is a modified version of the classical game matching pennies. There are 8 possible scenarios and in two of them, nobody wins. These are the cases where the three players select the same color. In the rest of the scenarios, someone wins either by selecting black when the rest select white or selecting white when the rest select black. This game does not have a pure strategy Nash Equilibrium since there is no strategy that satisfies all players. However, it does have a mixed strategy Nash Equilibrium. Let's calculate this first before solving the initial problem.

Figure 1. Scenarios and payoffs for the Cosmic Game example. (Graphics made by the author)

To calculate a mixed strategy Nash Equilibrium, we start by assigning probabilities to each strategy. Figure 2 shows the letter that identifies the probability of playing black or white for each player.

Figure 2. Strategies and probabilities of each player in the Cosmic Game. (Graphics made by the author)

Let's take the example of the alien. For the alien finding a strategy where he does not care if he plays black or white is the same as finding probabilities r and q so that playing black or white yields the same result. We can express that through the following equation:

If we do the same analysis for all the players we will end up with a group of equations that tells us the probabilities that represent a mixed strategy Nash Equilibrium. In this case p=q=r=0.5. Another way of looking at this is realizing that if the three players select the color of the rock with a 50% probability, then after an infinite number of games they will all get the same payoff. The expected value for all of them is the same. This is a link to a Jupyter Notebook in which you can simulate this game multiple times changing the probabilities of each player.

In the particular case of the problem introduced at the beginning of this article, we are not interested in finding a Nash Equilibrium among the three players. On the contrary, we are interested in finding a strategy in which we always win over the alien. The information we have about him is crucial. If we already know that he will play black with 50% probability then we can ask our friend to play black while we play white and this will guarantee that one of us will win each game. If we play this game an infinite number of times then the alien will end up with zero coins while we will split the rest of the coins. Table 3 shows a payoff matrix for only two players assuming the alien will play black with 50% probability. Note how there are two Nash Equilibriums, in which either Tom or Mike get a payoff of 1 by playing opposite strategies.

Table 3. Payoff matrix for two players in the Cosmic Game assuming the alien plays black with 50% probability. (Graphics made by the author)

It was possible to beat the alien at his own game after all! Knowing that he always plays black with a 50% probability allows your friend to play black and you to play white (or vice versa) and win every game. However, if we had no prior information about the alien's strategy, then our best option was to play black or white with a 50% probability. Game Theory is not only useful in hypothetical scenarios such as this one but in many other more realistic scenarios. Let's review another example.

The trick of the protection plan

After saving all year and waiting for Black Friday, you finally decide you will buy the $1000 TV you always wanted. Just before checking out, the cashier asks you if you want to buy a protection plan (PP) for "just $175 more". This protection plan will cover expenses related to your TV in the following 4 years. Is this a good idea?

We can analyze this problem like a two-player game: the company that sells the TV and the protection plan is a player and the buyer is the other player. If we assume that the average cost to repair a TV is $500, the payoff matrix would look like this:

Table 4. Payoff matrix for the Protection Plan example. Numbers represent costs/profit. (Graphics made by the author)

In the previous matrix, the first number corresponds to the company's payoff and the second number is the buyer's payoff. The values were calculated as follows:

The buyer adds PP:

If the TV breaks down:

  • Payoff(buyer): cost of TV + cost of the PP: -1000–175 = -1175
  • Payoff(company): revenue TV + revenue PP – cost of repairs= 1000+175–500=675

If the TV doesn't break down:

  • Payoff(buyer): cost of TV + cost of the PP: -1000–175 = -1175
  • Payoff(company): revenue TV + revenue PP = 1000+175 = 1175

The buyer doesn't add PP:

If the TV breaks down:

  • Payoff(buyer): cost of TV + cost of repairs: -1000–500 = -1500
  • Payoff(company): revenue TV = 1000

If the TV doesn't break down:

  • Payoff(buyer): the cost of TV: -1000
  • Payoff(company): revenue TV = 1000

Note how there is a pure strategy Nash Equilibrium in the case where the buyer does not add the PP and TV does not break down. This is the lower right box in Table 4. This makes total sense since if we do not add the PP then our best scenario is that the TV keeps working without have to repair it. On the other hand, if we decide to not buy the PP, then the seller will make the same amount of money regardless of whether the TV breaks down or not.

Finding the pure strategy Nash Equilibrium is important to understand this scenario but it is not answering our initial question yet. In order to do so, we need to consider the probability of TV breaking down in the first 4 years. Let's assume that q represents this probability. In this case, the expected value of the buyer considering this probability is:

Note how we are calculating the expected value in the case in which the seller adds the PP and the case in which he buys the TV without adding the PP. In a worst-case scenario in which we are absolutely sure that the TV will break down (q=1), the buyer will pay $1175 if he adds the PP and $1500 if he does not. We can find the probability at which the expected value of adding the PP and not adding the PP is the same which is q=0.35. Figure 3 shows the expected values with respect to q in the case in which we add the PP and the case in which we do not add it. This plot tells us that if the probability of the TV breaking down is less than 0.35, then it is better to not add the protection plan.

Figure 3. Costs in terms of the probability of the TV breaking down when the buyer adds or waives the Protection Plan.

Take into account that the value of 0.35 is calculated from the costs stated previously. In fact, in this case, the value of q that equalizes the expected values of adding or not adding the PP only depends on the cost of the PP and the cost of the repair.

If repairing the TV gets more expensive, then the TV breaking down probability above which is better to add the PP, decreases. On the other hand, increasing the price of the PP will also increase q. Note how the more that the cost of the PP approximates the repair cost, the less recommended it is to buy the PP regardless of the probability of the TV breaking down. This is a link to a Jupyter Notebook where you can calculate the expected cost for the buyer after changing any of the variables and running many iterations.

We can also analyze this problem from the seller's point of view. A seller could ask the question: "Knowing that the probability of a TV breaking down in the first 4 years is x, what should be the price of the PP so that I don't care if people add the PP or not?" For this case, we can also calculate the expected values in the case of adding the PP or not but this time with the seller's payoff:

Note how the right side of the equation corresponds to the price of the TV. This means that if the TV breaks down with a probability of 0.35, the seller will have the same expected value ($1000) regardless of what the buyer decides to do. Now, what are the chances of a TV breaking down in the first 4 years? It might be difficult to answer this question since every TV is different. However, a quick Google search indicates that the value might be around 4% (0.04). If this is the case, then the cost of the PP so that the expected values equalize is 0.04 x 500 = $20. This means that by setting the PP to $175 the seller has an expected value of $1155 when a buyer adds the PP and $1000 when it does not! Quite a good deal!

The previous explanation shows how a seller or a company can use Game Theory to determine the best price for its service so that the expected value after many sales is favorable. Here is a link to a Jupyter Notebook where you can calculate the expected value for the seller by changing any of the variables and running many iterations.

Conclusion

From fictitious scenarios such as alien' encounters to going shopping, our lives are filled with decisions that carry different consequences. These consequences are not only a product of our decisions but of other's decisions which in turn depend on someone else's decisions. While we cannot control what others do, we can learn to analyze every problem as a game that involves players, strategies and payoffs. This is exactly what Game Theory stands for and why it has so many applications. Next time you are faced with a decision to take, remember this! It might save some bucks or a few years in jail!

Tags: Decision Making Deep Dives Game Theory Mathematics Probability

Comment