4 ms·
Generate a random number T from the arctan distribution. If the number in the other envelope is greater than T, switch. For envelopes with two different numbe
by metacritic12 4y ago
Generate a random number T from the arctan distribution. If the number in the other envelope is greater than T, switch.
For envelopes with two different numbers n, m, the above is guaranteed to give you the higher one strictly more than 50% of the time.
- zeroonetwothree 4y agoTo expand on this, you can use any distribution that has nonzero density over every interval.
- ChrisLomont 4y agoYep - any distribution that is nonzero over the set of choices works, so over the reals, anything that is everywhere nonzero works. For example, exp^{-x^2} with normalization factor is a simple choice.
- emerongi 4y agoIs there a complete explanation for this somewhere? Asking for a friend, I obviously fully comprehend what you're talking about here.
- ChrisLomont 4y agoYeah, the solution is somewhat tricky. Here is the idea (this is somewhat sloppy, but gives the idea - if you're mathematically advanced all this can be made precise): Suppose you have a way to pick a random number yourself, that has nonzero chance to pick any number. Suppose the person putting things in envelopes picks X < Y as their numbers. You too pick a random number, say T. Open an envelope. If that envelope is less than T, then switch. You will get the larger number more than half the time. Here is why it works. You pick X or Y envelope with 50/50 odds. 3 cases: 1) Suppose you picked a T < X. If you opened X, then T < X, you don't switch, so you lose. If you opened Y, T < Y, you don't switch, you win. So if T < X you win half the time. 2) Suppose you picked a T with Y < T. Then no matter what you pick, T is not < your envelope, you will not switch, and again you win half the time. Nothing gained so far. But, if you happened to pick X < T < Y, which happens with some nonzero chance, then analyze: if you open X, X < T, switch, you win. If you open Y, T < Y, you don't switch, you win. This case gives you more than 50/50 odds. The technical details is it's minorly tricky to pick a real number out of an infinite set at random, with any number being a possible outcome. But the probability distributions above do the trick - basically any function you can draw that is everywhere positive, with the tails squeezing to zero fast enough (but never reaching it) will work.