virginiabreeze
virginiabreeze
  • Threads: 1
  • Posts: 4
Joined: Feb 17, 2018
February 17th, 2018 at 10:58:49 AM permalink
If someone has access to a game simulator, I would greatly appreciate learning the results of the following.
Player vs House at a game where House has 1% House Edge for each game played (for comparison, I am using the term House Edge as in the statement that when betting the Pass Line in craps, the House Edge is 1.4%)
Player starts with $250 and plays $10 each game. A win earns $10 and a loss losses $10.
Player continues to play until one of the following occurs, he/she wins $50 (20% gain) or loses all $250 (100% loss) dollars. Either endpoint is considered a completed "set" of games.
If 1000 such sets are played:
How many sets does the player win 20% and what is the average number of games per winning set
How many sets does the player lose 100% and what is the average number of games per losing set

Then repeat simulator with a cutoff when player wins $70 (28%) as opposed to winning $50 (20%)

If there is a website or downloadable program where I can do such a calculation myself, please let me know and I will share the results.

Thank you.
FleaStiff
FleaStiff
  • Threads: 265
  • Posts: 14484
Joined: Oct 19, 2009
Thanked by
virginiabreeze
February 17th, 2018 at 11:58:21 AM permalink
Welcome to the forum.
I'm sure someone will chime in with a helpful response; I'm mathematically challenged.
OnceDear
OnceDear
  • Threads: 64
  • Posts: 7534
Joined: Jun 1, 2014
Thanked by
virginiabreeze
February 17th, 2018 at 12:27:42 PM permalink
Quote: virginiabreeze

If someone has access to a game simulator, I would greatly appreciate learning the results of the following.
Player vs House at a game where House has 1% House Edge for each game played (for comparison, I am using the term House Edge as in the statement that when betting the Pass Line in craps, the House Edge is 1.4%)
Player starts with $250 and plays $10 each game. A win earns $10 and a loss losses $10.
Player continues to play until one of the following occurs, he/she wins $50 (20% gain) or loses all $250 (100% loss) dollars. Either endpoint is considered a completed "set" of games.
If 1000 such sets are played:
How many sets does the player win 20% and what is the average number of games per winning set
How many sets does the player lose 100% and what is the average number of games per losing set

Then repeat simulator with a cutoff when player wins $70 (28%) as opposed to winning $50 (20%)

If there is a website or downloadable program where I can do such a calculation myself, please let me know and I will share the results.

Thank you.

I can't be bothered to derive exactly what you require, but here's a derived solution for a zero edge game.
https://wizardofvegas.com/member/oncedear/blog/3/#post1370

Probability of 20% gain would be 100/120 = 83%
Probability of 28% gain would be 100/128= 78%
That's assuming that one wagers to eliminate any possibility of exceeding profit target and that the house edge is zero. And that one proceeds until goal achieved or bankroll is zero.
Betting pattern apart from that is irrelevant.

MustangSally is probably best able to answer fully for a real case scenario.
Psalm 25:16 Turn to me and be gracious to me, for I am lonely and afflicted. Proverbs 18:2 A fool finds no satisfaction in trying to understand, for he would rather express his own opinion.
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
Thanked by
virginiabreeze
February 17th, 2018 at 1:20:30 PM permalink
virginia breeze, a famous State song and popular bus! I knew that for some reason
Quote: virginiabreeze

If someone has access to a game simulator, I would greatly appreciate learning the results of the following.

simulator not required unless one wants to see a distribution of games played. This is simple Gambler's Ruin formula in action.
For the length of games in W or L I used a formula found, I think, in SN Ethier Doc of Chances book.
Quote: virginiabreeze

Player vs House at a game where House has 1% House Edge for each game played (for comparison, I am using the term House Edge as in the statement that when betting the Pass Line in craps, the House Edge is 1.4%)

so p(win)=0.495 and pays even money
Quote: virginiabreeze

Player starts with $250 and plays $10 each game. A win earns $10 and a loss losses $10.

same as starting with 25 units and betting 1 unit each round of play. a 'unit' then could be any value of a casino chip too.
Quote: virginiabreeze

Player continues to play until one of the following occurs, he/she wins $50 (20% gain) or loses all $250 (100% loss) dollars. Either endpoint is considered a completed "set" of games.

ok
goal = 78.9083029%
ruin = 21.0916971%
average number of games of either a win or loss = 132.75

Quote: virginiabreeze

If 1000 such sets are played:
How many sets does the player win 20% and what is the average number of games per winning set

1000*0.789 = 789
avg # of games given a win = 90.7478425
Quote: virginiabreeze

How many sets does the player lose 100% and what is the average number of games per losing set

211
avg # of games given a loss(ruin) = 289.8928917
Quote: virginiabreeze

Then repeat simulator with a cutoff when player wins $70 (28%) as opposed to winning $50 (20%)

25 unit bankroll, flat betting 1 unit and win goal =7 units
goal = 72.3628900%
ruin = 27.6371100%
average number of games of either a win or loss = 184.3875
avg # of games given a win = 131.5595
avg # of games given a loss(ruin) = 322.70826
Quote: virginiabreeze

If there is a website or downloadable program where I can do such a calculation myself, please let me know and I will share the results.
Thank you.

I have to look up the book name where I found the formula for avg # of games given WorL
and it matches my simulation data too. But just look up Gambler's ruin formula and that should get you started.

simulation again not required, but looks good.

here are the formulas I used in Excel
***** Gambler's Ruin I use the success version to hit the goal
p=prob of a win
q= 1-p
b_x = bankroll in units (so $250 betting $10 = 250/10 = 25)
bankAndgoal = bank + goal (in units)
=IF(p=q,b_x/bankAndgoal, ((q/p)^b_x - 1) / ((q/p)^bankAndgoal - 1))

ruin = 1 - above success probability

*****
average games given a win
parameters:
L=unit starting bankroll (25) >>> what you can lose
W=unit win goal target (5) >>> what you try to win
p=0.495 (probability of winning one game)
q=1-p

=(L+W) / (q-p) * ((q/p)^(L+W)+ 1) / ((q/p)^(L+W) -1) - L/(q-p) * (((q/p))^L +1) / (((q/p))^L -1)

*****
average games given a loss(ruin)

=(L+W) / (q-p) * ((q/p)^(L+W)+ 1) / ((q/p)^(L+W) -1) - W/(q-p) * (((q/p))^W +1) / (((q/p))^W -1)



I think I copied all ok.


lots of Wildcats playing today!!

Sally

why this type of question??
I Heart Vi Hart
ThatDonGuy
ThatDonGuy 
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
Thanked by
virginiabreeze
February 17th, 2018 at 1:28:34 PM permalink
This is known as a Gambler's Ruin problem. There is a general solution where the probability of winning is not 1/2:
Let p be the probability of a single bet winning, q (= 1 - p) the probability of losing, S the number of bets you need to be ahead by to "win," and F the number of bets you need to be behind by to "lose." In other words, F is your starting bankroll, and S + F is your target bankroll.

In your case, p = 0.49, q = 0.51, S = 5, and F = 25.

The formula is:
P(win) = ((q / p)F - 1) / ((q / p)S+F - 1)
Plugging in the numbers, the result is about 78.9%.
You should win $50 in 789 of the 1000 sets, and lose $250 in the other 211 - an average loss of $23.05 per set.

As for the expected length of each winning and losing set, I'm pretty sure there's a formula for that as well, but I can't come up with it at the moment.
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
Thanked by
virginiabreeze
February 17th, 2018 at 4:26:10 PM permalink
Quote: ThatDonGuy


In your case, p = 0.49, q = 0.51, S = 5, and F = 25.

<snip>
Plugging in the numbers, the result is about 78.9%.

think you used 0.495 in your formula

here is my Excel sheet in Google

https://goo.gl/hi4rfH



Here is the Excel sheet
in Google
for length of games in win and loss
taken from a book, still looking for it in the book!
also contains the GR formula

https://goo.gl/Xc7eGz



hope this helps out
Sally
I Heart Vi Hart
virginiabreeze
virginiabreeze
  • Threads: 1
  • Posts: 4
Joined: Feb 17, 2018
February 17th, 2018 at 7:11:31 PM permalink
Thanks so much. You are obviously familiar with the Robbin Thompson Band (2 b's please) and their song Sweet Virginia Breeze, which recently became the official second state song of my state of Virginia. A good band, but not in the league of Wilson Pickett.

I have tried to read about the Gambler's Ruin problem on the internet now that you introduced that term to me. That is exactly the question I was asking about. The quick synopsis from my review is that the Gambler, even one playing a 50/50 game, will eventually go broke if he does not have an infinite number of funds (units). Naively, I thought that one could go home a winner after a weekend of gambling if one played a game with only a small house edge and you were willing to reset your bankroll to its starting amount whenever you made a small relative profit (like 20%) as long as you had a big enough bankroll to make the chance of a wipeout very low. HOWEVER, your math results suggest that this is just a FALLACY!
Imagine a Gambler doesn't get any sleep and play 1000 sets of blackjack in Las Vegas. He starts with $250. First set he finds himself up $50 at $300. He stops and gets a soda.
He comes back to the table and starts a second set, again with $250, and plays until he is ahead $50 again. He goes outside to see the lights. He comes back and plays again with a starting bankroll of $250 and stops when he is ahead $50. One might think that this could go on for quite some time before he actually loses $250 from one set. If he/she were to lose $250 in one set, he would then start again with $250.
Your numbers suggest that by the time the gambler goes home after a busy weekend of playing 1000 sets, he/she will have made $50 x 789 = 39,450 and lost $250 x 211 = 52,750. Terrible!!!

I assume that the term "Gambler's Ruin" implies that there is no reasonable bankroll size where the results favor the Gambler. For example, even if you started with a bankroll of $2000, the Gambler would still lose more than he wins?
virginiabreeze
virginiabreeze
  • Threads: 1
  • Posts: 4
Joined: Feb 17, 2018
February 17th, 2018 at 7:27:49 PM permalink
When I take your Excel sheet and change bankroll to $2000, the numbers come out 90.3% of the time achieving the goal of making $50 and 9.7% of the time losing $2000. Wow, just intuitively one would not expect that about 10% of the time you will lose 200 units before you find yourself a mere 5 units ahead of where you started.
Amazing, but not what I would have expected.
mamat
mamat
  • Threads: 3
  • Posts: 494
Joined: Jul 13, 2015
Thanked by
virginiabreeze
February 18th, 2018 at 7:31:55 AM permalink
Quote: virginiabreeze

When I take your Excel sheet and change bankroll to $2000, the numbers come out 90.3% of the time achieving the goal of making $50 and 9.7% of the time losing $2000. Wow, just intuitively one would not expect that about 10% of the time you will lose 200 units before you find yourself a mere 5 units ahead of where you started.
Amazing, but not what I would have expected.

If someone starts playing $5-25 at blackjack with a slight edge, one can compute the expected loss before eventually making profit.

For some parameters, you can expect to lose about $600-800.

----
Casinos can do the flip side calculation.
If a customer plays $5 at basic strategy blackjack with a slight loss, they can computer the expected win before eventually losing.

They might be expected to go up $300-600.

----
It probably won't seem so surprising if you think about the second case (Normal blackjack player with just basic strategy)
SOOPOO
SOOPOO
  • Threads: 123
  • Posts: 11465
Joined: Aug 8, 2010
Thanked by
virginiabreeze
February 18th, 2018 at 8:27:36 AM permalink
Quote: virginiabreeze



I assume that the term "Gambler's Ruin" implies that there is no reasonable bankroll size where the results favor the Gambler. For example, even if you started with a bankroll of $2000, the Gambler would still lose more than he wins?



The EV (expected value) can be figured by multiplying the total amount bet times the house edge. This will be a negative number since the house edge is negative towards the player. Bankroll size is irrelevant. Unless you can turn the house edge on abet in your favor, the gambler will lose more than he wins.
ThatDonGuy
ThatDonGuy 
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
Thanked by
virginiabreeze
February 18th, 2018 at 9:18:52 AM permalink
Quote: mustangsally

think you used 0.495 in your formula


I did, because that is the correct value for a 1% HE (p = 0.495, q = 0.505).

Quote: virginiabreeze

I assume that the term "Gambler's Ruin" implies that there is no reasonable bankroll size where the results favor the Gambler. For example, even if you started with a bankroll of $2000, the Gambler would still lose more than he wins?


I think "Gambler's Ruin" comes from the fact that you are trying to calculate a probability of reaching a certain point before being "ruined" (i.e. losing everything).

Still trying to find that "expected length of winning and losing runs" formula.
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
Thanked by
virginiabreeze
February 18th, 2018 at 10:47:14 AM permalink
Quote: virginiabreeze

When I take your Excel sheet and change bankroll to $2000, the numbers come out 90.3% of the time achieving the goal of making $50 and 9.7% of the time losing $2000.
Wow, just intuitively one would not expect that about 10% of the time you will lose 200 units before you find yourself a mere 5 units ahead of where you started.
Amazing, but not what I would have expected.

Wow is right.
so many gamblers have, now and will
think a big bankroll is all you need to gain access to unlimited atm withdrawals when playing against a house edge!
(they do not understand why the house edge is there, I would guess)

now, make your 2000 units in the Excel calculator
and see what happens.
******
OF course the other way also has ruin, meaning HAVING 1% edge flat betting.

BTW, the Gambler's ruin formula works well only with flat betting and even money payoffs.
Baccarat Banker bet and Blackjack do not work well unless on converts payoffs to even money. I think most math greats from the 70s did this.

I use the free program R
to do fast work if I want more than what Excel can give.

Here are some calculations
#1) 1st part is playing against 1% house edge

#2) 2nd is playing WITH a 1% edge against the house.
results are from the starting bankroll
like so:
[starting bankroll in units,]
> # Gambler's Ruin Problem - mean time in transient states 
> # and probabilities to target goal and ruin
> p <- 0.495 ##Enter
> states <- 31 ##Enter bankroll + wingoal + 1
>
> q <- 1-p
> target <- states - 1
> state2state <- states - 2
>
> # enter transition probability matrix
> P <- matrix(rep(0,states^2), nrow=states, ncol=states)
> P[target,target] <- 1 # absorbing state target goal
> P[states,states] <- 1 # absorbing state ruin
> P[1,states] <- q # to ruin - not in diag
>
> for (i in 1:state2state) {P[i,i-1] <- q
+ P[i,i+1] <- p}
> #P
>
> # take sub-matrix for transient states to states
> P.s <- P[1:state2state, 1:state2state]
> #P.s
> # take sub-matrix for transient states to absorbing
> P.t <- P[1:state2state, target:states]
> #P.t
>
> # compute mean number of revisits matrix S
> Q <- solve(diag(state2state)-P.s)
> #Q
>
> # sum entries in Xth row of Q
> sum(Q[25,])
[1] 132.7509
>
> Q %*% P.t
[win goal] [ruin]
[1,] 0.02457203 0.97542797
[2,] 0.04964046 0.95035954
[3,] 0.07521532 0.92478468
[4,] 0.10130685 0.89869315
[5,] 0.12792548 0.87207452
[6,] 0.15508186 0.84491814
[7,] 0.18278685 0.81721315
[8,] 0.21105154 0.78894846
[9,] 0.23988723 0.76011277
[10,] 0.26930547 0.73069453
[11,] 0.29931801 0.70068199
[12,] 0.32993686 0.67006314
[13,] 0.36117428 0.63882572
[14,] 0.39304275 0.60695725
[15,] 0.42555504 0.57444496
[16,] 0.45872414 0.54127586
[17,] 0.49256332 0.50743668
[18,] 0.52708612 0.47291388
[19,] 0.56230635 0.43769365
[20,] 0.59823810 0.40176190
[21,] 0.63489574 0.36510426
[22,] 0.67229394 0.32770606
[23,] 0.71044767 0.28955233
[24,] 0.74937217 0.25062783
[25,] 0.78908303 0.21091697
[26,] 0.82959613 0.17040387
[27,] 0.87092767 0.12907233
[28,] 0.91309419 0.08690581
[29,] 0.95611257 0.04388743

> # Gambler's Ruin Problem - mean time in transient states
> # and probabilities to target goal and ruin
> p <- 1 - 0.495 ##Enter
> states <- 31 ##Enter bankroll + wingoal + 1
>
> q <- 1-p
> target <- states - 1
> state2state <- states - 2
>
> # enter transition probability matrix
> P <- matrix(rep(0,states^2), nrow=states, ncol=states)
> P[target,target] <- 1 # absorbing state target goal
> P[states,states] <- 1 # absorbing state ruin
> P[1,states] <- q # to ruin - not in diag
>
> for (i in 1:state2state) {P[i,i-1] <- q
+ P[i,i+1] <- p}
> #P
>
> # take sub-matrix for transient states to states
> P.s <- P[1:state2state, 1:state2state]
> #P.s
> # take sub-matrix for transient states to absorbing
> P.t <- P[1:state2state, target:states]
> #P.t
>
> # compute mean number of revisits matrix S
> Q <- solve(diag(state2state)-P.s)
> #Q
>
> # sum entries in Xth row of Q
> sum(Q[25,])
[1] 116.2236
>
> Q %*% P.t
[win goal] [ruin]
[1,] 0.04388743 0.95611257
[2,] 0.08690581 0.91309419
[3,] 0.12907233 0.87092767
[4,] 0.17040387 0.82959613
[5,] 0.21091697 0.78908303
[6,] 0.25062783 0.74937217
[7,] 0.28955233 0.71044767
[8,] 0.32770606 0.67229394
[9,] 0.36510426 0.63489574
[10,] 0.40176190 0.59823810
[11,] 0.43769365 0.56230635
[12,] 0.47291388 0.52708612
[13,] 0.50743668 0.49256332
[14,] 0.54127586 0.45872414
[15,] 0.57444496 0.42555504
[16,] 0.60695725 0.39304275
[17,] 0.63882572 0.36117428
[18,] 0.67006314 0.32993686
[19,] 0.70068199 0.29931801
[20,] 0.73069453 0.26930547
[21,] 0.76011277 0.23988723
[22,] 0.78894846 0.21105154
[23,] 0.81721315 0.18278685
[24,] 0.84491814 0.15508186
[25,] 0.87207452 0.12792548
[26,] 0.89869315 0.10130685
[27,] 0.92478468 0.07521532
[28,] 0.95035954 0.04964046
[29,] 0.97542797 0.02457203
>
remember target (win goal) was to get to 30 units
1st part success / ruin
starting at 25 units bankroll
[25,] 0.78908303 / 0.21091697 (as before calculated)

2nd part success / ruin
(Having a 1% edge against the game)
starting at 25 units bankroll
[25,] 0.87207452 / 0.12792548 <<<< Wow! 1 in 8 ruin
but +EV (Many APs just HATE to lose any time!)

*****
so flat betting
with an edge
it IS
very important
to have enough bankroll to avoid ruin or minimize it.

interesting stuff for sure
Sally
Last edited by: mustangsally on Feb 18, 2018
I Heart Vi Hart
ThatDonGuy
ThatDonGuy 
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
Thanked by
virginiabreeze
February 20th, 2018 at 8:43:31 AM permalink
Quote: ThatDonGuy

Still trying to find that "expected length of winning and losing runs" formula.


I found it, but I can't remember where I got it from (and I wouldn't be surprised if it matches the formulas in Sally's spreadsheet):

If p <> 1/2, then the expected number of bets in a successful run is
(S + F) / (q - p) * ((q/p)S+F + 1) / ((q/p)S+F - 1) - F / (q - p) * ((q/p)F + 1) / ((q/p)F - 1)
where, again,
S = the number of bets you need to be ahead to be "successful"
F = the number of bets you need to be behind to be "unsuccessful"
p = the probability of winning a single bet
q = the probability of losing a single bet (= 1 - p)

If p = 1/2, it is S (2F + S) / 3

For an unsuccessful run, replace F with S and vice versa in both equations
Last edited by: ThatDonGuy on Feb 20, 2018
virginiabreeze
virginiabreeze
  • Threads: 1
  • Posts: 4
Joined: Feb 17, 2018
February 20th, 2018 at 3:35:38 PM permalink
Thanks for all the great information and the source for the numbers.

I plugged in some numbers to answer some of the questions Sally posed. The results are interesting:

A bankroll of $20000 yields a win of $50 90.5% of the time and a loss of $20000 9.5% of the time, which is essentially the same as a bankroll of $2000. By this, I believe the numbers suggest that once you are down $2000 in a game with a house edge the chance of you getting back to positive are very low, it happens a few times but for the most part you can expect that you will just keep losing until you lose the entire $20000.

IF the player has the 1% edge over the house (50.5 vs 49.5) then he/she can expect to win $50 87.2% of the time and lose the $250 bankroll (see my original post question) 12.8% of the time, which turns out to be $4360 gain and a $3200 loss, or a net gain of $1160. This would require the player to reach one endpoint or the other a total of 100 times, which is quite a few actual games (hands of say blackjack) to reach one "set" out of the 100 sets. Average games to win = 91, to lose = 290 (overall ave 116)

With the same 1% player's edge, if the player has a bankroll of $500, he will win $50 94.8% of the time and lose $500 5.2% of the time. This shows the advantage of the larger initial bankroll. The result is a gain of $4740 and a loss of $2600, a net gain of $2140. It is interesting to think that even with a 1% edge and bets of only $10 a player can lose $500 as often as one time out of 20. Average games to win = 168, to lose 980. Overall ave 211.

Finally, with a $1000 bankroll, the player wins 98.5% and loses 1.5% for a net gain of 4925-1500 = $3425. Ave games to win 300, to lose 3472. Overall ave is 345

I used the spreadsheet in Mustang Sally's post, I have not checked the numbers based on ThatDonGuy's formula. I hope I am using the spreadsheet correctly. The number of games did not change when the house edge was 1% or the player's edge was 1%. I would have thought that a player edge of 1% might have decreased the average number of games needed for victory by a small amount, but perhaps I don't understand the math.

Either way, the increased monetary gain seems to come with the requirement to play a lot more hands and the winning hands have higher and higher averages I guess because the larger bankroll allows the player to come back from $250+ losses but at the price of a LOT more hands for the games that reverse course drastically, resulting in a much higher average for all winning games.

These exercises and posts have really been enlightening to me. It shows me very clearly that aside from a short round of luck followed by cessation of play, a player playing a game with even only a 1% house edge is destined to lose money over the long haul and that the chance of a really bad run bringing the player to "ruin" will happen a lot more often than I ever expected, even with a bankroll that is 25 times the bet (previously I thought such a bankroll almost completely alleviated the chance of ruin for a player playing with less than a 1.5% disadvantage relative to the house). . Likewise, it has taught me that even playing with a 1% edge, the player is subject to going to ruin despite a large bankroll much more often than I would have thought.

I very much appreciate everyone's sharing of their time, knowledge, and expertise!!!!
Last edited by: virginiabreeze on Feb 20, 2018
  • Jump to: