Posted by: dhaleyjr | November 24, 2008

## Two Envelopes Problem

Another stat problem with a rather interesting solution. And the math for this is very straightforward.

## The Problem

You are put in the following situation: There are 2 envelopes, each with money in them. You are told that one envelope has significantly more money than the other. You get to choose one of the envelopes, open it and look at how much money is in it. Then you are given the option to trade for the other envelope or to keep what you have. What should your strategy be to maximize the amount of money you get?

## What’s Interesting

I’ll tell you up front that there’s no way to guarantee the most money each time. It’s pretty easy to see that’s impossible. However you can actually do better than just picking one envelope or the other.

What’s interesting about this problem is that you’re given almost no information. You simply know that there are different amounts of money in two envelopes and you get one of them. You can learn information about 1 envelope and use it to make a decision about whether or not to trade for the other. The question becomes how to use that information to increase your expected winnings.

## The Solution

First, lets look at the the expected earnings are if you just randomly choose one envelope. Let’s say that the lesser amount is A and the greater amount is B. If you’re choosing randomly you have a 50/50 chance of getting either one so the expected earnings with the random approach is (A + B)/2. This is pretty intuitive. Take an example: If there is \$50 is one and \$100 in the other, the average winnings would be \$75. Clearly you can’t win exactly \$75 dollars, you’ll win one or the other, but the expected winnings is \$75.

Okay, now how can we be more clever. Well first we can see that if we just choose one envelope and stick with it, we get the (A + B)/2 answer since we effectively choose a random envelope. Similarly if we choose one and then always switch we again get the (A + B)/2 solution since we are again choosing a random envelope (always the second one). So to do better than this we are going to have to somehow make a choice that isn’t random on whether or not to trade.

Here’s what you do. Before picking an envelope, choose a number X. Since we know nothing about amounts A or B, X is going to have to be more or less random. Now choose an evelope and look at the amount. If amt < X, then trade the envelope for the second. If amt > X, keep it.

## Why Is this Better?

Okay, so this may not seem like the brilliant strategy you may have expected. It might not even seem like you’re doing better since you have to randomly choose X. But you are, and here’s why.

We have to break this down into different cases based on the relationship of X to A and B.

Case 1: X > A and B

In this case you’re back to the expected value of (A + B)/2 since you’re going to get whichever envelope you choose second (you’ll always trade the first envelope you choose since amt < X). So in this case we’re not doing any better but we’re also not doing any worse.

Case 2: X < A and B

In this base you’re again back to (A + B)/2 since you’ll get whichever envelope you choose first.

Case 3: A < X < B

In this case you will ALWAYS get B, the greater value! If you choose B first, you’ll keep it since amt > X and if you choose A first you’ll trade it since amt < X. Since you have done better in one case and kept the other cases the same as the naive approach you have improved you’re total chances.

## Conclusion

Interestingly enough that strategy improves your expected earnings. It’s difficult to say by how much you improved since that depends on the odds of guessing an X between A and B. If you were to say that all 3 cases are equal you would get:

(1/3)*(A + B)/2 + (1/3)*(A + B)/2 + (1/3)*B

=  (1/3)(A + B) + (1/3)*B

Using our early value of A=50 and B=100 we get expected value = \$83.3 > \$75 from the naive approach.

Now clearly the odds of guessing X between A and B are not so straightforward to be 1/3 but this serves as an example that it improves your odds. The actual probability of guessing X would depend on what you knew about the person offering you the game, etc and is hard to estimate in any concrete useful way. But the strategy holds regardless of the value.

So next time someone offers you a game where you can only win money or more money you’ll know how to go about playing.