The question leaves that distribution completely hidden, and your answer smuggles it back in. That feels less like a counter-intuitive math/stats question and more like a badly worded gotcha.
The question leaves that distribution completely hidden, and your answer smuggles it back in. That feels less like a counter-intuitive math/stats question and more like a badly worded gotcha.
Let's play this game exactly once.
You choose two unequal real numbers. I don't know what they are, and I don't know the distribution from which you choose them. You write them down and put them in separate envelopes.
I'm allowed to choose one envelope and open it to see the number inside, and my job is then to say which envelope holds the larger number.
I claim I have a strategy now which lets me win strictly more than 50% of the time. My strategy is this.
I choose a real number R at random from a distribution that has dense support. In other words, for any two reals, L and U with L<U, P(L<R<U) > 0. This is easy to do ... one method is to list the rationals, positive and negative, then roll a die, discarding numbers until you get a 6.
Now I flip a coin and thereby choose an envelope at random. I proceed by assuming my chosen number is between your two numbers. There is a non-zero chance this is true ... call it e. So e>0.
If I'm wrong then my choice is 50% ... probability is 1-e.
If I'm right then my choice is 100%. ... probability is e.
Combined, my chance of being right is 0.5(1-e) + e = 0.5+e/2, which is strictly greater than 50%.
You can make it as small as you like, and if we play the game repeatedly then you can make it approach 50%. But as it stands, with a one-off game, I can win with a probability that depends on your chosen numbers, but which is strictly bigger than 50%.
I am a mathematician, so please bear with me when I try to explain how this can work.
The rational numbers are countable, and that means that I can write a list of them. There are several ways of doing this, but personally I like the Calkin-Wilf tree[0]. That only gives the positive ones, but we can include zero and the negative ones by interleaving them.
So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0.
One you have chosen the two numbers, L and U, I note that there are rational numbers in between. Choose one of those numbers, call it M.
M is in my list above. Now I roll a die, discarding numbers from the list until I get a 6. There is a non-zero probability that the number retained is M, so there is a non-zero probability that my chosen number is between L and U. So e is definitely non-zero.
The second problem is, what does it mean to choose a real at random?
It doesn't have to be uniformly at random -- that's the mistake nearly everyone makes -- and the above process does it perfectly well. It only ever chooses a rational number, but that's OK. It's still a real number, it's still a random number, and for any non-empty interval, there is a non-zero chance the chosen number is inside.
... as a human living in the finite universe there are limitations to your choice.
Yes, but that is accounted for in the explicit description of how to choose the number.
Any number you can write using all the atoms in the universe is infinitely outnumbered by all numbers that you can't.
Again, this is accounted for by the fact that we are not choosing uniformly at random.
So ... yes, choose from a Gaussian, but then you have to tell me exactly how.
That's tricky.
Yes, it's established there isn't "uniform distribution over all real numbers" without violating axiom of probability. You're 100% correct on this.
But it doesn't make Colin's solution wrong, because e > 0 for any* well-defined distribution.
> Which is a different problem than stated originally
There are two ways to inteprete the original problem:
A. The numbers are truly randomly picked over all real numbers.
B. The numbers are picked from a well-defined distribution which is unknown to the player.
Since A. is invalid mathematically speaking (without changing the commonly accepted definition of probability), it's reasonable to only consider B., in which case, Colin's solution is correct.
I made a more intuitive explantion on why a strategy better than coin toss exists here: https://news.ycombinator.com/item?id=42372972
*: More strictly, any distribution that guarantees the probability that the two numbers in envelope are the same = 0.
We can't have an uniform distribution over all real numbers, so it's quite pointless to discuss if looking into the envelope gives any new information, cause we don't even know the distribution yet.
There are no hidden conditions. It is just a shocking result that we don't expect.
It's not saying that after the player see the number in the first envelope, the strategy guarantees a >50% outcome.
It's saying that give any distribution, over all possible outcomes, >50% times the strategy will end up pick the larger number. You can say this >50% is the expected winning chance before the player see the number in the first envelope.
I'd say this is "intuitve" because, if your strategy can guarantee "when the player see a large number in the first envelope, he's less likely to switch than if he saw a small number", it would be better than blindly switching by coin toss. So intuitively such a strategy exists.
The only "trick" here is that since the player doesn't know the initial distribution, they can't tell "how large counts as large?" therefore they needs something that preserves some property over the whole real number line. That's why the strategy involves sampling from a another distribution whose PDF is non-zero everywhere.
If your solution is the same as this article's, it's plain wrong. Even the natural number case is plain strong.
It's very easy to demostrate as well: consider a trivia case where the distribution is just {P(1)=1/3, P(2)=1/3, P(3)=1/3} and you see 2 in the first envelope. There is no strategy to get a better chance than 50%. Therefore, any strategy that gives a better chance than 50% must implicitly make an assumption over the initial distribution (and therefore excludes a distribution like {P(1)=1/3, P(2)=1/3, P(3)=1/3})
Actually the article is even "wronger" than this, because "started A" and "switched" aren't independent and one can't simply use the product of their probability. The above example is a quick way to demonstrate it's not a general strategy without assumption to get >50% winning chance. Similarily, one can just use {P(1)=1/3, P(2)=1/3, P(3)=1/3} (this is a valid distribution over real numbers!) to demonstrate the real number strategy isn't general.
Again, for both natural number and real number case, the discussion over strategies is only meaningful is we know something about the distribution.
Interestingly, this article is wrong more or less in the same way as believing switching does give you more expected value in the original "twice money in another envelope" variation.
Edit: For people who are interested in the switching strategy, check Randomized Switching in the Two-Envelope Problem (2009). Spoiler: full of discussion over the initial distribution.
I don't actually care how you convince yourself. But the explanation is right. If your random number is outside of the range, you've got even odds. If it is inside of the range, you've got 100% odds. As long as there is a positive probability of being between, you've got strictly better than even, by half of the probability of being between.
Many, many distributions guarantee positive odds of being in between. The one I chose for my program was:
(log(rand) * (flip_coin() ? 10 : -10 ))
Which is the log of a random number between 0 and 1, times 10 times + or - with even odds. The various factors were chosen to fit well with normal human choices that most seek to test it with.The strategy is straightforward and bulletproof (if you allow a random generator of real numbers, otherwise you may keep tossing coins indefinitely): keep tossing coins until you get tails. If the number you saw is less than the number of heads you got, you don't switch.
For the simplest case assume that one envelope always contains 1 and another always contains 2. You choose one envelope randomly, so in 50% of cases you get 1, which you switch in 50% of cases. And in 50% of cases you get 2, which you switch in 25% of cases. Hence, you pick the higher number in 62.5% of cases. The same works with any numbers N, M; or any complex distributions; or even real numbers with a bit more complicated strategy. You don't have to know whether you are between two values in advance, you just have to guess.
In other words, I'm merely trying to be informative.
I thought you meant the strategy can make the winning chance always >50% even after the player opens the first envelope, which isn't possible.
However you actually meant the strategy can make the expected winning chance >50% before the player opens the first envelope, for any well-defined distribution of real number, even the distribution is not known to the player, which now I realize is true.
(I haven't thought through some edge case like Cantor distribution, but now I incline to it's true not just for "many distributions". Of course for a discrete distributions, we need to specifiy the two envelopes can't have the same number. Besides that, it seems to hold true for any distribution?)
But before you pick, your odds were still bigger than 50%. Just not by much.
Seeing 2 is only one of the many possible cases. You haven’t calculated the total probability.