Pages

Showing posts with label zero-sum games. Show all posts
Showing posts with label zero-sum games. Show all posts

Saturday, March 17, 2012

Game Theory XII: Randomness

We have seen that sometimes, it is to a player's advantage to remove one of their own options. Is it ever to a player's advantage to take their choice of action out of their own hands?

The following material is flagged Green Level. It is intended to reflect material that the author believes to be a matter of consensus among experts in the field. This belief may be incorrect, however; and as the author is not an expert and does not have an expert fact-checking the article, errors may creep in.
Before we start on this discussion, a vaguely relevant video. Spoilers for a certain VN/anime/manga series, even though it manages to not name many names.

But back to the question. Let's return to the game we started with:



A B
A (-1,1) (1,-1)
B (1,-1) (-1,1)
As you can see, this is a zero-sum game in which your objective is to make a different move from your opponent. But suppose your opponent knows you very well. Suppose your opponent knows you so well that they know what you will do. For instance, we'll say that you're playing this against a computer that has a complete copy of your brainstate loaded into it. No matter what you think, the computer can predict your thoughts. And no matter what you decide, the computer can know what you will do.

So, since you lose if you pick A, and you lose if you pick B, what do you do?

You make your move based on something that cannot be predicted, something that even you cannot predict. You make your move random. Flip a coin, spin a roulette, or roll a die. You play what is called a mixed strategy.

Now, let's put together a general form of this:


A B
A (-A,A) (B,-B)
B (C,-C) (-D,D)
where A,B,C,D>0

So, if we play a mixed strategy, we need to figure out what odds we should give to each move (assuming that your opponent will assign the same odds):

Odds of Playing A Outcome
0%-D
25%-(1/4*1/4)A+(1/4*3/4)B+(3/4*1/4)C-(3/4*3/4)D
=-A/16+3B/16+3B/16-9D/16
50%-(1/2*1/2)A+(1/2*1/2)B+(1/2*1/2)C-(1/2*1/2)D
=-A/4+B/4+C/4-D/4
75%-(3/4*3/4)A+(3/4*1/4)B+(1/4*3/4)C-(1/4*1/4)D
=9A/16+3B/16+3C/16-D/16
100%-A

<<Metagames: The Punishing Prisoner's Dilemma | Game Theory | Metagames: The Instantaneous Punishing Prisoner's Dilemma>> 

Sunday, September 11, 2011

Topic: Game Theory

On this blog, I will sometimes discuss ideas over the course of multiple posts. I will call these ideas Topics, and collect them in posts like this one.

Game theory is a branch of mathematics dealing with the interactions between agents capable of making decisions. It provides understanding of how to benefit oneself as well as how to benefit both oneself and others, and can provide interesting insights into society.

  1. Notation and Basic Concepts
  2. Dominating Strategies
  3. Utility Functions 
  4. Non-Zero-Sum Games: Chicken 
  5. Non-Zero-Sum Games: The Simple Prisoner's Dilemma 
  6. Cyclic Games: The Iterated Prisoner's Dilemma I: Reciprocal Relationships 
  7. Cyclic Games: The Iterated Prisoner's Dilemma II: The End of the Game.
  8. Metagames: The Battle of the Sexes 
  9. Coordination and Anti-Coordination 
  10. Metagames: Extortion 
  11. Metagames: The Punishing Prisoner's Dilemma 
  12. Randomness 

Game Theory: Part II: Dominating Strategies

And now on to the next item in the discussion of game theory: strategies that are absolutely better than other strategies.

The following material is flagged Green Level. It is intended to reflect material that the author believes to be a matter of consensus among experts in the field. This belief may be incorrect, however; and as the author is not an expert and does not have an expert fact-checking the article, errors may creep in.
Suppose that I offer you two possible bargains: either I will give you $1, or I will flip a coin and give you $1 if it lands heads, nothing otherwise. It would make sense for you to pick the first offer, right?

Right. The first offer a) is never worse than the second offer, and b) is sometimes better than the second offer. Similar situations can happen in game theory. Let us look at the following:


A

B
A $1 $2
B$-2$0
You would obviously be better off picking choice A. No matter what I pick, A is always better for you than B. So what will I pick?

That's right. Since I know you will pick A, I will minimize my losses and pick A as well. If you were to change your choice in response to my choosing A, I would only be pleasantly surprised, and the same would still be true if I were to pick B. Thus, you are always better off picking A.

