vpFREE2 Forums

Short term risk of ruin program

A couple weeks ago I posted some results from a little risk of ruin
program I wrote, and at the time I promised to make the source code
available. Well, the group seemed to lose interest in the subject
shortly afterwards and I suspected a bug in my code, and consequently
I didn't get around to uploading it.

Just in case anyone is still interested, I've now kept my promise and
uploaded the source code to
<http://www.wildlife-pix.com/vpoker/bust.zip>. Besides the (very
short) C language source file the zip package contains input data
files with pay tables and probabilities for several popular VP games
including the Wynn ~full pay games.

The program is really rudimentary: you give it your initial stake,
number of hands to be played, and input data file as command line
parameters. It calculates the "exact" probability distribution of
ending credit balances, prints out the probability of ruin to standard
output, and creates a file with the full probability distribution
which you can load into a spreadsheet or whatever for graphing and
further analysis.

I don't have a C compiler for windows, but it's written in vanilla
Ansi C and should run under just about any operating system. On my 3
year old Pentium desktop running Linux I've run analyses of up to
50,000 hands without consuming painful amounts of CPU time. I'm not
trying to compete with any commercial software here. If you don't have
Excel but do have a C compiler you might find this a useful alternative.

By the way what I thought was a bug is probably just cumulative
rounding error when input probabilities don't quite add up to one. I
haven't been able to find a logical error in my probability
computations, although of course I guarantee nothing.

Mike

The program is really rudimentary: you give it your initial stake,
number of hands to be played, and input data file as command line
parameters. It calculates the "exact" probability distribution of
ending credit balances, prints out the probability of ruin to

standard

output, and creates a file with the full probability distribution
which you can load into a spreadsheet or whatever for graphing and
further analysis.

I don't have a C compiler for windows, but it's written in vanilla
Ansi C and should run under just about any operating system. On my 3
year old Pentium desktop running Linux I've run analyses of up to
50,000 hands without consuming painful amounts of CPU time. I'm not
trying to compete with any commercial software here. If you don't

have

Excel but do have a C compiler you might find this a useful

alternative.

Mike

Just curious, would it be feasible to install your program on a hand
held programmable calculator, for use inside a casino? For example,
input the pay table, your bankroll and hands played estimate, and the
calculator displays the answer. If so, what calculator could be
used, and would it be expensive?

···

--- In vpFREE@yahoogroups.com, "Michael Peck" <mpeck1@i...> wrote:

Mike,

Very nice. BTW, since you've set it to "retire" at 3 RF's or more win, its not "eactly" finite-play
RoR. It is, however, "exatly" the RoR assuming retiring at a win of 3 RF's or above, but then
again any one who runs your code will figure that out. :slight_smile:

..

···

--- In vpFREE@yahoogroups.com, "Michael Peck" <mpeck1@i...> wrote:

It calculates the "exact" probability distribution of
ending credit balances, prints out the probability of ruin to standard
output, and creates a file with the full probability distribution
which you can load into a spreadsheet or whatever for graphing and
further analysis.

A calculator? Probably not. A PDA, probably yes since I'm sure there
are C compilers available for developers. Don't casinos frown on
computing devices on the floor though?

For me this is somewhat useful as a trip budgeting tool. On a typical
Vegas trip I budget about 600 bets worth for gambling and plan to pay
about 10,000 hands. For 9/6 Jacks I calculate the risk of ruin to be
about 3.5%, so my budget is reasonably safe. For full pay DB, which I
decided to try to learn for a recent stay at Wynn the RoR with a 600
bet stake is 1 in 6, and for 9/7 DB it's 1 in 4. I guess I was lucky
to get out of there with cab fare left in my wallet.

Mike

···

--- In vpFREE@yahoogroups.com, "brumar_lv" <brumar_lv@y...> wrote:

>>>>>>>>>>>>>>>>>>>>>>>>>>>

Just curious, would it be feasible to install your program on a hand
held programmable calculator, for use inside a casino?

Mike,

Very nice. BTW, since you've set it to "retire" at 3 RF's or more

win, its not "eactly" finite-play

RoR. It is, however, "exatly" the RoR assuming retiring at a win of

3 RF's or above, but then

again any one who runs your code will figure that out. :slight_smile:

Yes, to keep computations tractable I have a "retired" state. I use a
formula though so that you'd always have to have an unlikely number of
royals to retire. At 20,000 hands the retired amount is the initial
stake + 4 royal payoffs; at 40,000 it's the initial stake + 5 royals;
at 80,000 it's initial stake + 7 royals, etc. I think in every case I
calculated the probability of retiring was under about 0.1%.

Mike

···

--- In vpFREE@yahoogroups.com, "cdfsrule" <groups.yahoo@v...> wrote: