Discount Gambling

Card Craps Source Code

Posted in +EV, card craps by stephenhow on February 3, 2011

If anyone is interested in verifying the CSM card craps edge (e.g., @ Viejas), I’m making the Java source code for the simulator/analyzer available here. You just need the Java SDK installed to compile and run the program. If your Unix environment is already set up for Java development, just follow these steps to get up and running:

>curl http://imadegen.com/cardcraps/card_craps.tar | tar zx
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24576  100 24576    0     0  67205      0 --:--:-- --:--:-- --:--:--  105k
>cd card_craps
>make
javac -Xlint Analyzer.java CSM.java Roll.java Window.java Average.java PointStats.java
CSM.java:13: warning: [unchecked] unchecked conversion
2 warnings
>java Analyzer
don't pass, 10x odds, 14 card min buffer depth, 6-roll window
0 rolls: net +1.0, EV/roll +Infinity%, EV/game +100.00%
1000000 rolls: net +2828.0, EV/roll +0.28%, EV/game +0.95%
2000000 rolls: net +9921.0, EV/roll +0.50%, EV/game +1.67%
3000000 rolls: net +12754.0, EV/roll +0.43%, EV/game +1.43%
4000000 rolls: net +24592.0, EV/roll +0.61%, EV/game +2.07%
5000000 rolls: net +36467.0, EV/roll +0.73%, EV/game +2.46%
6000000 rolls: net +47067.0, EV/roll +0.78%, EV/game +2.65%

There are several options to the program, so you can experiment with the different CSM model parameters:

>java Analyzer -h
usage: Analyzer <options>
where options include:
 -n <number of rolls>             specifies number of rolls to simulate (default 100 million)
 -d                               play Don't Pass line (default)
 -p                               play Pass line
 -o <max odds>                    specifies odds to take/lay for good count
 -b <buffer depth>                specifies minimum reservoir depth (default 14)
 -w <window depth>                specifies count window depth (default 6)
 -a                               print per-point statistics
 -h, --help                       display this usage
Place a space between the option and parameter value.

The program shows the game is +EV, but it’ll also show you the huge variance for any given session. You can use the -n 1000 option to simulate a session (1000 rolls is possible in a few hours, heads up).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92 other followers

%d bloggers like this: