## Poll

3 votes (13.04%) | |||

4 votes (17.39%) | |||

7 votes (30.43%) | |||

2 votes (8.69%) | |||

2 votes (8.69%) | |||

5 votes (21.73%) | |||

1 vote (4.34%) | |||

4 votes (17.39%) | |||

7 votes (30.43%) | |||

6 votes (26.08%) |

**23 members have voted**

Quote:LuckyPhowBut, seems to me, after 100 iterations, casino should have won 51 and player should have won 49, for a 2-unit loss for the player. Straight-line extension shows when player goes broke.

However, that includes, for example, the bank winning 40 of the first 55 hands, and then the player winning 34 of the last 45. You never get to those last 45 hands because, after the first 55, you won 15 and lost 40, so you have lost your entire bankroll.

That is the entire point of this problem - how often do you reach the "25 more losses than wins" point in 100 hands?

Bankroll = $25

AvgBet = 1

OriginalSD = 1*1 = 1

EV(100 trails) = (100*1)*(-.02) = -2

SD(100 trials) = Sqrt(100) * 1 = 10 * 1 = 10 ... 2SD = 20

So in 100 trials one would expect to lose $2 +/- $20... Therefor with 95% confidence one would not bust on a $25 bankroll.

From this we know there's a chance to go broke between 2 and 3 Standard Deviations. So between 95% and 99% confidence intervals. Plot the point and you should be able to find your confidence?

Yeah didn't exactly answer the question, but maybe something more to think about or something? Yeah or something... I'm gonna go with that =P.

I get that, too! But being me I had to do it my way. Here's my result:Quote:mustangsally... I gets 0.019520497 for ruin ...

Calculating for initial bankroll of 25 wager of 1 for 100 bets with 0.49 probability of winning 1 for each bet, else losing.

Probability of bust: 0.019520496908388644

LIke mustangsally's work, mine also has a compete breakdown of possible results if you care to examine the result array.

<!doctype html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Free Play Resolved</title>

</head>

<body>

<script>

const b = 25; //bankroll

const wp = 0.49; //probabilty of winning

const lp = 1 - wp; //probability of losing

const n = 100; //number of bets to process

var bp = []; //bankroll amount probability

//Initialize the bankroll probability array

for (let i=0;i<=b+n;i++) {bp=0;}

bp = 1;

document.write("<p>Calculating for initial bankroll of "+b+" wager of 1 for "+n+" bets with "+wp+" probability of winning 1 for each bet, else losing.</p>");

for (let bet=1;bet<=n;bet++){ //For each bet

let br = bp.slice(0); //create a copy to process the bet

for (let i=Math.max(b-bet+1,1);i<b+bet;i++) { //for each possibility where bankroll > 0

if (bp > 0 ) { //act if possibility > 0

//Allocate the current possibiliy to win and loss

br[i-1] += bp * lp;

br[i+1] += bp * wp;

br -= bp;

}

}

bp = br; //Make the working copy the current data

}

document.write("<p>Probability of bust: "+bp[0]+"</p>");

</script>

</body>

</html>

Coding got munched by the spoiler tag. Oh well, still valid.

Quote:mustangsally

using a simple transition matrix in Excel

I gets 0.019520497 for ruin (in agreement with a sim I also ran)

there is a paper that shows that method and the Binomial Ruin Distribution named

"The Impact of a Finite Bankroll on an Even-Money Game"

Kelvin Morin – Manitoba Lotteries Corporation

I get the same number, which is not surprising as my code is pretty much the same as her spreadsheet.

Morin's paper is here (makes sense that UNLV would have it).

However, the formula requires calculating two integrals:

