Logic question

There is clearly something wrong with the expected value calculation, as I showed in my last post.

In the $5/$10 scenario it should go like this.

(1/2X + 2X)/2

Plug in X, which is different for each of the two outcomes.

(1/2 * $10 + 2 * $5)/2 = $7.5

Which is exactly the same as the original envelope.

If you’re not allowed to open an envelope, then by symmetry it’s a coin-toss.
But assume you’re allowed to open an envelope and it contains, say $99.01.
An odd amount cannot be double another so you switch.
Therefore let’s assume the prizes have some knowable but uncountable value.

In that case it turns out that optimal play is to keep the envelope you opened if it contains more than $X, where $X is some value you picked beforehand. Abstractly if matters NOT what X you pick . . . though in practice your financial situation may play a role!

That is utterly opaque and meaningless to me.

What is a “scenario” in your parlance?

For any pair of two envelopes that are honestly mutually following the half-or-double rule, the X value is fixed. For that pair of envelopes. X is unknown to us, but is known to be fixed. EV logic applies, insofar as EV logic can ever be meaningfully applied to a single trial.

Conversely,

If we whip up e.g. 50 pairs of envelopes marked in a way that we can tell which envelope is paired with which other, but with no other way to distinguish envelope pair J from envelope pair Q, and each envelope pair was prepared with a different X value then EV is equally applicable to each pair as it is in the single envelope scenario.

I grant that someone’s actual outcome in opening all 50 envelopes after switching (or not switching) will vary as they may, by luck, open the larger envelope of a pair only on large-valued pairs, and the small envelope only on small-valued pairs. With the net result of an answer other than 1.25 * (the average of X values for the entire set).

But if that’s supposed to be the point of this thought experiment, I’ve had to add an awful lot of unstated parameters and restrictions to achieve this banal result.

I think part of the problem here is that there are many different variants on this puzzle, and the OP didn’t precisely specify which one we’re talking about, so different folks are ending up talking about different puzzles.

The OP didn’t specify that you could open the envelope, then switch.

If you can’t open an envelope, just take one or the other, it doesn’t matter which one you take. If you can open an envelope, then switch to the other one, open then switch. You’ll be wrong as often as you are right, but doubling is more helpful than halving is harmful if you are in a context where each dollar is as valuable as the next.

And this is the part that’s wrong. After you open the envelope and see the dollar amount, you now have more information, and should use that information to decide whether to switch or not, because the other envelope is not equally likely to be double or half.

And assuming we’re not talking about truly extreme dollar amounts, like billions or trillions, how do we know that the odds of double-or-half are asymmetrical?

Or at least are asymmetrical enough that the 1.25x logic is reliably overridden? Or was the 1.25 EV logic never actually appliable to begin with? It just seems to be applicable, and that seemingness is where folks are getting derailed?

Color me as lost as ever.

Given what’s on the envelope, and the infinite number set, it is exactly equally likely to be double or half. Otherwise you’ve got a rigged game.

Yup, it’s a rigged game, because it can’t not be rigged. Again, a distribution where all numbers are equally likely is completely impossible. We must find some other basis on which to assume a distribution.

What dollar amounts are truly extreme depends on the context. If it’s Jeff Bezos running the game, then dollar amounts in the thousands or maybe even millions of dollars might be perfectly plausible. If it’s the statistics teacher two doors down from me running the game, then even a thousand dollars is definitely “truly extreme”.

Let me give some concrete examples. Mr. C, the stats teacher, randomly picks a dollar amount x, somewhere in between $1 and $10. He puts x in one envelope, and 2x in the other envelope. He tells me that he did this. I take one envelope and open it. Should I switch to the other envelope? Well, obviously that depends on the dollar amount. If my envelope contains $3, then the other one could equally well contain either $6 or $1.50, and I’m better off switching. But if my envelope contains $12, then I absolutely know that the other one must contain $6, because, in this setup of the problem, it can’t contain $24, and so I know that I absolutely shouldn’t switch.

Scenario 2: Mr. Bezos randomly picks a dollar amount somewhere between $1000 and $10,000. He puts that amount in one envelope, and twice that amount in another envelope, and tells me that’s what he’s done. I take one envelope. Now, if I get $3000, I want to switch, but if I get $12,000, I don’t.

Scenario 3: The puzzle-runner picks some random dollar amount x between $0 and $1. He then flips a fair coin repeatedly until the first time the coin comes up heads (which might be after one flip, or might be after many flips). Call it y flips. He then puts y*x in one envelope, and 2*y*x in the other envelope. He tells me that he did all of this. Now, there’s no upper cap on the possible value of the envelopes, but smaller numbers are more likely than larger numbers. I open an envelope, and find that the amount in the envelope is some amount, call it $z. The other envelope could contain $0.5z, or it could contain $2z, but it’s more likely to be $0.5z. In fact, it’s twice as likely to be $0.5z as it is to be $2z. And so the expected value of the second envelope is (2/3)*0.5z + (1/3)*2z, which is exactly equal to z. In this version of the game, even after I look at the value I have, it doesn’t ever matter if I switch or not.

OK, those are all possible scenarios, which lead to different optimal behaviors. But what if the game runner doesn’t tell me how they picked the numbers? Then I have to guess how they did it, and depending on how I guess, I might use one strategy or another.

Disagree, a distribution where all numbers are equally likely is completely possible. Any computer can generate one and only one instance of a number as high as you’d like to go. It is trivially easy to create a scenario where all numbers are equally likely.

Now, if you really don’t know the distribution, and you want to make it a point that you have to know the distribution to make a choice, that you can’t assume equal, then if you know nothing you can make zero determination of what to do. Because you don’t have enough information.

The game can be rigged. It could also be rigged the other way, to favor higher numbers over low. But you actually need information to determine that.

Those are two different things. The second is possible, but not the first. I can set up a computer to pick a random number uniformly from 1 to 10. I can set it up to pick a random number uniformly from 1 to 1,000,000. I can set it up to pick a random number uniformly from 1 to BIGNUM, where BIGNUM is the largest number that computer is capable of representing. But I cannot set it up to pick a random number uniformly from 1 to \infty.

No, it couldn’t.

I’ve already addressed the infinity issue and agree that you don’t know anything until you open one of the envelopes to establish context.

Rigging the game in terms of large or small numbers doesn’t work mathematically either way. This is assuming you are allowing for fractions of whole numbers. There are always smaller fractions on into infinity as well.

If you are only allowing for whole numbers, if you open the first envelope and it’s an odd number, then you always switch because an odd number can only be the lower of the two numbers.

Real life rigged games just make up whatever distribution they want and aren’t attempting to match any mathematical formula.

Again, the problem presents as being given two envelopes with the messages that are true. I am assuming that if you open the first envelope, the second envelope cannot be changed at that point. It is what it is. So if you open an envelope and it contains $10, you can calculate that the game is rigged and you are more likely to be presented with a $5/$10 choice than a $10/$20 choice.

The problem there is you are just as likely to open the envelope with $5 as you are the $10 envelope. And if $5/$10 is more likely than $10/$20, then $2.5/$5 is going to be that much more likely than $5/$10. Basically, you always assume whatever envelope you open is higher, because there are always many more of the smaller numbers on into fractional infinity. Of course, this runs against the problem that you are equally likely to be picking a lower number as compared to a higher number.

If fractions are eliminated, there is a problem for “the house” in that the most likely combination is going to be $1/$2, and the player is going to know that they can always switch out the $1 envelope and get $2 every time.

Yes, I was assuming that the dollar amounts could be any rational number, to avoid the even/odd issues.

Low numbers will, in general, be more likely than high numbers (more formally: There will always exist some finite number such that, beyond that finite number, the probability of a given number decreases as the number increases), but for some versions of the game and some values of the number you see, this is counteracted by the fact that you stand to gain more than you stand to lose. So it will often be the case that it’s advantageous to switch. Just, not always.

Exactly. There’s no “net benefit” to swapping until you’ve opened. Before that, what you have or swap is pure chance.

This is basically “double or nothing” without the “nothing”.

I’m late to the party, but I’m happy to take a swing at things. Stop me anywhere along the way.

