Thread Rating:

MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 22nd, 2023 at 10:11:39 AM permalink
SUMMARY: How to calculate or simulate how much to bet per round for casino games given a starting bankroll, hours of play, rounds per hour, and risk of ruin (RoR)?

DETAILS: A forum member asked me to expand my table of How Much to Bet Per Round to include more hours. At first I thought, well, I dim the sims on my computer like 20 years ago, now desktop computers are fast enough, so I'll just make it a calculator and let the user enter the number of hours they want. Then I realized I have no idea how to do that. I don't remember how I did it with the sims I made 20 years ago, but probably I just did trial-and-error, continually plugging in numbers until I got the right RoR result. I guess I could code it the same way, starting with a best guess, and continually running loops as I get closer and closer to the desired RoR, but that seems kind of messy.

My understanding of the Kelly Criterion is that it doesn't work for negative-expectation bets, doesn't take into account volatility, and can't target a particular RoR.
I run Easy Vegas ( https://easy.vegas )
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
Thanked by
Dieter
February 22nd, 2023 at 11:03:49 AM permalink
Use the Ace2 conjecture

For relatively low edge games, the risk of ruin for a given session & bankroll will be about double the probability of finishing the session with a bankroll below zero.

At very least, put the game in binary format and calculate the probability of finishing below zero. You know your RoR is higher than that
It’s all about making that GTA
Mental
Mental
  • Threads: 16
  • Posts: 1549
Joined: Dec 10, 2018
February 22nd, 2023 at 3:30:46 PM permalink
Quote: MichaelBluejay

SUMMARY: How to calculate or simulate how much to bet per round for casino games given a starting bankroll, hours of play, rounds per hour, and risk of ruin (RoR)?

DETAILS: A forum member asked me to expand my table of How Much to Bet Per Round to include more hours. At first I thought, well, I dim the sims on my computer like 20 years ago, now desktop computers are fast enough, so I'll just make it a calculator and let the user enter the number of hours they want. Then I realized I have no idea how to do that. I don't remember how I did it with the sims I made 20 years ago, but probably I just did trial-and-error, continually plugging in numbers until I got the right RoR result. I guess I could code it the same way, starting with a best guess, and continually running loops as I get closer and closer to the desired RoR, but that seems kind of messy.

My understanding of the Kelly Criterion is that it doesn't work for negative-expectation bets, doesn't take into account volatility, and can't target a particular RoR.
link to original post

I know you enjoy my nit-picking about terminology. RoR traditionally applies applies to +EV wagers over infinite time. I don't feel ruined if the money I bought to the casino is lost.

The fastest way to get outcome distributions for large numbers of games is convolution. When you go from the probability distribution for all possible outcomes of one coin flip then to two to three to four, you are convolving the simple probability distribution for n, Pn, with P1 to get Pn+1. However, you can go from P2 to P4 by just convolving P2 with P2, then to P8 by convolving P4 with P4, etc. You can get to very large final distributions very quickly this way. I used to calculate distributions for 1M VP hands this way (actually 2^20 hands).

These are final distributions assuming you never go broke. In order to see what fraction of players have gone broke, you need to just count the part of the tail that goes below your session bankroll. You set this tail to zero and convolve again and more players will go broke.

If you do this too quickly, you won't have accurate RoR. For example, if you go from 256 to 512, some of the players that still appear solvent after 512 games actually have recovered from having negative bankrolls. That is, the should be counted as tapped out. To avoid this, you can save the smaller Pn arrays and use this to move more slowly when you get near the RoR target. For example, you might convolve P256 with P8 or P16 to minimized this error.

So, you could always move forward convolving by P1 and taking out the folks who went broke. This would be very accurate but slow. Or you could have an algorithm that detects that it is moving too fast (too many people are tapping out in one step) and automatically slows down to get a good balance of speed and accuracy.

If you are talking about 500 games of craps or similar, this will be very quick and accurate.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 22nd, 2023 at 6:38:41 PM permalink
Quote: Mental

I know you enjoy my nit-picking about terminology. RoR traditionally applies applies to +EV wagers over infinite time....

Actually, your comments don't even rise to the level of nitpicking, because they're simply wrong. Just like in the other thread, you claim that a term has only a specific, narrow focus, and then try to ding me for not using the term in the same narrow way you do. And in this case your sole definition isn't even the most common one: "risk of ruin" is most often used to refer to the probability of losing a catostrophic percentage of one's capital, regardless of whether the investment / gambling is +EV or not.

As for your suggestion about how to calculate, I didn't follow any of it.
I run Easy Vegas ( https://easy.vegas )
ChumpChange
ChumpChange
  • Threads: 131
  • Posts: 5112
Joined: Jun 15, 2018
February 22nd, 2023 at 6:51:28 PM permalink
If I put in a $1,000 max loss, it says I can play 2 quarters of VP for 4 hours, or I could play 4 hours of craps at $50 on the PL, or play $26/hand at BJ (because there's no 50 cent pieces left in the casino?), or $24/hand for 4 hours of Baccarat. So that's basically a buy-in of 20 units for the PL and 40 units for BJ or Baccarat.

I'm working on how long $2,500 will last me on MS Stud ($10 minimum) or UTH ($10 or $15 minimum). Apparently not long enough to hit quads on MS Stud.

I was down one $50K buy-in and was on my second one then I hit quad Aces. If this was at a table, I would cash-out that $50K I was behind then continue the session.
I was betting $200 ante at the time, which is 20X the $10 ante I'm trying to simulate with 20X the starting session buy-in.
Last edited by: ChumpChange on Feb 23, 2023
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 22nd, 2023 at 9:58:48 PM permalink
Okay, so it looks like I'm gonna have to roll my own, starting with an educated guess, and continuing to do iterations until I get the specified RoR.

For my educated guess, I'm noticing that by eyeballing the results in my article from my ancient sims, it looks like quadrupling the play hours reduces the bet size by about half. So I can start with my figures for one hour, and adjust by the number of hours requested by the user.

For blackjack, a great shortcut is to use the probability for a specific win amount (-8 to +8) from the Wizard's Variance in Blackjack, which is an example of where he really shines (especially as no one else has published anything like that, as for as I know). However, it's for 3:2 blackjack, and I need to let my readers choose between 3:2 and 6:5, since 6:5 is now the dominant form (also, to show how your money is sucked away 3x faster with 6:5). The table shows a win ofd 1.5 having a probability of 0.04529632 for a return of 0.06794448. It looks to me like I can replace the 1.5 win with a 1.2 win, for a return of 0.054355584.
I run Easy Vegas ( https://easy.vegas )
Mental
Mental
  • Threads: 16
  • Posts: 1549
Joined: Dec 10, 2018
February 23rd, 2023 at 4:14:50 AM permalink
Quote: MichaelBluejay

As for your suggestion about how to calculate, I didn't follow any of it.
link to original post

Do you understand any of this: https://en.wikipedia.org/wiki/Convolution_of_probability_distributions
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 23rd, 2023 at 10:14:22 AM permalink
Quote: Mental

Do you understand any of this: https://en.wikipedia.org/wiki/Convolution_of_probability_distributions

Thank you, I appreciate your trying to set me on the right course. I'm afraid I can't really follow the WP article, though, it's over my head. I mean I understand some of it, but I'm far from being able to apply any of it. Also, based on what I saw there, I'm pretty sure this Javascript code would not work:

 for (i = -∞; i < ∞; i++) {}


However, I think the approach I mentioned earlier will likely be sufficient.

Though I do suspect that there's a formula that uses only arithmetic (my level) if I know the standard deviation of the game.
I run Easy Vegas ( https://easy.vegas )
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
Thanked by
ChumpChange
February 23rd, 2023 at 10:24:44 AM permalink
I’d equate blackjack to a 42% chance of winning each bet with a winning payout of 1.33 to 1. This is statistically similar to a game with a standard deviation of 1.15 and edge of 2.14% (about right for the average ploppy)

If you want 10% RoR, take the z-score for 0.05, which is about -1.64 SDs

For 500 rounds, your expectation is -10.7 units +/- 25.7. A bankroll of 10.7 + 25.7 * 1.64 = 52.9 units should give you close to 90% chance of survival. Close enough anyway

RoR, like most calculations, doesn’t have to be to the penny. There’s a lot of variance involved
It’s all about making that GTA
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 23rd, 2023 at 11:27:33 AM permalink
Thanks, Ace2, but I'm afraid I don't know how to apply this. I don't use much beyond basic arithmetic (which is good enough for most of my gambling calculations).

Can you write a formula for expected ending bankroll given a starting bankroll, bet size, # of rounds, and SD of the game?
Last edited by: MichaelBluejay on Mar 4, 2023
I run Easy Vegas ( https://easy.vegas )
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
February 23rd, 2023 at 12:55:54 PM permalink
I can’t think of a clearer way to write the formula than the way it’s shown above. It’s a very basic calculation

With all due respect: should you be doing probability / gambling calculations if your math skills don’t go beyond basic arithmetic? Especially RoR calculations, which can be complex
It’s all about making that GTA
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 23rd, 2023 at 1:43:05 PM permalink
Quote: Ace2

I can’t think of a clearer way to write the formula than the way it’s shown above. It’s a very basic calculation.

I'm sorry that it's not clear to me. First, I looked up z-score and I see that it's to calculate it I need a "mean of a group of values". What values?

I also don't see where you got the ±25.7. If the EV is -10.7 and the SD is -1.64, I thought the 1SD range would be (10.7 x 1.64 = ) 17.548.

Quote: Ace2

With all due respect: should you be doing probability / gambling calculations if your math skills don’t go beyond basic arithmetic?

Yes. As I said, arithmetic alone solves the kinds of gambling problems I generally deal with, and I've done so for decades. In this thread, if someone gave me a formula I didn't understand, I'd verify that I get the same results through simulation with several sets of variables, and if so, then why wouldn't I trust the formula? In this case, though, I don't understand the formula, because I don't know how to figure the z-core nor do I know where the ±25.7 came from.
I run Easy Vegas ( https://easy.vegas )
ChumpChange
ChumpChange
  • Threads: 131
  • Posts: 5112
Joined: Jun 15, 2018
Thanked by
MichaelBluejay
February 23rd, 2023 at 2:57:33 PM permalink
Square root of 500 = 22.36 x 1.15 = 25.7.

I should keep two or three 25 bet buy-ins in my wallet. Now where are those $1,000 bills?
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 23rd, 2023 at 10:50:57 PM permalink
Thanks to Mental's and ChumpChange's help, it seems like I'm pretty close to the finish line. Here's what I've got, and where I'm stuck.

(1) Find the SD of the game in question. (e.g., 1.15 for blackjack, though will vary by ruleset; the Wizard says 1.14 for a particular ruleset)

(2) For a target RoR, take the z-score. (-1.64SD for 10% RoR)

....Problem #1: I know that a z-score is how far a score is from the mean, in SD units, and that the formula is (score - mean) ÷ SD, but I don't know what "mean" to use. Assuming the "score" is the 0.10, and the z-score is -1.64SD as you say, the using algebra, the mean is:
(0.10 - m) ÷ 1.15 = -1.64
(0.10 - m) = -1.64 x 1.15
0.10 - m = -1.886
-m = -1.986
m = 1.986
I hoped that once I saw the value for the mean it would be obvious where it came from, but it's not.

....Problem #2: I don't know how 10% RoR means I take the z-score of 0.05. How do I know what z-score to take for other target RoR's?


(3) Calculate the EV. (rounds x bet x edge, e.g. 500R x 2.14% = 10.7 units)

(4) Calculate the SD in units. ( Number of rounds x SD, e.g. 22.36 x 1.15 = ±25.70)

(5) Add the EV to the SD in units times the z-score. (e.g., 10.70 + 25.70 x 1.64 = 52.85 units)

(6) Divide the number of rounds by the number of units to get the safe bet size for the RoR goal. (500 rounds ÷ 52.85 units = 9.46 units) That's pretty close to the $11 I arrived at through simulation, so that's good.
I run Easy Vegas ( https://easy.vegas )
Mental
Mental
  • Threads: 16
  • Posts: 1549
Joined: Dec 10, 2018
February 24th, 2023 at 3:14:13 AM permalink
Quote: MichaelBluejay

Thanks to Mental's and ChumpChange's help, it seems like I'm pretty close to the finish line.
link to original post

I am glad you are making some progress using statistics. I agree that nobody needs precision. I have chosen one video poker game over another due to having a 0.02% better RTP and not cared about the fact that the RoR was two times higher.

I think my suggestion was more of a distraction than a help.

I was thinking of a very generalized calculator where you could enter in the probabilities for outcomes of a single game and quickly get the accurate probability of going bust starting from a certain number of bet units. I may do this in another thread. If I create an algorithm maybe you or someone else can package it in a GUI. I have done html/javascript GUIs and I don't enjoy it at all.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
Ace2
Ace2
  • Threads: 32
  • Posts: 2706
Joined: Oct 2, 2017
February 24th, 2023 at 8:34:31 AM permalink
Quote: MichaelBluejay

Thanks to Mental's and ChumpChange's help, it seems like I'm pretty close to the finish line. Here's what I've got, and where I'm stuck.

(1) Find the SD of the game in question. (e.g., 1.15 for blackjack, though will vary by ruleset; the Wizard says 1.14 for a particular ruleset)

(2) For a target RoR, take the z-score. (-1.64SD for 10% RoR)

....Problem #1: I know that a z-score is how far a score is from the mean, in SD units, and that the formula is (score - mean) ÷ SD, but I don't know what "mean" to use. Assuming the "score" is the 0.10, and the z-score is -1.64SD as you say, the using algebra, the mean is:
(0.10 - m) ÷ 1.15 = -1.64
(0.10 - m) = -1.64 x 1.15
0.10 - m = -1.886
-m = -1.986
m = 1.986
I hoped that once I saw the value for the mean it would be obvious where it came from, but it's not.

....Problem #2: I don't know how 10% RoR means I take the z-score of 0.05. How do I know what z-score to take for other target RoR's?


(3) Calculate the EV. (rounds x bet x edge, e.g. 500R x 2.14% = 10.7 units)

(4) Calculate the SD in units. ( Number of rounds x SD, e.g. 22.36 x 1.15 = ±25.70)

(5) Add the EV to the SD in units times the z-score. (e.g., 10.70 + 25.70 x 1.64 = 52.85 units)

(6) Divide the number of rounds by the number of units to get the safe bet size for the RoR goal. (500 rounds ÷ 52.85 units = 9.46 units) That's pretty close to the $11 I arrived at through simulation, so that's good.
link to original post

1) 1.15 is a good number. Rule changes will have immaterial effect on the SD of the game

2) I have no idea idea what you’re attempting here.

6) For your simulation, you used a bet with 42% chance of winning 1.33 to 1 ? That’s what yields the 2.14% edge and 1.15 SD. Why simulate it when it’s easy to setup a Markov chain ? 500 lines, 58% chance you lose one, 42% chance you win 1.33. Caveat: much easier to use payoff of 4/3 and adjust chance of winning down slightly for Markov. A lot less states with 4/3 compared to 1.33

Most importantly, the Ace2 conjecture, which states the RoR is double the chance of finishing a session with a busted bankroll (this is why I used the Zscore of 0.05 for 10% RoR) works perfectly only for zero-edge games. It also works well for low-edge games and/or scenarios when the chance of finishing the scenario busted isn’t too high. So you decide when to (or not to) apply it by having a good grasp of the problem/calculations at hand. It’s worthless in some scenarios, very accurate in others. This is the case for most estimates. Bottom line: you can’t just plug in any set of numbers and expect it to always work
It’s all about making that GTA
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
February 24th, 2023 at 8:58:15 AM permalink
Quote: Ace2

Why simulate it when it’s easy to setup a Markov chain ?

Because I have no idea how to do so.

In the absence of knowing any formula I can use, it looks like I'll need to run a simulation.
I run Easy Vegas ( https://easy.vegas )
Mental
Mental
  • Threads: 16
  • Posts: 1549
Joined: Dec 10, 2018
Thanked by
MichaelBluejay
February 28th, 2023 at 3:57:26 PM permalink
Quote: Mental

Quote: MichaelBluejay

SUMMARY: How to calculate or simulate how much to bet per round for casino games given a starting bankroll, hours of play, rounds per hour, and risk of ruin (RoR)?

DETAILS: A forum member asked me to expand my table of How Much to Bet Per Round to include more hours. At first I thought, well, I dim the sims on my computer like 20 years ago, now desktop computers are fast enough, so I'll just make it a calculator and let the user enter the number of hours they want. Then I realized I have no idea how to do that. I don't remember how I did it with the sims I made 20 years ago, but probably I just did trial-and-error, continually plugging in numbers until I got the right RoR result. I guess I could code it the same way, starting with a best guess, and continually running loops as I get closer and closer to the desired RoR, but that seems kind of messy.

My understanding of the Kelly Criterion is that it doesn't work for negative-expectation bets, doesn't take into account volatility, and can't target a particular RoR.
link to original post

I know you enjoy my nit-picking about terminology. RoR traditionally applies applies to +EV wagers over infinite time. I don't feel ruined if the money I bought to the casino is lost.

The fastest way to get outcome distributions for large numbers of games is convolution. When you go from the probability distribution for all possible outcomes of one coin flip then to two to three to four, you are convolving the simple probability distribution for n, Pn, with P1 to get Pn+1. However, you can go from P2 to P4 by just convolving P2 with P2, then to P8 by convolving P4 with P4, etc. You can get to very large final distributions very quickly this way. I used to calculate distributions for 1M VP hands this way (actually 2^20 hands).

These are final distributions assuming you never go broke. In order to see what fraction of players have gone broke, you need to just count the part of the tail that goes below your session bankroll. You set this tail to zero and convolve again and more players will go broke.

If you do this too quickly, you won't have accurate RoR. For example, if you go from 256 to 512, some of the players that still appear solvent after 512 games actually have recovered from having negative bankrolls. That is, the should be counted as tapped out. To avoid this, you can save the smaller Pn arrays and use this to move more slowly when you get near the RoR target. For example, you might convolve P256 with P8 or P16 to minimized this error.

So, you could always move forward convolving by P1 and taking out the folks who went broke. This would be very accurate but slow. Or you could have an algorithm that detects that it is moving too fast (too many people are tapping out in one step) and automatically slows down to get a good balance of speed and accuracy.

If you are talking about 500 games of craps or similar, this will be very quick and accurate.
link to original post


I created a new thread to show what I mean by using PDF convolution to calculate session tap out probabilities or RoR.
link to new thread
I am not sure you want to do something that accurate and formal, but rather precise RoR estimates are not hard to compute using the my method.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
  • Jump to: