4 ms·
Thank you for writing. Very clearly explained. Can you explain how do you derive this? print 10 * 10000 * (18 / 37 - 19 / 37)
by iamcreasy 3y ago
Thank you for writing. Very clearly explained.
Can you explain how do you derive this?
print 10 * 10000 * (18 / 37 - 19 / 37)
- alexeldeib 3y agoPer round expected value of +/- 10, times 10k rounds, 18/37 lose probability 19/37 win probability.
- Jtsummers 3y agoThat's an expected value calculation. It breaks down into three parts: 1. The wager per round ($10). This is, in the game being simulated, the amount won or lost based on the game's outcome. 2. The number of rounds (10000). 3. The probability of winning minus probability of losing. Forgetting the number of rounds for a moment, the way to calculate the expected value of a single wager like this is: E[X] = x1*p1 + x2*p2 + ... + xn*pn Where each `xN` is the value (amount won or amount lost since we're talking about wagers) of an event and `pN` is the probability of that event. In this case there is an 18/37 chance of winning and 19/37 chance of losing. The value of winning is +10 and the cost of losing is -10. So the expected value of a $10 wager ends up being: 10 * 18/37 - 10 * 19/37 Multiply that by 10,000 for the number of rounds played and you get the expected value of a series of games.
- sokoloff 3y agoNote that's the calculation for a European (single green 0) wheel, not the American (green 0 and green 00) wheel, in which you'd replace with +18/38 (or 9/19) and -20/38 (or 10/19). Yes, the American version is twice as bad for the player, but it doesn't matter; people are still plenty eager to play it...
- listenallyall 3y agoI'll note that if you can deterministically calculate an EV, a Monte Carlo simulation isn't necessary. The fact that the EV of roulette is so easy to calculate defeats the purpose of this exercise. Perhaps the MC can help you conceptualize volatility and distribution of results, but once you know that the EV is negative, there's no good (mathematical) reason to participate.
- User23 3y ago> but once you know that the EV is negative, there's no good (mathematical) reason to participate. Unless of course you know that the casino is willing to pay you out as part of their marketing budget (based on your ev to them); usually in the form of compensated room, food, and beverage, and sometimes even transportation. At that point your choice to participate becomes vacation planning for the mathematically literate.
- listenallyall 3y agoThat has nothing to do with the example presented in this article.
- chkas 3y agoIt is also about the "law of large numbers". If you go to the casino with $1000 and want to go home with $2000, the chance is more than 48% if you bet the $1000 on red. But if you play often and always bet $10 on red until you have $2000, your chance is less than 1%.
- listenallyall 3y ago...which is why I stated "the MC can help you conceptualize distribution of results", however again this doesn't really require an MC simulation. To achieve $2000 while betting $1000 requires you to win one bet more than you lose. To get there while betting $10 requires you to win 100 more. Common sense should tell you which is significantly easier to achieve.
- deleted 3y ago[deleted]
- chkas 3y agoIt is dangerous to rely on common sense. Many people believe that with a little luck you can win at roulette. Even according to my common sense, I would not believe that the chance is so low. But a little MC simulation tells me how it really is. https://easylang.dev/ide/#code=n%20%3D%2010000%0Afor%20i%20%3D%201%20to%20n%0A%20%20%20cash%20%3D%201000%0A%20%20%20while%20cash%20%3C%202000%20and%20cash%20%3E%3D%2010%0A%20%20%20%20%20%20cash%20-%3D%2010%0A%20%20%20%20%20%20numb%20%3D%20random%2037%20-%201%0A%20%20%20%20%20%20if%20numb%20%3E%3D%2019%0A%20%20%20%20%20%20%20%20%20cash%20%2B%3D%2020%0A%20%20%20%20%20%20.%0A%20%20%20.%0A%20%20%20if%20cash%20%3E%3D%202000%0A%20%20%20%20%20%20win%20%2B%3D%201%0A%20%20%20.%0A.%0Aprint%20win%20%2F%20n%20*%20100%20%26%20%22%25%22%0A https://easylang.dev/ide/#code=n%20%3D%2010000%0Afor%20i%20%...