4 ms·
If it is possible to switch and gain on the average we could write a 10,000 or so iteration monte-carlo simulation of this switching algorithm to demonstrate th
by thatthatis 13y ago
If it is possible to switch and gain on the average we could write a 10,000 or so iteration monte-carlo simulation of this switching algorithm to demonstrate the gains.
The envelope has either x or 2x. One envelope has amount z, but the agent doesn't know if z = x or z = 2x.
If it is true that not switching leads to an EV of 3x/2 but switching leads to a higher EV: then a single switch each round should come back with an average value of greater than 3x/2.
In the Montey Hall problem, we can code up such an agent to demonstrate that the naive intuition is wrong. However, in this case, regardless of how many times we switch, we still end up with an average value of 2x/3.
Therefore there is an error in the math that says that switching has a higher EV than staying.
- jamii 13y agoGo ahead and run a few million simulations of the problem and graph the running mean over time. You might be surprised :) Be sure to use exact arithmetic (eg http://docs.python.org/2/library/fractions.html http://docs.python.org/2/library/fractions.html)
- thatthatis 13y agohttps://gist.github.com/tedtieken/6567112 https://gist.github.com/tedtieken/6567112 Run the simulator and you'll see, the ev is 3x/2, regardless of switching behavior. Feel free to modify if you think I've innacurrately conceptualizer the problem. Also, please excuse some non pythonic names, I'm writing the code on an iPhone.
- jamii 13y agoSorry, I should have been more specific :S You have assumed a fixed amount in each envelope. The article leaves the amount unspecified but implicitly assumes that there is no maximum amount that could be in the envelope. The problem only becomes interesting for certain distributions. Try this code: https://gist.github.com/jamii/6567205 https://gist.github.com/jamii/6567205 If you run it with the uniform distribution the running mean will eventually converge to 0. If you comment that out and uncomment the exponential distribution it is much more interesting :) With the exponential distribution the expected value of switching does not even exist. EDIT Doh, the original gist was totally wrong. That'll teach me to argue on the internet at 3am. The updated gist is correct.
- thatthatis 13y agoFixed amount vs variable amount is irrelevant, variable amount just requires higher n. Either way, the gain from switching approaches zero as n approaches infinity.
- jamii 13y agoIt does make a difference but I messed up the code :S If you try the updated gist you will find that the second distribution appears to converge for a while but always jumps away again. I've run it now for 20540000 rounds and its further away than it started.
- thatthatis 13y agoErr, that last ratio was supposed to be 3x/2 again