P(ruin) = F( (r + 1/2 - np) / sqrt(npq) ) + F( (r - 1/2 - nq) / sqrt(npq) ) exp( 2b(q-p) / (1-(p-q)

^{2})

where b = the bankroll (in our case, 25)

n = the maximum number of bets (in our case, 100)

p = the win probability (in our case, 0.49)

q = the loss probability = 1 - p (in our case, 0.51)

r = the "ruin point" = (n - b) / 2 (in our case, 37.5. although I think it's supposed to be an integer)

and F(x) = the area underneath the normal distribution curve for values < x;

this is 1 / sqrt(2 PI) * the integral for u from (-infinity) to x of exp(-u

^{2}/ 2) du

Using a straightforward approximation for the integrals (starting at the maximum value, calculating the value at intervals of 0.1 until the sum didn't appear to get any larger (in this case, 200), adding them up, and multiplying by the interval width), I got a ruin of 0.018091637 for r = 37 and 0.023785798 for r = 37.5 (which is (100 - 25) / 2). The correct value appears at about r = 37.13783.

Since calculating the integrals is going to require approximation, you might as well calculate the values using a matrix; note that the size of the matrix varies approximately in proportion to the square of the maximum number of bets.

Or, as BleedingChipsSlowly points out, since we're not interested in the intermediate step values, you only really need a one-dimensional matrix (not two, as the numbers in the odd positions are calculated from the numbers in the adjacent even positions, and then the numbers in the even positions are calculated from the numbers in the adjacent odd positions, going back and forth).

Quote:ThatDonGuyHowever, that includes, for example, the bank winning 40 of the first 55 hands, and then the player winning 34 of the last 45. You never get to those last 45 hands because, after the first 55, you won 15 and lost 40, so you have lost your entire bankroll.

That is the entire point of this problem - how often do you reach the "25 more losses than wins" point in 100 hands?

I agree. As several of the other replies seem to mutually confirm, the answer is one seldom (95% probability) encounters such an extreme example as the one you posit. But, it can happen.

Now, back to the Wiz's original issue: a formula for Internet casino bonuses that shows the probability of ruin in a finite number of steps. Is this like the, "Get $$$ welcome bonus" (but it's only available after the player deposits $$$ and plays no fewer than ### hands)? Ideally, the Internet casino (I'm guessing here) would like the player to lose most -- but not all (avoiding "ruin") -- of her buy-in, but then gets the bonus, continues to play, and -- hopefully -- stays as a "regular" at the site. Hey, Wiz! Am I even close to how Internet casinos want to use your formula?

But, as the player gets closer to "ruin" before qualifying for the (anticipated) bonus, the casino gets closer to losing a (new?) player who leaves feeling cheated. Seems to me the Internet casino would most of all want to avoid that. Keeping risk of ruin low for the player also keeps low the Internet casino's risk of losing the player as a customer.

Quote:mustangsallyadded:

for a very nice approximation formula

my online folder (link in my blog) has the Alan Krigman Excel sheet

(uses Don Schlesinger's trip risk of ruin formula that is very accurate as the number of trials increases)

I) Survival criterion -- 100 rounds

Risk of ruin = 2.0124%

Prob of survival = 97.9876%

so a small error is there

the Excel sheet is RoR-AlanK.xls

Quote:RomesCouldn't you try to simplify it further? What's the house edge of the game? 2%? Variance = 1 (given you can only win or lose $1). Why not just run the EV +/- SD to find the ruin probability?

The question you seem to be answering is what is the probability of being below zero after 100 hands, assuming you could play on credit if you feel below before.

However, I'm asking what are the chances of ruin at any point. It could happen the player is ruined on hand #90, plays on credit and wins, and finishes 5 units up. He would show a success based on just the result after 100 hands, but if he couldn't get a marker, then he would have busted out.

Quote:LuckyPhowNow, back to the Wiz's original issue: a formula for Internet casino bonuses that shows the probability of ruin in a finite number of steps. Is this like the, "Get $$$ welcome bonus" (but it's only available after the player deposits $$$ and plays no fewer than ### hands)? Ideally, the Internet casino (I'm guessing here) would like the player to lose most -- but not all (avoiding "ruin") -- of her buy-in, but then gets the bonus, continues to play, and -- hopefully -- stays as a "regular" at the site. Hey, Wiz! Am I even close to how Internet casinos want to use your formula?

Actually, the way Internet casino bonuses usually work is they give it to you after you make a deposit. However, to make a withdrawal you have to play through the combined deposit and bonus x number of times. Then, if you survive all the play, they will deduct the bonus from your account and you can withdraw the rest.

Quote:mustangsallythe Don Schlesinger formula is a good one to use too.

Thanks. I must have brushed over that too quickly when I read his book. I just posted it to my private Facebook account.

I'm very impressed at the formula but is probably too advanced to implement in a simple JavaScript calculator.