Game Theory (Part 14)

18 February, 2013

Here is the first test in our game theory course. If you’re following along on this blog, you can do it and then look at the answers below.

Definitions

1. Define a Nash equilibrium for a 2-player normal form
game.

2. Define the expected value of some function with respect to some probability distribution.

Proof

3. Suppose A and B are the payoff matrices for 2-player normal form game. Prove that if (i,j) is a Nash equilibrium, there cannot exist a choice i' for player A that strictly dominates choice i.

2-Player normal form games

Consider this 2-player normal form game:

\begin{array}{rrr}   (-2,1) & (4,2) & (2,-5)  \\    (2,3) & (-6,2) & (5,3) \\   (1,0) & (2,-4) & (4,-3) \end{array}

4. Find all the Nash equilibria. Draw a box around each Nash
equilibrium.

For problems 5-8 do not simplify your answers by working out the binomial coefficients, etc.

Probabilities

5. If you draw 3 cards from a well-shuffled standard deck,
what is the probability that at least 2 are hearts?

6. If you flip 4 fair and independent coins, what is the probability that exactly 2 land heads up?

Expected values

7. Suppose you pay $2 to enter a lottery. Suppose you have a 1% chance of winning $100, and otherwise you win nothing. What is the expected value of your payoff, including your winnings but also the money you paid?

8. Suppose you draw two cards from a well-shuffled standard deck. Suppose you win $100 if you get two aces, $10 if you get one ace, and nothing if you get no aces. What is your expected payoff?

Extra credit

About how many ways are there to choose 3 atoms from all the atoms in the observable universe? Since this question is for extra credit, I’ll make it hard: I’ll only accept answers written in scientific notation, for example 2 \times 10^{50}.


And here are the answers to the first test.

Definitions

1. Given a 2-player normal form game where A’s
payoff is A_{ij} and B’s payoff is B_{ij}, a pair of choices (i,j) is a Nash equilibrium if:

1) For all 1 \le i' \le m, A_{i'j} \le A_{ij}.

2) For all 1 \le j' \le n, B_{ij'} \le B_{ij}.

2. The expected value of a function f : X \to \mathbb{R} with respect to a probability distribution p on the finite set X is

\sum_{i \in X} f(i) p_i

Note that a good definition makes it clear what term is being defined, by writing it in boldface or underlining it. Also, it’s best if all variables used in the definition are explained: here they are f, X and p.

Proof

3. Theorem. Suppose A and B are the payoff matrices for 2-player normal form game. If (i,j) is a Nash equilibrium, there cannot exist a choice i' for player A that strictly dominates choice i.

Proof. Suppose that (i,j) is a Nash equilibrium. Then

A_{ij} \ge A_{i' j}

for any choice i' for player A. On the other hand, if choice i' strictly dominates choice i, then

A_{i'j} > A_{i j}

This contradicts the previous inequality, so there cannot exist
a choice i' for player A that strictly dominates choice i. █


Note that the really good way to write a proof involves:

• First writing “Theorem” and stating the theorem.
• Saying “Proof” at the start of the proof.
• Giving an argument that starts with the hypotheses and leads to the conclusion.
• Marking the end of the proof with “Q.E.D.” or “█” or something similar.

2-Player normal form games

4. In this 2-player normal form game, the three Nash equilibria are marked with boxes:

\begin{array}{rrr}   (-2,1) & \boxed{(4,2)} & (2,-5)  \\    \boxed{(2,3)} & (-6,2) & \boxed{(5,3)} \\   (1,0) & (2,-4) & (4,-3) \end{array}

Probabilities

5. If you draw 3 cards from a well-shuffled standard deck,
what is the probability that at least 2 are hearts?

Answer. One correct answer is

\displaystyle{ \frac{\binom{13}{2} \binom{39}{1}}{\binom{52}{3}} +      \frac{\binom{13}{3} \binom{39}{0}}{\binom{52}{3}} }

since there are:

\binom{52}{2} ways to choose 3 cards, all equally likely,

\binom{13}{2} ways to choose 2 hearts and \binom{39}{1} ways to chose 1 non-heart, and

\binom{13}{3} ways to choose 2 hearts and \binom{39}{0} ways to chose 0 non-hearts.

Another correct answer is

\displaystyle{ \frac{\binom{13}{2} \cdot 39 }{\binom{52}{2}} +      \frac{\binom{13}{3}} {\binom{52}{2}}}

This is equal since \binom{39}{0} = 1 and \binom{39}{1} = 39.

6. If you flip 4 fair and independent coins, what is the probability that exactly 2 land heads up?

Answer. The probability

\displaystyle{ \frac{\binom{4}{2}}{2^4} }

since there are 2^4 possible ways the coins can land, all
equally likely, and \binom{4}{2} ways to choose 2 of the 4 coins to land heads up.

Expected values

7. Suppose you pay $2 to enter a lottery. Suppose you have a 1% chance of winning $100, and otherwise you win nothing. What is the expected value of your payoff, including your winnings but also the money you paid?

Answer. One correct answer is

0.01 \cdot \$98 \quad + \quad 0.99 \cdot (-\$ 2)

Another correct answer is

0.01 \cdot \$100 \quad + \quad 0.99 \cdot \$0 \quad - \quad \$2

Of course these are equal.

8. Suppose you draw two cards from a well-shuffled standard deck. Suppose you win $100 if you get two aces, $10 if you get one ace, and nothing if you get no aces. What is your expected payoff?

Answer. One correct answer is

\displaystyle{   \frac{\binom{4}{2} \binom{48}{0}}{\binom{52}{2}} \cdot \$100 \quad + \quad \frac{\binom{4}{1} \binom{48}{1}}{\binom{52}{2}} \cdot \$10 \quad + \quad      \frac{\binom{4}{0} \binom{48}{2}}{\binom{52}{2}} \cdot \$ 0 }

since \binom{4}{n} \binom{48}{3-n} is the number of ways to pick n aces and 3-n non-aces. Of course we can also leave off the last term, which is zero:

\displaystyle{  \frac{\binom{4}{2} \binom{48}{0}}{\binom{52}{2}} \cdot \$100 \quad + \quad     \frac{\binom{4}{1} \binom{48}{1}}{\binom{52}{2}} \cdot \$10 }

Since \binom{48}{0} = 1 we can also write this as

\displaystyle{  \frac{\binom{4}{2}}{\binom{52}{2}} \cdot \$100  \quad + \quad     \frac{\binom{4}{1} \binom{48}{1}}{\binom{52}{2}} \cdot \$10 }

Or, since \binom{4}{1} = 4 and \binom{48}{1} = 48 we can write this as

\displaystyle{    \frac{\binom{4}{2}}{\binom{52}{2}} \cdot \$100 +      \frac{4 \cdot 48}{\binom{52}{2}} \cdot \$10 }

But I said not to bother simplifying the binomial coefficents.

Extra credit

About how many ways are there to choose 3 atoms from all the atoms in the observable universe? Since this question is for extra credit, I’ll make it hard: I’ll only accept answers written in scientific notation, for example 2 \times 10^{50}.

Answer. In class I said the number of atoms in the
observable universe is about 10^{80}, and I said I might put this on the test. So, the answer is

\begin{array}{ccl} \displaystyle{ \binom{10^{80}}{3}} &=&  \displaystyle{ \frac{10^{80}(10^{80} - 1)(10^{80} - 2)}{3 \cdot 2  \cdot 1} } \\  \\ &\approx&   \displaystyle{ \frac{10^{80} \cdot 10^{80} \cdot 10^{80}}{6} } \\   \\ &=& \displaystyle{ \frac{10^{240}}{6} } \\   \\  &\approx & 1.667 \times 10^{239} \end{array}

Note that the question asked for an approximate answer, since we don’t know exactly how many atoms there are in the observable universe. The right answer to a question like this gives no more decimal places than we have in our data, so 1.667 \times 10^{239} is actually too precise! You only have one digit in the data I gave you, so a better answer is

\mathbf{ 2 \times 10^{239} }

Since the figure 10^{80} is very approximate, another correct answer is

\mathbf{ 10^{239} }

Prospects for a Green Mathematics

15 February, 2013

contribution to the Mathematics of Planet Earth 2013 blog by John Baez and David Tanzer

It is increasingly clear that we are initiating a sequence of dramatic events across our planet. They include habitat loss, an increased rate of extinction, global warming, the melting of ice caps and permafrost, an increase in extreme weather events, gradually rising sea levels, ocean acidification, the spread of oceanic “dead zones”, a depletion of natural resources, and ensuing social strife.

These events are all connected. They come from a way of life that views the Earth as essentially infinite, human civilization as a negligible perturbation, and exponential economic growth as a permanent condition. Deep changes will occur as these idealizations bring us crashing into the brick wall of reality. If we do not muster the will to act before things get significantly worse, we will need to do so later. While we may plead that it is “too difficult” or “too late”, this doesn’t matter: a transformation is inevitable. All we can do is start where we find ourselves, and begin adapting to life on a finite-sized planet.

Where does math fit into all this? While the problems we face have deep roots, major transformations in society have always caused and been helped along by revolutions in mathematics. Starting near the end of the last ice age, the Agricultural Revolution eventually led to the birth of written numerals and geometry. Centuries later, the Enlightenment and Industrial Revolution brought us calculus and eventually a flowering of mathematics unlike any before. Now, as the 21st century unfolds, mathematics will become increasingly driven by our need to understand the biosphere and our role within it.

We refer to mathematics suitable for understanding the biosphere as green mathematics. Although it is just being born, we can already see some of its outlines.

Since the biosphere is a massive network of interconnected elements, we expect network theory will play an important role in green mathematics. Network theory is a sprawling field, just beginning to become organized, which combines ideas from graph theory, probability theory, biology, ecology, sociology and more. Computation plays an important role here, both because it has a network structure—think of networks of logic gates—and because it provides the means for simulating networks.

One application of network theory is to tipping points, where a system abruptly passes from one regime to another. Scientists need to identify nearby tipping points in the biosphere to help policy makers to head off catastrophic changes. Mathematicians, in turn, are challenged to develop techniques for detecting incipient tipping points. Another application of network theory is the study of shocks and resilience. When can a network recover from a major blow to one of its subsystems?

We claim that network theory is not just another name for biology, ecology, or any other existing science, because in it we can see new mathematical terrains. Here are two examples.

First, consider a leaf. In The Formation of a Tree Leaf by Qinglan Xia, we see a possible key to Nature’s algorithm for the growth of leaf veins. The vein system, which is a transport network for nutrients and other substances, is modeled by Xia as a directed graph with nodes for cells and edges for the “pipes” that connect the cells. Each cell gives a revenue of energy, and incurs a cost for transporting substances to and from it.

The total transport cost depends on the network structure. There are costs for each of the pipes, and costs for turning the fluid around the bends. For each pipe, the cost is proportional to the product of its length, its cross-sectional area raised to a power α, and the number of leaf cells that it feeds. The exponent α captures the savings from using a thicker pipe to transport materials together. Another parameter β expresses the turning cost.

Development proceeds through cycles of growth and network optimization. During growth, a layer of cells gets added, containing each potential cell with a revenue that would exceed its cost. During optimization, the graph is adjusted to find a local cost minimum. Remarkably, by varying α and β, simulations yield leaves resembling those of specific plants, such as maple or mulberry.


A growing network

Unlike approaches that merely create pretty images resembling leaves, Xia presents an algorithmic model, simplified yet illuminating, of how leaves actually develop. It is a network-theoretic approach to a biological subject, and it is mathematics—replete with lemmas, theorems and algorithms—from start to finish.

A second example comes from stochastic Petri nets, which are a model for networks of reactions. In a stochastic Petri net, entities are designated by “tokens” and entity types by “places” which hold the tokens. “Reactions” remove tokens from their input places and deposit tokens at their output places. The reactions fire probabilistically, in a Markov chain where each reaction rate depends on the number of its input tokens.


A stochastic Petri net

Perhaps surprisingly, many techniques from quantum field theory are transferable to stochastic Petri nets. The key is to represent stochastic states by power series. Monomials represent pure states, which have a definite number of tokens at each place. Each variable in the monomial stands for a place, and its exponent indicates the token count. In a linear combination of monomials, each coefficient represents the probability of being in the associated state.

In quantum field theory, states are representable by power series with complex coefficients. The annihilation and creation of particles are cast as operators on power series. These same operators, when applied to the stochastic states of a Petri net, describe the annihilation and creation of tokens. Remarkably, the commutation relations between annihilation and creation operators, which are often viewed as a hallmark of quantum theory, make perfect sense in this classical probabilistic context.

Each stochastic Petri net has a “Hamiltonian” which gives its probabilistic law of motion. It is built from the annihilation and creation operators. Using this, one can prove many theorems about reaction networks, already known to chemists, in a compact and elegant way. See the Azimuth network theory series for details.

Conclusion: The life of a network, and the networks of life, are brimming with mathematical content.

We are pursuing these subjects in the Azimuth Project, an open collaboration between mathematicians, scientists, engineers and programmers trying to help save the planet. On the Azimuth Wiki and Azimuth Blog we are trying to explain the main environmental and energy problems the world faces today. We are also studying plans of action, network theory, climate cycles, the programming of climate models, and more.

If you would like to help, we need you and your special expertise. You can write articles, contribute information, pose questions, fill in details, write software, help with research, help with writing, and more. Just drop us a line.


This post appeared on the blog for Mathematics of Planet Earth 2013, an international project involving over 100 scientific societies, universities, research institutes, and organizations. They’re trying to have a new blog article every day, and you can submit articles as described here.

Here are a few of their other articles:

The mathematics of extreme climatic events—with links to videos.

From the Joint Mathematics Meetings: Conceptual climate models short course—with links to online course materials.

There will always be a Gulf Stream—and exercise in singular perturbation technique.


Nash Equilibria

12 February, 2013

As you know if you’ve been reading this blog lately, I’m teaching game theory. I could use some help.

Is there a nice elementary proof of the existence of Nash equilibria for 2-person games?

Here’s the theorem I have in mind. Suppose A and B are m \times n matrices of real numbers. Say a mixed strategy for player A is a vector p \in \mathbb{R}^m with

\displaystyle{ p_i \ge 0 , \quad \sum_i p_i = 1 }

and a mixed strategy for player B is a vector q \in \mathbb{R}^n with

\displaystyle{ q_i \ge 0 , \quad \sum_j q_j = 1 }

A Nash equilibrium is a pair consisting of a mixed strategy p for A and a mixed strategy q for B such that:

1) For every mixed strategy p' for A, p' \cdot A q \le p \cdot A q.

2) For every mixed strategy q' for B, p \cdot B q' \le p \cdot B q.