If we want to talk about expectation values at all, we are implicitly bringing in the notion of (prior) probability distributions on the initial values in the envelopes. We should consider two different cases.

(1) The first is where there is not anything infinite going on, and the easiest case of this is a uniform distribution for (say) the smaller envelope’s value x. Let’s say that x is chosen uniformly between 0 and some maximum value M. The other envelope gets a value 2x, which necessarily runs from 0 to 2M. If we (the player) know the value M, then we can calculate expectation values and optimal strategy without issue. In particular…

  • If we’re allowed to look inside our envelope before deciding what to do, then we can choose to always switch if we see an actual number q<M, and we can choose to always stay pat if we see q\ge M. Calculating the expectation value here is non-controversial enough, and there’s no concept of “always switch”. We could dig into the math of this case more, but I don’t think it’s any source of confusion.
  • If we aren’t allowed to look inside our envelope before deciding what to do, then we can calculate the expected value of switching vs. staying, but we must take care not to flip-flop what our variables mean mid-calculation, as many have pointed out. One way to do this is the “boring” way that doesn’t introduce any risk of mistake, namely just noting that we have a 50% chance of having either envelope regardless of if we switch or stay. Another way to do this is as suggested in the problem statement: assume we’re holding a fixed q and claim (incorrectly!) that the other envelope must have either q/2 or 2q, with equal probabilities. This assertion cannot be true, since any q\ge M that we might be holding must be the larger value, and any value q<M that we might be holding has a one-third chance of being the larger value, based on how the envelopes were filled and initially handed out. We have to do a probability-weighted sum (well, integral) across all possible q values we might be holding, taking into account that we’re three times more likely to hold q<M than q\ge M. Doing either the “boring” approach or the “integral” approach for either strategy (switch or stay) always yields the same answer: no matter what you do, the expectation value for this game is \frac{3}{4M}.

(2) The next case is to try to make it true that “the other envelope must have q/2 or 2q with approximately equal probability”, approximate enough such that our switching decision is valid. A first thought might be to just make M from the previous case very big. But that just changes the units of our money; we’re still exactly in case (1) regardless of how big M gets. The next thought might be to have the distribution still only go out to a finite maximum value but have some sort of roll-off. This, too, maintains all the essential nature of case (1), even if the distribution isn’t uniform. A final thought might be to truly let the distribution go to infinity to provide plenty of “buffer”. Now we have to start being careful.

We require that the distribution is well-defined, such that the sum (well, again, integral) across all possibilities is finite (and ultimately scaled to be equal to 1.) Otherwise, we can’t even sensibly fill the envelopes.

Given this, we can attempt the same sort of integral as in case (1) to calculate (say) the difference in expected values between switching and staying. And, we want to understand whether there can be a well-defined distribution that still leads to a conclusion of “we should always switch”.

You can in fact create such a distribution, but it must have infinite mean. This in turn means you actually don’t calculate “always switch” in these cases but rather that your expected value for any action you take is infinity, which precludes any well-defined decision making.

If you instead limit yourself to distributions that have finite total probability and have finite mean, then the expected return on switching is provably zero if the conditional probabilities are handled correctly (as in the case (1) example). That is, the expected gains and losses from switching always sum to zero across all potential instances of the game (as they must). Alternatively stated, the assumption that 2q and q/2 are equally likely simply can’t hold for any well-defined case.

(Please advise where more exposition is best applied.)

This should, of course, read \frac{3}{4}M

If you are not handed the first envelope at random then it is not possible that the statement on the back of each envelope is true. The only way the statement “The other envelope has an equal chance of containing either half or double the amount of the current envelope” can be true for both envelopes is if they are assigned randomly. But, if you start with a 10 and a 20, shuffle them up and pick the first one at random, then the statement on the back of the envelope will always be true until you open it.

If the first envelope is fixed to 10, and the second envelope is set randomly to either 5 or 20, then the statement on both envelopes will be true.

Thanks for your explanation. I think this one is the best summary yet, and I agree with everything.

I think the original problem is supposed to be that you have two values, and then shuffle the envelopes around. And the paradox arises from the incorrect expectation value calculations.