After a quick wikipedia rabbithole, I now grok the St Petersburg paradox, which is fascinating - https://en.wikipedia.org/wiki/St._Petersburg_paradox - but mostly tells me that the 'expected value' is not a good measure of whether you should bet on something, because games can be constructed in such a way that the expected value is infinite, but the chances of you even getting your stake back even at a $16 buy in are 1/8...
Can you explain how do you derive this?
print 10 * 10000 * (18 / 37 - 19 / 37)
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.Yes, the American version is twice as bad for the player, but it doesn't matter; people are still plenty eager to play it...
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.
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.
https://easylang.dev/ide/#code=n%20%3D%2010000%0Afor%20i%20%...