Can somebody explain the two envelope paradox to me

I’m going to try and help with this septimus

This is the agreed part: “We agree to call this envelope’s contents X, the other’s Y.”

Just the X and Y.

This is the Suppose part: “Suppose we know that two envelope-pair settings are possible, (50 & 100) and (100 & 200)…”

There are examples littered throughout this thread of people trying to get others to follow their logic by using specific examples, you included.
Your response looks as if you don’t understand that septimus was illustrating a point with a specific example. I am very curious - do you not understand what septimus was trying to do or is something else going on here that I am just completely missing.

My point is that you can’t resolve the paradox by changing the conditions of it to the point where it’s a different problem.

The paradox, as I see it, is that it seems that in the two envelope problem you shouldn’t have any idea which of the envelopes contains the larger amount, yet an expected value calculation shows that you should swap envelopes no matter what you pick. The OP has said this. They also think that it is the same situation as flipping a coin and getting double or half the value. I will show why this is incorrect.

I will go over the two envelope problem again. There are two envelopes, containing money. One envelope contains twice the amount as the other. You have no idea what these envelopes contain. You choose one envelope. You have the option of having what is inside the envelope, or swapping and having the contents of the other envelope. Should you take the envelope you chose first, or swap? And I’ll add a part, if you can open the first envelope and see what’s inside, does this change anything?

In this thread, the value in the envelope chosen first is labelled as X and the other as Y. I will use the same names for these random variables. Additionally, I think using X and Y only leaves a large part of the problem out. There are two random variables, which I will call Z and U, which I think are very important and have largely been ignored.

Let’s look at the values contained in the envelopes. All we know that they contain money, and one envelope contains twice as much as the other. From this, I’ll create a random variable that I will call Z. Z is the value of the lowest of the two envelopes. For this I’ll make Z a discrete random variable, since money in envelopes is something that would not be well modelled by a continuous random variable.

One of the envelopes is chosen, with the value within becoming X and the other envelope becoming Y. How is which envelope chosen? I, and most others, assume this is random, evenly between the two envelopes, and independent of the values within the envelopes. I will use the random variable U to model this. U is 1 if the envelope chosen has the highest value, and 0 if the lowest value envelope is chosen. Therefore P(U = 1) = 0.5, P(U = 0) = 0.5. U is also independent of Z.

Now we have Z and U. What is X and Y in terms of them? They can be expressed like this:
X = Z + UZ = Z(1+U)
Y = 2Z - UZ = Z(2 - U)

Note that if you add X and Y, you get this expression.
X + Y = 3Z

Taking expected values of both sides, we get another relationship.

E(X) + E(Y) = 3E(Z)

But what E(X) and E(Y) by themselves? Note that U is independent of Z, so E(UZ) = E(U)E(Z).

E(X) = E(Z+UZ) = E(Z) + E(U)E(Z) = E(Z) + 0.5E(Z) = 1.5E(Z)
E(Y) = E(2Z - UZ) = 1.5E(Z)

Therefore, E(X) = E(Y), one and a half times what E(Z) is. (This isn’t true no matter what, in that if we had information about the distribution of Z we could use that to modify E(X) and E(Y). More on that later)

From here, I will go to the coin flip situation. Is it the same? I will go over an explanation of it. You start with some value of money. You are given the choice of taking a bet. Someone will flip a coin, and on one outcome you get you double your initial money back, and on the other you get half. Should you take the bet?

This situation might be the same. The coin flip is a 50:50 situation, like the choice of envelopes. I will construct X and Y to show if they are the same or not.

You start with some value of money. Like the values in the envelopes, we do not know how much. We can therefore use the random variable Z to model this.

We also have a coin flip. Like the original choice of envelopes, it has a 1:1 distribution. To make things as similar as possible I will use U = 1 as a loss (so like in the envelope problem X is larger than Y) and U = 0 as a win in the bet.

What are X and Y?

X = Z
Y = (2 - 1.5U)X = 2X - 1.5UX

Since X = Z , it also true that Y = (2 - 1.5U)Z = 2Z - 1.5UZ

This is different that the envelope problem above.

If you were to add X and Y together:

X + Y = 3X - 1.5UX = 3Z - 1.5UZ

