3 ms·
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
by btilly 2y ago
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 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.
- hansvm 2y agoThat 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.
- LudwigNagasena 2y agoThe success is checked after the decision is made to, well, verify the decision. The guess isn't adjusted on whether the number is between two values. 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.
- btilly 2y agoNo, I'm not doing anything other than tracking it. I'm doing that to show the user, "How much of this success was chance 50% choices, how much was guaranteed?" And so people can see how much of a good or bad result was blind luck versus the strategy successfully sticking a thumb on the scales. In other words, I'm merely trying to be informative.
- raincole 2y agoYou'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?)
- btilly 2y agoExactly right. After you've picked the envelope, you may be nearly guaranteed to be wrong. For example both numbers are large positives and you picked the smaller. Now you're almost guaranteed to guess larger, and be wrong. But before you pick, your odds were still bigger than 50%. Just not by much.