(The idea is that p \cdot A q is the expected payoff to player A when A chooses mixed strategy p and B chooses q. Condition 1 says A can’t improve their payoff by unilaterally switching to some mixed strategy p'. Similarly, condition 2 says B can’t improve their expected payoff by unilaterally switching to some mixed strategy q'.)

Some history

The history behind my question is sort of amusing, so let me tell you about that—though I probably don’t know it all.

Nash won the Nobel Prize for a one-page proof of a more general theorem for n-person games, but his proof uses Kakutani’s fixed-point theorem, which seems like overkill, at least for the 2-person case. There is also a proof using Brouwer’s fixed-point theorem; see here for the n-person case and here for the 2-person case. But again, this seems like overkill.

Earlier, von Neumann had proved a result which implies the one I’m interested in, but only in the special case where B = -A: the so-called minimax theorem. Von Neumann wrote:

As far as I can see, there could be no theory of games … without that theorem … I thought there was nothing worth publishing until the Minimax Theorem was proved.

I believe von Neumann used Brouwer’s fixed point theorem, and I get the impression Kakutani proved his fixed point theorem in order to give a different proof of this result! Apparently when Nash explained his generalization to von Neumann, the latter said:

That’s trivial, you know. That’s just a fixed point theorem.

But you don’t need a fixed point theorem to prove von Neumann’s minimax theorem! There’s a more elementary proof in an appendix to Andrew Colman’s 1982 book Game Theory and its Applications in the Social and Biological Sciences. He writes:

In common with many people, I first encountered game theory in non-mathematical books, and I soon became intrigued by the minimax theorem but frustrated by the way the books tiptoed around it without proving it. It seems reasonable to suppose that I am not the only person who has encountered this problem, but I have not found any source to which mathematically unsophisticated readers can turn for a proper understanding of the theorem, so I have attempted in the pages that follow to provide a simple, self-contained proof with each step spelt out as clearly as possible both in symbols and words.

This proof is indeed very elementary. The deepest fact used is merely that a continuous function assumes a maximum on a compact set—and actually just a very special case of this. So, this is very nice.

Unfortunately, the proof is spelt out in such enormous elementary detail that I keep falling asleep halfway through! And worse, it only covers the case B = -A.

Is there a good references to an elementary but terse proof of the existence of Nash equilibria for 2-person games? If I don’t find one, I’ll have to work through Colman’s proof and then generalize it. But I feel sure someone must have done this already.


Game Theory (Part 13)

11 February, 2013

Last time we introduced mixed strategies, and generalized the idea of Nash equilibrium to mixed strategies. Now let’s look at an example.

Matching pennies

In the game of matching pennies, each player has a penny and must secretly turn the penny to either heads or tails. They then reveal their choices simultaneously. If the pennies match—both heads or both tails—player A keeps both pennies, so he wins one from player B. If the pennies do not match—one heads and one tails—B keeps both pennies, so she wins one from A.

Let’s write this game in normal form! If the pennies match, A wins one penny and B loses one, so their payoffs are (1,-1). If they pennies don’t match, A loses one and B wins one, so their payoffs are (-1,1). If we say

• choice 1 is heads
• choice 2 is tails

then the normal form looks like this:

1 2
1    (1,-1)   (-1,1)  
2 (-1,1)   (1,-1)  

We can also break this into two matrices in the usual way, one showing the payoff for A:

A = \left( \begin{array}{rr} 1 & -1 \\ -1 & 1 \end{array} \right)

and one showing the payoff for B:

B = \left( \begin{array}{rr} -1 & 1 \\ 1 & -1 \end{array} \right)

If you examine this game, it’s easy to see no pure strategy is a Nash equilibrium. If A chooses heads, B will want to choose tails. But if B chooses tails, A will want to choose tails. And if A chooses tails, B will want to choose heads. And if B chooses heads, A will want to choose heads! There’s always someone who would do better by changing their choice. It’s a lot like rock, paper, scissors.

Mixed strategies

However, there is a Nash equilibrium if we allow mixed strategies, where the players can randomly make their choice according to a certain probability distribution.

Let’s see if we can guess where this Nash equilibrium is. If you were player A, can you guess what you should do? Should you choose heads 90% of the time? 80% of the time? 70% of the time?

A student says: “50% of the time.”

Yes, that seems right. After all, if player A chooses heads most of the time, player B can win most of the time by always choosing tails! And if player A chooses tails most of the time, B can win most of the time by always choosing heads! The only way out is for player A to choose heads with probability 1/2.

But what about player B? What should player B do?

A student says: “She should also choose heads 50% of the time.”

Yes, that makes sense too—for the same sort of reason.

So, let’s see if these mixed strategies give a Nash equilibrium. Remember that we write

p = (p_1, p_2)

for A’s mixed strategy. p_1 is the probability that A makes choice 1: that is, chooses heads. p_2 is the probability that A makes choice 2: that is, chooses tails. So, what p are we guessing here?

The students say:

p = (1/2, 1/2)

Okay, that’s A’s mixed strategy. And what about B’s mixed strategy?

The students say:

q = (1/2, 1/2)

Okay, now lets see if these are really a Nash equilibrium! Remember the definition from last time:

Definition. Given a 2-player normal form game, a pair of mixed strategies (p,q), one for player A and one for player B, is a Nash equilibrium if:

1) For all mixed strategies p' for player A, p' \cdot A q \le p \cdot A q.

2) For all mixed strategies q' for player B, p \cdot B  q' \le p \cdot B q.

We want to check this for our p and q. This looks hard, because we have to check part 1) for all p' and part 2) for all q'. But sometimes it’s easy, and I’ve picked a game where it’s easy.

Why is it easy? Well, first consider part 1). For this we need to show

p' \cdot A q \le p \cdot A q

To show this, let’s start by computing A q:

A q =   \left( \begin{array}{rr} 1 & -1 \\ -1 & 1 \end{array} \right) \left( \begin{array}{r} 1/2 \\ 1/2 \end{array} \right) = \left( \begin{array}{r} 0 \\ 0 \end{array} \right)

Hey! It’s the zero vector, a list of all zeros! We write this simply as 0. So, we’re trying to show

p' \cdot 0 \le p \cdot 0

but of course this is true, because both sides equal the number zero!

What’s going on here? The point is that if B uses mixed strategy q, A’s expected payoff is zero no matter what mixed strategy A uses! If A uses any mixed strategy p', the expected value of his payoff is always p' \cdot A q = 0, since Aq = 0.

Now let’s check part 2). This should be similar. Now we need to show that for any mixed strategy q',

p \cdot B q' \le p \cdot B q

Hey, this is actually a bit different! Before we could use Aq = 0 to get the job done. But now we see B q' showing up, and q' is any mixed strategy, so we can’t calculate this! What do we do?

We need to use the power of math!

We need to use a fact about matrices and dot products! For any vectors v \in \mathbb{R}^m and w \in \mathbb{R}^n and any m \times n matrix A, we have

v \cdot A w = A^T v \cdot w

Here A^T is the transpose of the matrix A; that is, the matrix we get by switching rows and columns:

Here’s the formula for the transpose:

A^T_{ji} = A_{ij}

Someday when I’ll in a bad mood I’ll make you prove v \cdot A w = A^T v \cdot w in your homework.

Anyway, applying this equation to the matrix B, we can take part 2):

p \cdot B q' \le p \cdot B q

and rewrite it like this:

B^T p \cdot q' \le B^T p \cdot q

Notice that B^T p shows up on both sides now. So, we should start by computing this! We have

B =  \left( \begin{array}{rr} -1 & 1 \\ 1 & -1 \end{array} \right)

so taking the transpose doesn’t actually do anything in this particular case:

B^T=  \left( \begin{array}{rr} -1 & 1 \\ 1 & -1 \end{array} \right)

and we get:

B^T p =   \left( \begin{array}{rr} -1 & 1 \\ 1 & -1 \end{array} \right) \left( \begin{array}{r} 1/2 \\ 1/2 \end{array} \right) = \left( \begin{array}{r} 0 \\ 0 \end{array} \right)

Hey! It’s the zero vector again! You should have guessed that was coming. So, the thing we’re trying to show:

B^T p \cdot q' \le B^T p \cdot q

simply boils down to

0 \cdot q' \le 0 \cdot q

which is true because both sides are zero.

Yay, we’re done! We found a Nash equilibrium! And the point of our last little calculation is that if A uses mixed strategy p, B’s expected payoff is zero no matter what mixed strategy B uses. This is just the mirror image of what we saw before: if B uses mixed strategy q, A’s expected payoff is zero no matter what mixed strategy A uses.

So, when both A and B are choosing heads or tails with 50% probabilities, independently, either one can unilaterally change their mixed strategy without improving their expected payoff. That’s a Nash equilibrium for you!

The coin-matching game

Just for fun, let me warn you about a scam that involves matching pennies. I’ll quote this article:

Coin-matching game, Wikipedia.

A coin-matching game (also a coin smack or smack game) is a confidence trick in which two con artists set up one victim.

The first con artist strikes up a conversation with the victim, usually while waiting somewhere. The con artist suggests matching pennies (or other coins) to pass the time. The second con artist arrives and joins in, but soon leaves for a moment. The first con artist then suggests cheating. The victim, thinking they are going to scam the second con artist, agrees to match coins each time.

When the second con artist returns and begins losing, he accuses the two of cheating and threatens to call the police. The first con artist offers a sizable sum of hush money, and the victim pitches in. After the victim leaves, the two con artists split up the money extorted from the victim.

So, watch out if someone suggests playing ‘matching pennies’ with you! It could be legit, but if a second person joins in and starts placing bets on the two of you, it’s probably a coin smack!

For more con games, see:

The Encylopedia of Scams.

I’m not trying to teach you how to con people! I’m trying to help you defend yourself. Of course the best way to avoid scams is a generally cautious, skeptical attitude, especially in any situation where someone seems to be helping you get money or get around the law. And don’t forget: successful con artists don’t usually look suspicious, like this:

They look and act trustworthy. As the saying goes:

The most important thing is sincerity. If you can fake that, you’ve got it made.


Game Theory (Part 12)

11 February, 2013

Suppose we have a 2-player normal form game. As usual, we assume:

• Player A has some set of choices i = 1, \dots, m.

• Player B has some set of choices j = 1, \dots, n.

• If player A makes choice i and player B makes choice j, the payoff to player A is A_{ij} and the payoff to player B is B_{ij}.

Earlier we studied ‘pure strategies’, where the players make the same choice each time. Now we’ll study ‘mixed strategies’, where the players make their choices randomly. I want to show you that there’s always a Nash equilibrium when we allow mixed strategies—even in games like rock, paper, scissors that don’t have a Nash equilibrium with pure strategies!

But to do this, we need to define Nash equilibria for mixed strategies. And before that, we need to define mixed strategies!

First let’s make up a name for the set of player A’s choices:

X = \{ 1, \dots, m \}

and a name for the set of player B’s choices:

Y = \{1, \dots, n \}

Definition 1. A mixed strategy for player A is a probability distribution p on the set of their choices, X. A mixed strategy for player B is a probability distribution q on the set of their choices, Y.

Let’s recall exactly what this means, since you’ll need to know! Player A has a probability p_i of making any choice i = 1, \dots, m, and these probabilities obey

0 \le p_i \le 1

and

\displaystyle{ \sum_{i \in X} p_i = 1 }

Similarly, the probability that player B makes the choice j = 1, \dots, n is q_j, and these probabilities obey

0 \le q_j \le 1

and

\displaystyle{ \sum_{j \in Y} q_j = 1 }

In our earlier discussions of probability, we would call X and Y sets of events. An event is anything that can happen. But now the thing that can happen is that a player makes a certain choice in the game! So, now we’re calling X and Y sets of choices. But you can also think of these choices as events.

The expected payoff

Now let’s work out the expected value of the payoff to each player. To do this, we’ll assume:

1) Player A uses mixed strategy p.
2) Player B uses mixed strategy q.
3) Player A and player B’s choices are independent.

If you forget what ‘independent’ means, look at Part 8. The basic idea is player A’s choice doesn’t affect player B’s choice, and vice versa. After all, this is a ‘simultaneous game’, where each player makes their choice not knowing what the other has done.

But mathematically, the point is that we must assume the player’s choices are independent to know the probability of player A making choice i and player B making choice j is the product

p_i \, q_j

Knowing this, we can work out the expected value of the payoff to player A. Here it is:

\displaystyle{ \sum_{i \in X, j \in Y} A_{i j} \, p_i \, q_j }

I hope you see why. The probability that player A makes choice i and player B makes choice j is p_i q_j. The payoff to player A when this happens is A_{ij}. We multiply these and sum over all the possible choices for both players. That’s how expected values work!

Similarly, the expected value of the payoff for player B is

\displaystyle{ \sum_{i \in X, j \in Y} B_{i j} \, p_i \, q_j }

More details

If you’re in the mood, I can make this more formal. Remember that X \times Y is the set of all ordered pairs (i,j) where i \in X and j \in Y. A pair (i,j) is an event where player A makes choice i and player B makes choice j.

A’s payoff is a function on this set X \times Y. Namely, if player A makes choice i and player B makes choice j, A’s payoff is A_{ij}. There’s also a probability distribution on X \times Y. Namely, the probability of the event (i,j) is p_i \, q_j. So, the expected value of the payoff with respect to this probability distribution is

\displaystyle{ \sum_{(i,j) \in X \times Y} A_{i j} \, p_i \, q_j }

But this is equal to what we’ve seen already:

\displaystyle{ \sum_{i \in X, j \in Y} A_{i j} \, p_i \, q_j }

Matrix multiplication and the dot product

It looks like all of the students in this class have studied some linear algebra. So, I’ll assume you know how to:

take the dot product of vectors to get a number,

and

multiply a vector by a matrix to get a new vector.

Click on the links if you want to review these concepts. They will let us write our formulas for expected payoffs much more efficiently!

Here’s how. First, we think of the probability distribution p as a vector in \mathbb{R}^m; that is, a list of m numbers:

p = (p_1, \dots, p_m)

Second, we think of the probability distribution q as a vector in \mathbb{R}^n:

q = (q_1, \dots, q_n)

Third, we think of A and B as m \times n matrices, since that’s what they are:

A = \left( \begin{array}{cccc} A_{11} & A_{12} & \cdots & A_{1n} \\ A_{21} & A_{22} & \cdots & A_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ A_{m1} & A_{m2} & \cdots & A_{mn} \end{array} \right)

 

B = \left( \begin{array}{cccc} B_{11} & B_{12} & \cdots & B_{1n} \\ B_{21} & B_{22} & \cdots & B_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ B_{m1} & B_{m2} & \cdots & B_{mn} \end{array} \right)

Here’s the cool part:

Theorem. If A has mixed strategy p and B has mixed strategy q, then the expected value of A’s payoff is

p \cdot A q

and the expected value of B’s payoff is

p \cdot B q

Proof. We’ll only prove the first one, since the second works just the same way. By definition, A q is a vector in \mathbb{R}^m with components

\displaystyle{ (Aq)_i = \sum_{j = 1}^n A_{ij} q_j }

Also by definition, the dot product of p with Aq is the number

\begin{array}{ccl} p \cdot Aq &=& \displaystyle{ \sum_{i = 1}^m p_i \, (Aq)_i} \\ \\ &=& \displaystyle{ \sum_{i = 1}^m \sum_{j = 1}^n p_i \, A_{ij} \, q_j } \end{array}

But this agrees with our earlier formula for the expected value of A’s payoff, namely

\displaystyle{ \sum_{i \in X, j \in Y} A_{i j} \, p_i \, q_j  = \sum_{i = 1}^m \sum_{j = 1}^n A_{i j} \, p_i \, q_j }

So, we’re done! █

It’s not just quicker to write

p \cdot A q

than

\displaystyle{ \sum_{i \in X, j \in Y} A_{i j} \, p_i \, q_j }

It will also let us use tools from linear algebra to study games!

Nash equilibria

We’ll have to look at examples to understand this stuff better, but let me charge ahead and define ‘Nash equilibria’ for mixed strategies. The idea is similar to the idea we’ve already seen. A pair of mixed strategies, one for A and one for B, is a Nash equilibrium if neither player can improve the expected value of their payoff by unilaterally changing their mixed strategy.

Let’s make that precise. As before, the definition of Nash equilibrium involves two conditions:

Definition. Given a 2-player normal form game, a pair of mixed strategies (p,q), one for player A and one for player B, is a Nash equilibrium if:

1) For all mixed strategies p' for player A, p' \cdot A q \le p \cdot A q.

2) For all mixed strategies q' for player B, p \cdot B q' \le p \cdot B q.

Condition 1) says that player A can’t improve their payoff by switching their mixed strategy from p to any other mixed strategy p'. Condition 2) says that player B can’t improve their payoff by switching their mixed strategy from q to any other mixed strategy q'.

Now, one of our goals is to prove this big wonderful theorem:

Theorem. For any 2-player normal form game, there exists a pair of mixed strategies (p,q), one for player A and one for player B, that is a Nash equilibrium.

For zero-sum games this was proved by John von Neumann. Later John Nash proved a version for nonzero-sum games, and even games with more than two players. These are famously smart mathematicians, so you should not expect the proof to be extremely easy. We will need to work!

But next time we’ll start by looking at examples, to get our feet on the ground and start getting some intuition for these new ideas.


Game Theory (Part 11)

6 February, 2013

Here’s a game. I flip a fair coin. If it lands heads up, I give you $1. If it lands tails up, I give you nothing.

How much should you pay to play this game?

This is not a mathematics question, because it asks what you “should” do. This could depend on many things that aren’t stated in the question.

Nonetheless, mathematicians have a way they like to answer this question. They do it by computing the so-called ‘expected value’ of your payoff. With probability 1/2 you get 1 dollar; with probability 1/2 you get 0 dollars. So, the expected value is defined to be

\displaystyle{ \frac{1}{2} \times 1 + \frac{1}{2} \times 0 = \frac{1}{2} }

Don’t be fooled by the word ‘expected’: mathematicians use words in funny ways. I’m not saying you should expect to get 1/2 a dollar each time you play this game: obviously you don’t! It means that you get 1/2 a dollar ‘on average’. More precisely: if you play the game lots of times, say a million times, there’s a high probability that you’ll get fairly close to 1/2 a million dollars. (We could make this more precise and prove it, but that would be quite a digression right now.)

So, if you have lots of money and lots of time, you could pay up to 1/2 a dollar to play this game, over and over, and still make money on average. If you pay exactly 1/2 a dollar you won’t make money on average, but you won’t lose it either—on average.

Expected values

Let’s make the idea precise:

Definition. Suppose X is a finite set and p is a probability distribution on that set. Suppose

f: X \to \mathbb{R}

is a function from X to \mathbb{R}. Then the expected value of f with respect to p is defined to be

\displaystyle{ \langle f \rangle = \sum_{i \in X} p_i f(i) }

The idea here is that we are averaging the different values f(i) of the function f, but we count f(i) more when the probability of the event i is bigger. We pronounce \langle f \rangle like this: “the expected value of f“.

Examples

Example 1. Suppose you enter a lottery have a 0.01% chance of winning $100 and a 99.99% chance of winning nothing. What is the expected value of your payoff?

With probability 0.0001 you win $100. With probability .9999 you win zero dollars. So, your expected payoff is

\displaystyle{ 0.0001 \times 100 + .9999 \times 0 = 0.01 }

dollars. So: if you play this game over and over, you expect that on average you will win a penny per game.

But usually you have to pay to enter a lottery! This changes everything. Let’s see how:

Example 2. Suppose you pay $5 to enter a lottery. Suppose you have a 0.01% chance of winning $100 and a 99.99% chance of winning nothing. What is the expected value of your payoff, including your winnings but also the money you paid?

With probability 0.0001 you win $100, but pay $5, so your payoff is $95 in this case. With probability .9999 you win nothing, but pay $5, so your payoff is -$5 in this case. So, your expected payoff is

\displaystyle{ 0.0001 \times 95 - .9999 \times 5 = - 4.99 }

dollars. In simple terms: if we play this game over and over, we expect that on average we will lose $4.99 per play.

Example 3. Suppose you pay $5 to play a game where you
flip a coin 5 times. Suppose the coin is fair and the flips are independent. If the coin lands heads up every time, you win $100. Otherwise you win nothing. What is the expected value of your payoff, including your winnings but also the money you paid?

Since the coin flips are fair and independent, the probability that it lands heads up every time is

\displaystyle{ \frac{1}{2^5} = \frac{1}{32} }

So, when we count the $5 you pay to play, with probability 1/32 your payoff is $95, and with probability (1 – 1/32) = 31/32 your payoff is -$5. The expected value of your payoff is thus

\displaystyle{ \frac{1}{32} \times 95 - \frac{31}{32} \times 5 = -1.875 }

dollars.

Risk aversion and risk tolerance

Soon we’ll start talking about games where players used ‘mixed strategies’, meaning that they randomly make their choices according to some probability distribution. To keep the math simple, we will assume our ‘rational agents’ want to maximize the expected value of their payoff.

But it’s important to remember that life is not really so simple, especially if payoffs are measured in dollars. Rational agents may have good reasons to do something else!

For example, suppose some evil fiend says they’ve kidnapped my wife and they’ll kill her unless I give him a dollar. Suppose I only have 99 cents. But suppose they offer me a chance to play this game: I flip a fair coin, and if it lands heads up, I get $1. If it lands tails up, I get nothing.

How much would I pay to play this game?

Assuming I had no way to call the police, etcetera, I would pay all my 99 cents to play this game. After all, if I don’t play it, my wife will die! But if I do play it, I would at least have a 50% chance of saving her.

The point here is that my happiness, or utility, is not proportional to my amount of money. If I have less than $1, I’m really miserable. If I have $1 or more, I’m much better off.

There are many other reasons why people might be willing to pay more or less to play a game than the expected value of its monetary payoff. Some people are risk tolerant: they are willing to accept higher risks to get a chance at a higher payoffs. Others are risk averse: they would prefer to have a high probability of getting a payoff even if it’s not so big. See:

Risk aversion, Wikipedia.

In class I asked all the students: would you like to play the following game? I’ll flip a fair coin. Then I’ll double your quiz score for today if it comes heads, but give you a zero for your quiz score if it comes up tails.

Suppose your quiz score is Q. If you get heads, I’ll give you Q more points. If you get tails, I’ll take away Q points. So the expected value of the payoff for this game, measured in points, is

\displaystyle{ \frac{1}{2} \times Q - \frac{1}{2} \times Q = 0 }

So, if the expected value is what matters to you, you’ll be right on the brink of wanting to play this game: it doesn’t help you, and it doesn’t hurt you.

But in reality, different people will make different decisions. I polled the students, using our electronic clicker system, and 46% said they wanted to play this game. 54% said they did not.

Then I changed the game. I said that I would roll a fair 6-sided die. If a 6 came up, I would multiply their quiz score by 6. Otherwise I would set their quiz score to zero.

If your quiz score is Q, your payoff if you win will be 5 Q, since I’m multiplying your score by 6. If you lose, your payoff will be -Q. So, the expected value of your payoff is still zero:

\displaystyle{ \frac{1}{6} \times 5Q - \frac{5}{6} \times Q = 0 }

But now the stakes are higher, in a certain sense. You can win more, but it’s less likely.

Only 30% of students wanted to play this new game, while 70% said they would not.

I got the students who wanted to play to hand in slips of paper with their names on them. I put them in a hat and had a student randomly choose one. The winner got to play this game. He rolled a 1. So, his quiz score for the day went to zero.

Ouch!

Here is a famous beggar in San Francisco:


Successful Predictions of Climate Science

5 February, 2013

guest post by Steve Easterbrook

In December I went to the 2012 American Geophysical Union Fall Meeting. I’d like to tell you about with the Tyndall lecture given by Ray Pierrehumbert, on “Successful Predictions”. You can watch the whole talk here:

But let me give you a summary, with some references.

Ray’s talk spanned 120 years of research on climate change. The key message is that science is a long, slow process of discovery, in which theories (and their predictions) tend to emerge long before they can be tested. We often learn just as much from the predictions that turned out to be wrong as we do from those that were right. But successful predictions eventually form the body of knowledge that we can be sure about, not just because they were successful, but because they build up into a coherent explanation of multiple lines of evidence.

Here are the successful predictions:

1896: Svante Arrhenius correctly predicts that increases in fossil fuel emissions would cause the earth to warm. At that time, much of the theory of how atmospheric heat transfer works was missing, but nevertheless, he got a lot of the process right. He was right that surface temperature is determined by the balance between incoming solar energy and outgoing infrared radiation, and that the balance that matters is the radiation budget at the top of the atmosphere. He knew that the absorption of infrared radiation was due to CO2 and water vapour, and he also knew that CO2 is a forcing while water vapour is a feedback. He understood the logarithmic relationship between CO2 concentrations in the atmosphere and surface temperature. However, he got a few things wrong too. His attempt to quantify the enhanced greenhouse effect was incorrect, because he worked with a 1-layer model of the atmosphere, which cannot capture the competition between water vapour and CO2, and doesn’t account for the role of convection in determining air temperatures. His calculations were incorrect because he had the wrong absorption characteristics of greenhouse gases. And he thought the problem would be centuries away, because he didn’t imagine an exponential growth in use of fossil fuels.

Arrhenius, as we now know, was way ahead of his time. Nobody really considered his work again for nearly 50 years, a period we might think of as the dark ages of climate science. The story perfectly illustrates Paul Hoffman’s tongue-in-cheek depiction of how scientific discoveries work: someone formulates the theory, other scientists then reject it, ignore it for years, eventually rediscover it, and finally accept it. These “dark ages” weren’t really dark, of course—much good work was done in this period. For example:

• 1900: Frank Very worked out the radiation balance, and hence the temperature, of the moon. His results were confirmed by Pettit and Nicholson in 1930.

• 1902-14: Arthur Schuster and Karl Schwarzschild used a 2-layer radiative-convective model to explain the structure of the sun.

• 1907: Robert Emden realized that a similar radiative-convective model could be applied to planets, and Gerard Kuiper and others applied this to astronomical observations of planetary atmospheres.

This work established the standard radiative-convective model of atmospheric heat transfer. This treats the atmosphere as two layers; in the lower layer, convection is the main heat transport, while in the upper layer, it is radiation. A planet’s outgoing radiation comes from this upper layer. However, up until the early 1930’s, there was no discussion in the literature of the role of carbon dioxide, despite occasional discussion of climate cycles. In 1928, George Simpson published a memoir on atmospheric radiation, which assumed water vapour was the only greenhouse gas, even though, as Richardson pointed out in a comment, there was evidence that even dry air absorbed infrared radiation.

1938: Guy Callendar is the first to link observed rises in CO2 concentrations with observed rises in surface temperatures. But Callendar failed to revive interest in Arrhenius’s work, and made a number of mistakes in things that Arrhenius had gotten right. Callendar’s calculations focused on the radiation balance at the surface, whereas Arrhenius had (correctly) focussed on the balance at the top of the atmosphere. Also, he neglected convective processes, which astrophysicists had already resolved using the radiative-convective model. In the end, Callendar’s work was ignored for another two decades.

1956: Gilbert Plass correctly predicts a depletion of outgoing radiation in the 15 micron band, due to CO2 absorption. This depletion was eventually confirmed by satellite measurements. Plass was one of the first to revisit Arrhenius’s work since Callendar, however his calculations of climate sensitivity to CO2 were also wrong, because, like Callendar, he focussed on the surface radiation budget, rather than the top of the atmosphere.

1961-2: Carl Sagan correctly predicts very thick greenhouse gases in the atmosphere of Venus, as the only way to explain the very high observed temperatures. His calculations showed that greenhouse gasses must absorb around 99.5% of the outgoing surface radiation. The composition of Venus’s atmosphere was confirmed by NASA’s Venus probes in 1967-70.

1959: Burt Bolin and Erik Eriksson correctly predict the exponential increase in CO2 concentrations in the atmosphere as a result of rising fossil fuel use. At that time they did not have good data for atmospheric concentrations prior to 1958, hence their hindcast back to 1900 was wrong, but despite this, their projection for changes forward to 2000 were remarkably good.

1967: Suki Manabe and Dick Wetherald correctly predict that warming in the lower atmosphere would be accompanied by stratospheric cooling. They had built the first completely correct radiative-convective implementation of the standard model applied to Earth, and used it to calculate a +2 °C equilibrium warming for doubling CO2, including the water vapour feedback, assuming constant relative humidity. The stratospheric cooling was confirmed in 2011 by Gillett et al.

1975: Suki Manabe and Dick Wetherald correctly predict that the surface warming would be much greater in the polar regions, and that there would be some upper troposphere amplification in the tropics. This was the first coupled general circulation model (GCM), with an idealized geography. This model computed changes in humidity, rather than assuming it, as had been the case in earlier models. It showed polar amplification, and some vertical amplification in the tropics. The polar amplification was measured, and confirmed by Serreze et al in 2009. However, the height gradient in the tropics hasn’t yet been confirmed (nor has it yet been falsified—see Thorne 2008 for an analysis)

1989: Ron Stouffer et. al. correctly predict that the land surface will warm more than the ocean surface, and that the southern ocean warming would be temporarily suppressed due to the slower ocean heat uptake. These predictions are correct, although these models failed to predict the strong warming we’ve seen over the antarctic peninsula.

Of course, scientists often get it wrong:

1900: Knut Ångström incorrectly predicts that increasing levels of CO2 would have no effect on climate, because he thought the effect was already saturated. His laboratory experiments weren’t accurate enough to detect the actual absorption properties, and even if they were, the vertical structure of the atmosphere would still allow the greenhouse effect to grow as CO2 is added.

1971: Rasool and Schneider incorrectly predict that atmospheric cooling due to aerosols would outweigh the warming from CO2. However, their model had some important weaknesses, and was shown to be wrong by 1975. Rasool and Schneider fixed their model and moved on. Good scientists acknowledge their mistakes.

1993: Richard Lindzen incorrectly predicts that warming will dry the troposphere, according to his theory that a negative water vapour feedback keeps climate sensitivity to CO2 really low. Lindzen’s work attempted to resolve a long standing conundrum in climate science. In 1981, the CLIMAP project reconstructed temperatures at the last Glacial maximum, and showed very little tropical cooling. This was inconsistent the general circulation models (GCMs), which predicted substantial cooling in the tropics (e.g. see Broccoli & Manabe 1987). So everyone thought the models must be wrong. Lindzen attempted to explain the CLIMAP results via a negative water vapour feedback. But then the CLIMAP results started to unravel, and newer proxies demonstrated that it was the CLIMAP data that was wrong, rather than the models. It eventually turns out the models were getting it right, and it was the CLIMAP data and Lindzen’s theories that were wrong. Unfortunately, bad scientists don’t acknowledge their mistakes; Lindzen keeps inventing ever more arcane theories to avoid admitting he was wrong.

1995: John Christy and Roy Spencer incorrectly calculate that the lower troposphere is cooling, rather than warming. Again, this turned out to be wrong, once errors in satellite data were corrected.

In science, it’s okay to be wrong, because exploring why something is wrong usually advances the science. But sometimes, theories are published that are so bad, they are not even wrong:

2007: Courtillot et. al. predicted a connection between cosmic rays and climate change. But they couldn’t even get the sign of the effect consistent across the paper. You can’t falsify a theory that’s incoherent! Scientists label this kind of thing as “Not even wrong”.

Finally, there are, of course, some things that scientists didn’t predict. The most important of these is probably the multi-decadal fluctuations in the warming signal. If you calculate the radiative effect of all greenhouse gases, and the delay due to ocean heating, you still can’t reproduce the flat period in the temperature trend in that was observed in 1950–1970. While this wasn’t predicted, we ought to be able to explain it after the fact. Currently, there are two competing explanations. The first is that the ocean heat uptake itself has decadal fluctuations, although models don’t show this. However, it’s possible that climate sensitivity is at the low end of the likely range (say 2 °C per doubling of CO2), it’s possible we’re seeing a decadal fluctuation around a warming signal. The other explanation is that aerosols took some of the warming away from GHGs. This explanation requires a higher value for climate sensitivity (say around 3 °C), but with a significant fraction of the warming counteracted by an aerosol cooling effect. If this explanation is correct, it’s a much more frightening world, because it implies much greater warming as CO2 levels continue to increase. The truth is probably somewhere between these two. (See Armour & Roe, 2011 for a discussion.)

To conclude, climate scientists have made many predictions about the effect of increasing greenhouse gases that have proven to be correct. They have earned a right to be listened to, but is anyone actually listening? If we fail to act upon the science, will future archaeologists wade through AGU abstracts and try to figure out what went wrong? There are signs of hope—in his re-election acceptance speech, President Obama revived his pledge to take action, saying “We want our children to live in an America that isn’t threatened by the destructive power of a warming planet.”


Follow

Get every new post delivered to your Inbox.

Join 3,095 other followers