Note that when you added X and Y in the envelope problem, U disappears. For the coin flip, U remains.

What about expected values?

E(X) = E(Z)
E(Y) = 2E(Z) - 0.75E(Z) = 1.25E(Z)

From this, we can say that E(Y) is larger than E(X), no matter what. As long as U is independent of Z, and U is 50:50, you should always take the bet.

It should be apparent from this that the coin flip problem is a different problem to the envelope problem. Why? In the envelope problem, X and Y depend on U while in the coin flip problem only Y depends on U. This is the key difference. The way U works with the coin flip, it doesn’t matter what X or Z is, you always get a 50% of doubling and 50% of halving if you take Y. With the envelopes, that X depends on U changes the problem drastically.

I haven’t covered the part of the problem, where you open an envelope and see what’s inside. I will do that in another post. The short story is that information is useless without an idea of the distribution of Z. I will also go over why the calculation in the original post is incorrect.

The calculation which shows that you take Y instead of X in the two envelope problem is an expected value calculation. What is it? 0.5X/2 + 0.52X = 1.25X. It is assumed that this gives E(Y). Why? 0.5 is a probability, but the probability of what? The definition of E(Y) is the sum of P(Y=y)*y for all possible y. We must therefore have the probabilities, P(Y = X/2), and P(Y=2X). These are assumed to be 0.5, and 0.5. Why? Is it because you could have picked the larger of the two envelopes or the smaller with a 50:50 chance? This is covered by the random variable U. Let’s look at X and Y in terms of Z and U again.

X = Z + UZ
Y = 2Z - UZ

Calculating E(Y) from this gives E(Y) = 1.5E(Z). We also have E(X) = 1.5E(Z), which is equal to E(Y). How can we get E(Y) = 1.25X? We want it in terms of X, not E(X). To do this we have to use “the value that X takes”, rather than treating X as a random variable with a value to be decided. To do this we have to make X “something”. We can do this by writing things in terms of that X, and by conditioning every probability on that value of X. We write things like that using P(Y|X) and E(A|B) and is called conditional probability or expectation. We want to find E(Y|X) in terms of X, and see if it is 1.25X.

X = Z + UZ
Y = 2Z - UZ
X + Y = 3Z

Lets take the expected value of the equations. Note that we are assuming X is now constant not random, so E(X) = X
X = E(Z|X) + E(UZ|X)
E(Y|X) = 2E(Z|X) - E(UZ|X)
E(Y|X) = 3E(Z|X) - X

Do any of them show that E(Y|X) = 1.25X? No. We do have that E(Y|X) = 3E(Z|X) - X. What does E(Z|X) mean? It’s the expected value of the lower of the two envelopes, given that you know the value of one envelope. Now, if we know that one envelope contains X, the other envelope must contain either X/2 or 2X. The lower envelope in these cases is X/2 and X. From this we can expand E(Z|X) into P(Z = X/2|X)*X/2 + P(Z = X|X)*X. Now, are those probabilities 0.5 and 0.5? Why should they be? We know that U acts like that. Maybe those probabilities are just U. Let’s try to get them in terms of U.

Bayes’ theorem is extremely useful when working with conditional probabilities. It states that P(A|B) = P(B|A)*P(A)/P(B). In our case, we know X in terms of Z very well, but it is a bit harder to work with Z in terms of X. Let’s apply Bayes’ theorem to convert things into a more usable form.

P(Z|X) = P(X|Z)*P(Z)/P(X)

To make things a bit clearer later on, I’ll use the fact that X is something by stating X = c, which is the “something” we were assuming X was.

P(Z = X = c|X=c) = P(X = c | Z = c)*P(Z = c)/P(X = c) (getting rid of superfluous equalities)

What is P(X = c| Z = c)? It is saying “what is the probability that X would be something, knowing that Z is that value”. Since we know that X = Z + UZ, it is true whenever U is 0, which happens with 50% probability. Therefore we can say that P(X = c| Z = c) = 0.5.

Another term is P(X = c). What is this? The probability that X is c. How can X be c? Either Z was c and X was the smaller of the two envelopes or Z was c/2 and X was the larger of the envelopes. This involves Z and U. U is independent of Z, so this can be written out as P(Z = c)*P(U = 0) + P(Z = c/2)*P(U = 1). P(U = 1) = P(U = 0.5), so we can write this as 0.5P(Z = c) + 0.5P(Z = c/2).

