5 ms·
Sorry, 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 t
by jamii 13y ago
Sorry, 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.