Sorry, but you're simply wrong. You can read the answer I gave. You can read the answer Colin Wright gave. You can trust that we both have math degrees and know what we are talking about. Or, aw heck, you can try it with an actual program at https://www.perlmonks.org/?node_id=39630. (Yes, I wrote that piece of hackery about a decade ago.)
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.That code has the same problem that Colin Wright's explanation does. Your computation of the success rate explicitly uses the fact that you're between the two values, but till you've seen the second value you can't possibly know whether you are or are not and thus can't adjust your guess based on that fact.
You're correct. I realized that I completely misunderstoond the original problem after reading McDonnell's paper more carefully.
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?)