Finally, we have P(Z = c). This is a simple statement of Z’s distribution. It is the probability that Z is c. We don’t know it, so we have to leave it as is.

We can therefore rewrite P(Z = X|X), saying that X = c, as P(Z=c)/(P(Z=c)+P(Z=c/2)). (Dividing everything by 0.5). We can likewise rewrite P(Z = X/2|X) as P(Z=c/2)/(P(Z=c) + P(Z=c/2)). What does this mean? After some calculations E(Y|X=c) = c*(2P(Z = c) + 0.5P(Z=c/2))/(P(Z=c) + P(Z=c/2)). If P(Z = c) = a and P(Z= c/2) = b then E(Y|X=c) = X*(2a+0.5b)/(a+b). The probabilities we need to find E(Y|X) are of the type P(Z) only. Whoops. We said we don’t know the distribution of Z. Z could be any distribution, and the answer for E(Y|X) changes depending on what it is.

Wait a minute, what about that often repeated assumption, that we can assume things are equal if we have no reason not to? We assume that a coin is 1:1. We assume that a 6 side die has 1/6 probability of being 1. Why not assume that P(Z=c) = P(Z = c/2)? (Note that we are making it true for all c). If we do, we get E(Y|X) = 1.25X. Why not, you may ask. I’ll answer why. Not many distributions have P(Z=c) = P(Z = c/2). Look at our die. Let c be the number that the dice gives. If c is 2, then it works perfectly. P(2) = P(1). However if c = 1, then we need P(0.5), which is 0. Whoops. We can’t have odd c. Our assumption is false. But let’s ignore that. Let’s just assume that a die isn’t representative. Let’s say that our “everything is equal” assumption is true, and that Z is a distribution that has it. Surely plenty of distributions have it! Well, I’ll give you the only one I can think of.

Z = 0

What does that mean? It means the envelopes are empty. Then yes, it means that you can expect the other envelope to have 1.25 times what you have. Because both are empty. 1.25 * 0 = 0.

Now let’s use the example. X = 1. Is E(Y|X=1) = 1.25? Sure! Because we have a paradox. We have money in an empty envelope. If Z is 0, then X is 0. It can’t be 1.

So we have a choice. We can assume that Z fits a certain distribution, which happens to make Z=0, or we don’t. If we don’t, we can’t do E(Y|X). Well, that wasn’t all the options. There is also the option that Z is a continuous random variable. I suggest this is silly for money in envelopes, but do it if you want. I won’t, since I’m not a mathematician and doing things in terms of continuous functions with the associated integrals is beyond my current knowledge. If you can show that my general logic is incorrect for integrable continuous random variables I’d be happy to be shown wrong. There is another option, that E(Z) is undefined. In that case, E(Y) = 1.25E(X) is kinda true. It’s also “true” that E(Y) = 0.000000000001E(X). This is possible with non integrable functions. Again, I will suggest that this is a bit silly for money in envelopes.

What does this all mean? It means if you open an envelope, and get $1, you can’t say “I have equal chance of getting $2 and $0.5 if I swap” if you don’t know what the relative probabilities that the envelopes have ($1,$2) vs ($0.5,$1) . You have no idea what the probabilities are. I certainly don’t. Remember that these probabilities are purely “what was put into the envelopes to begin with”, nothing to do with you picking the larger or smaller. If you assume those probabilities are equal no matter what you got then you are either assuming that the envelopes were empty (and that getting $1 is impossible), or that the money is a weird continuous random variable that has no finite expected value . Neither really fits the fact that you have a $1 in the envelope you opened.

Of course, I’m assuming that you have no idea what the initial money in envelope distribution is, apart from discrete (and probably not zero with 100% probability). What happens if you do have some knowledge? For example, let say you are looking at an envelope with $1 in it, and a fly on the wall flies down and whispers in your ear “I’ve been watching him do this for a long time. He puts $1 and $2 in the envelopes as often as he puts in $1 and $0.50”. If you believe the fly, then you should take the other envelope. Why? Because he is saying that P(Z =0.5) = P(Z=1). E(Y) = 1.25. Great! What if the fly instead said “He only ever puts in whole dollars”. Great! P(Z=0.5) = 0. In this case, E(Y) isn’t 1.25. It’s 2. If the fly said “He always puts a half a dollar in one of the envelopes” it means that P(Z=1) = 0 and E(Y) = 0.5. Don’t swap. He could even say “P(Z=0.5) = 0.00034 and P(Z=1) = 0.00029”, in which case it’s a slightly harder calculation, E(Y) is roughly 1.19 and you should swap.

Dopers in this thread have long since lost interest in the puzzle, and are more interested in the challenge and difficulty of explaining it to the recalcitrant.

A question I’d like Little Nemo to answer is this:
(1) Did you read septimus’ post with an open mind and a desire to understand? or instead,
(2) Did you read septimus’ post with an a priori assumption it would be unhelpful?

As another pointed out, (2) is almost surely the case, as otherwise your reading comprehension seems inexplicably poor.

What you may be missing is that Mr. Nemo has decided septimus is a crackpot whose math skill and intuition is even worse than Nemo’s. :smack: I may discuss this in BBQ Pit, perhaps titling the thread “The Dunning–Kruger effect.”

Septimus, you’ve missed the point all along.

What I said was “Here’s a problem. Here’s a way to try to solve this problem using Method A. But look, Method A gives you a wrong answer. Why doesn’t Method A work on this problem?”

And you keep saying “Here’s how you solve the problem using Method B.”

You need to understand that I’m not asking for a solution to the problem. I know what the answer to the problem is. The entire question is about Method A and you’re trying to remove Method A from the discussion.

I understand what you’re saying. And everything you’re saying is right. It’s just not the answer to the question I’m asking.

Little Nemo, can you put in words what you think 1.25X is telling you about the situation?

No. If you check back a few hundred posts, you’ll see that it was septimus who was explaining your goal to other Dopers then. If you divide by zero, to “prove” 1+1 = 1, I don’t answer your goal by demonstrating 1+1 = 2; instead I need to show where you’re “dividing by zero.”

And that’s what I’ve done, consistently, all along.

Several of us have been competing, hoping we’d be the one to find just the right phrasing so Nemo would say “Aha! That’s the explanation; you should have said that earlier!” But I drop out of this competition now, admitting defeat.

Do me one last favor please. If you ever understand the fallacy (and that day may never come), look back over septimus’ posts and see if you do not agree that the clear and correct explanation of the fallacy was already given.

I think the reason why method A does not work has been explained by many different people, many different ways. Simply, it is not the correct mathmatical formula to describe the situation.(at least for the purposes of deciding whether or not to switch envelopes.) I’m not saying don’t use it only because it gives you a wrong answer. I’m saying don’t use it because it is the wrong formula.

It seems to me that rather than try to understand why it is wrong, you have stubbornly defended it.

The formula you are using assumes that for any value in one envelope, the other envelope is equally likely to contain twice or half the amount, and this is wrong. The amounts in both envelopes is by definition fixed. The money was put into the envelopes before the game begins. You can’t choose an envelope without the money being in them. Once the game begins, the dollar values in the envelopes is as unchanging as the number of cards in a deck, or the number of sides on a die.

This.

This is a misunderstanding. “The dollar values in the envelopes is as unchanging as the number of cards in a deck, or the number of sides on a die” is a tremendous misunderstanding.

Here’s a game: I roll a die, and put the face value in one envelope, and twice the face value in another envelope. Then I randomly color one envelope red and the other envelope blue.

Out of all the cases when the red envelope contains a 4, what’s the average value of the blue envelope? It’s 5; half the cases where the red envelope contains a 4 are ones where the blue envelope contains a 2, and half the cases where the red envelope contains a 4 are ones where the blue envelope contains an 8.

Similarly, out of all the cases when the red envelope contains a 2, the average value of the blue envelope is 2.5. And out of all the cases when the red envelope contains a 6, the average value of the blue envelope is 7.5.

Do you disagree with any of the above? Because none of the above is wrong. It’s all perfectly correct reasoning. Would you raise any objection to the above? Would you describe the above reasoning as fallacious because the values in the envelopes are “fixed” once placed in the envelopes? If you would, then you’re wrong, because the above is all perfectly correct.

Little Nemo is interested in discussing the analogous case where the die is not 6-sided but infinitely-sided, such that, say, every power of 2 appears on the die once.

In that case, the same kind of reasoning we used for 4, 2, and 6 above could be used for any number. Out of all the cases where the red envelope contains a 4, the average value of the blue envelope is 5; out of all the cases where the red envelope contains a 2, the average value of the blue envelope is 1.25; out of all the cases where the red envelope contains a 10, the average value of the blue envelope is 12.5; out of all the cases where the red envelope contains a 7, the average value of the blue envelope is 8.75; etc.

Is any of that wrong? Because it’s exactly the same as what we did just a moment ago with the 6-sided die. Would you suddenly raise any objection to it now?

Well, now we apply the law of total expectation, which is just a fancy way of saying you can average the values in a rectangle by first averaging each column, then averaging the results. And we discover that, overall, over all cases, the average value of the blue envelope is… well, it’s some number, let’s call it B. And let’s use R to describe the average value, over all cases, of the red envelope. What we discover by using the law of total expectation is that B = 1.25 * R. And, at the same time, symmetrically, R = 1.25 * B.

Do you understand that? Do you see how the law of total expectation is being used here? Because if you don’t, you don’t really have any idea what Little Nemo is talking about and you’re tremendously missing the point.

First, let me ask OP if he understands that his (fallacious) assumption yields
E[X | X < Y] = E[X | X > Y] = E
whereas it is easily seen that, for any pdf satisfying Kolmogorov’s axioms
2* E[X | X < Y] = E[X | X > Y] = 1.5* E

You say you’ve known this all along. Can you now see that in the fallacious “proof” E is substituted for E[X | X < Y] without justification?

This is the only encouragement I needed! I retract my resignation and now post the summary that must satisfy Little Nemo.

(In OP we are presented with two envelopes containing $K and $2K, though we know not which, nor what $K is. We pick one envelope at random, denote its contents by X and the other envelope’s contents as Y. Clearly E[Y] = E.)

OP asks us to present the flaw in the following derivation

E[Y] = 0.5 E[2X | X < Y] + 0.5 E[.5X | X > Y]
= 0.5 E[2X] + 0.5 E[.5X]
= 1.0 E + 0.25 E
= 1.25 E

The error is made in the 2nd line, of course, where we assume that
E[2X | X < Y] = 2* E
This is the flaw. Nemo understands this much. He asks for further elucidation.

Perhaps we should preface the answer by calling Nemo’s attention to two points worthy to note.
(1) We’re not dealing with some “quirk” in the E operator, similar “fallacies” can obtain with most statistical measures.
(2) The flaw is not unique to a wierd envelope paradigm, but is of more general relevance, as we clarify now by example.

Suppose you don’t know Dana’s sex, but have reason to believe he/she is heterosexual. You now write
E[sex(Dana)] = .5 male + .5 female
but this does not apply in in a conditional:
E[sex(Dana) | Dana’s partner is male] is not equal to E[sex(Dana) | no further info]

I want to say, I sincerely thought these two posts of yours were very good. However, I disagree with the idea that allowing Z to be a non-integer is very silly for the OP’s question. I think if you ask the OP, they will tell you they intend for it to be possible for arbitrarily small amounts to be placed in the envelope.

Also, I disagree with the idea that there is no useful uniform infinite discrete “distribution” with which to analyze the OP’s question; it is technically true that there is no such thing satisfying every last one of the Kolmogorov axioms, but I think it can be well worth analyzing the OP’s question in the context of a slightly relaxed, non-Kolmogorov notion of distribution which allows for such a thing. But I’ll return to this in a second.

That is not the reasoning being made. You have misrepresented it.

The reasoning being made is that E[Y | X] = E[Y | X < Y, X] * P(X < Y | X) + E[Y | X > Y, X] * P(X > Y | X) = E[2X | X < Y, X] * P(Y = 2X | X) + E[X/2 | X > Y, X] * P(Y = X/2 | X) = 2X * P(Y = 2X | X) + X/2 * P(Y = X/2 | X) = (2 P(Y = 2X | X) + 1/2 P(Y = X/2 | X)) X = 1.25 X on the assumption that P(Y = 2X | X) = P(Y = X/2 | X).