And this leads to the main subject of this post: dominating strategies. A strategy (the game-theory term for a particular move or action) is considered dominating over another one if it is a) never worse for the player choosing it, and b) better at least once for the player choosing it.

So, here's where the core principle of game theory gets into it. Because your opponent is acting intelligently, (or at least non-randomly), your opponent is allowed to choose strategies. Barring unusual circumstances (such as the iterated prisoners' dilemma) that will be mentioned later, a rational opponent (that is, one acting in its own best interest) will never choose a dominated strategy. In a zero-sum game, it is generally best to assume that your opponent will never choose a strategy if one that always hurts you at least as much is available.

So, given the following game, what do you do?



A

B
C
A$0$0-$1
B$1$1$1
C$1$0$2
Let's look at this. Your opponent will never play A, because A is dominated by B.




B
C
A
$0-$1
B
$1$1
C     $0$2
 You will never play A, because A is dominated by all other strategies.





B
C




B
$1$1
C     $0$2
Your opponent will never play C, because C is dominated by B.





B





B
$1
C     $0     
You will never play C, because C is dominated by B.




B





B
$1

    
     

And so we have the final outcome: both players will play B, resulting in you winning $1. Thus, for you, the value of this game is $1, and the value for your opponent is -$1.
<<Notation and Basic Concepts | Game Theory | Utility Functions>>

Saturday, August 27, 2011

Game Theory: Part I: Notation and Basic Concepts

Yes, evolution of cooperation, blah blah blah. I realized partway through that I needed some background material for that that I hadn't covered, and it's from a separate discipline. So let's start talking about game theory.

The following material is flagged Green Level. It is intended to reflect material that the author believes to be a matter of consensus among experts in the field. This belief may be incorrect, however; and as the author is not an expert and does not have an expert fact-checking the article, errors may creep in.
 So. What is this "game theory" thing? You may have heard some people talk about the "prisoners' dilemma" or the game of "chicken". Both of those are from game theory, which is essentially a branch of mathematics. And I will do my best to describe here how that works.
Let us suppose that you and I play a game. I will write down a letter (A or B) and you will try to guess it. If you guess correctly, I give you $1; if you guess incorrectly, you give me $1. This game can be represented as follows, where what you do is on the left, what I do is on the top, and what you get is in the intersection.



A

B
A $1 -$1
B-$1$1
(Incidentally,this is what is called a zero-sum game: if you get anything, it hurts me exactly as much as it helps you. Most real applications of game theory do not deal with zero-sum games, but they are the easiest to understand.)
So what, you ask. What does this have to do with the Real World? Well, suppose instead that the two of us are generals. Your force is strong, but mine is stealthy. If we send our armies to the same location, yours will stomp mine, but if we send them to different locations, mine will take the objective of the skirmish.
In essence, game theory is a subject with a broad variety of applications. Game theory can be applied to any situation (called a game) where 1) there are multiple players involved, 2) the actions of each player have an impact on the outcome for that player, and 3) the actions of each player have an impact on the outcomes for other players. This covers "games" ranging from "Guess the Letter" above to the games of "Crash the Economy" played on Wall Street.
To make this game a bit more interesting, let's add the following change: if you guess "B", the payment is doubled. The game now looks like this:



A

B
A$1-$1
B-$2$2
Now, let's try to figure out what the best move for me to make is. Looking at the numbers, it looks like "A", right? If you guess wrongly, I win $2, but if you guess correctly, you win $1.
Wrong. Remember, you have a choice as well. Because you think I am likely to play "B", you choose to play "B". My payoff is -$1.
But let's say that I guess that you will reason that way, and choose to play "A". My payoff is now $1.
But then you anticipate my anticipation of your reasoning, and play "B". My payoff is now -$2. And so on to infinity. This is what makes game theory more than just an expected-value calculation: the non-random actions of another player.

So, how can we resolve this? Let's say that you manage to get a good look at what I write. This allows you to pick whatever I wrote. However, due to my psychic powers, I was able to know ahead of time that you would see it, and act accordingly. Thus, I choose to write the letter that will lose me the least (called my maximin solution), "A". You see that I have written "A", and guess "A", winning $1.

Alternately, let's say that you don't get a good look, but that I still have psychic powers. I know ahead of time what you are going to guess, and will write the letter that will gain me the most (called my minimax solution). But you know about my psychic powers, and choose to guess the letter that will lose you the least. Thus, you choose "B", forcing me to write "A". You lose $1.

<<First in Topic! | Game Theory | Dominating Strategies>>