Then, using the law of total expectation, we have that E[Y] = E[E[Y | X]] = E[1.25 X] = 1.25 E.

That is the reasoning the OP is using. It is essential that you understand the invocation of the law of total expectation. If you do not see that the last line is being used, then you have no idea what the OP is talking about.

BarryB is correct to note that the assumption P(Y = 2X | X) = P(Y = X/2 | X) is vital as well, and worth some discussion; however, given that assumption, the OP’s reasoning is perfectly correct. You have not correctly grasped the OP’s reasoning, and are pointing out a flaw in a different argument than the one the OP actually is referring to.

I’m sorry I haven’t yet been able to give the post relating the paradox to “ambiguous” infinite sums that I wanted to write up on Saturday, but I do intend to still write it up at some point…

But, alas, I have to go waste my day proctoring and grading a (rather late in the semester…) midterm right now. So in the meanwhile, I’ll just link to this again, even though I’d like to try to explain the same point more clearly later.

Just a quick post to let people know I’m not ignoring their posts. But I’m visiting family for the holiday and not spending as much time online so I haven’t been able to consider your posts in depth yet.

Question - is the expected value of the other envelope always 0.5 M or 2M even if you don’t open the envelope you’re holding?

Because, again, I can’t shake the feeling that this is a two-door version of the Monty Hall problem…

In the Monty Hall problem, you are given additional information from Monty which allows you to narrow down your search. In this situation you are not provided any additional valuable info beyond the initial setup.

To septimus, RaftPeople, RedSwinglineOne or anyone else who care to take a swing at it, I’ve read the thread and am convinced that the error in the paradox consists in misusing the concept of expected value. In addition to the points mentioned, the fact that the OP’s calculation gives a value of 1.25 when it should be 1.5 signifies to me that something must be wrong. What hasn’t been explained is why the envelope-switching problem is different from the wager problem. Little Nemo asked why back in Post #206, but it seems to have been overlooked.

To illustrate, let’s take a version of the problem which I think is equivalent to the OP, but easier for me to work with because I do better with examples. You’re given two envelopes, one of which contains twice as much money as the other. You open one and see $100 (X). The question is whether you should switch for the other, which contains Y, by stipulation either $50 or $200. That looks a lot like the wager problem. You hazard $100 for what looks like a 50/50 shot at either $50 or $200. Where does this go wrong? FWIW, I’m pretty sure that’s the point of the OP.

Recapitulating, one envelope has X, with expected value E; the other Y with expected value E[Y]. We must distinguish three games, which have different analyses.

Game 1: Real-world; we don’t know what X is.
Game 2: Real-world; we do know what X is.
Game 3: Impossible world, with infinite pdf’s.

Indistinguishable among others keeps directing attention to Game 3, most interesting from a pure math standpoint, despite that it’s “impossible” in the real world since it assumes no finite bounds on envelopes’ contents, even though a reasonable real-world assumption might stipulate that no envelope has more than a few sextillion dollars.

I hope Indistinguishable comments on the application of such pdf’s to real-world problems. That’s a topic of which I’m quite ignorant.

But I think OP relates to real world with realizeable dollar amounts, so let us consider only Games 1 and 2.

In Game 1, E[Y] = E is obviously correct (I don’t know where you get 1.5); the erroneous E[Y] = 1.25 E derives, as you say, from misusing expected value.

In Game 2, you should switch whenever
prob(Y > X) > 1/3
If you assume that prob(Y > X) is a constant 1/2, then indeed you should always switch.

The problem is that assuming prob(Y > X) is a constant 1/2 is counterfactual. If Bill Gates hands you an envelope with X=$30,000,000,000 you can be pretty sure Y doesn’t have 60 billion (even Mr. Gates doesn’t have that kind of money lying around). If X=$1 you can be pretty sure Y isn’t 50 cents (Even Mr. Gates isn’t so stingy).

So what is p(Y > X) ? Or, for the specific example, p(Y = 200 | X = 100) ?
We don’t know!! Since we don’t know, p =0.50 might be as good a guess as any. But from considering the boundary cases, it should be clear that p(Y > X) = .5 can be generally true only for an “impossible” pdf.

Hope this helps. :smiley: