BJStrike, Blackjack simulation and practice software

Index generation based on sampling for Spanish 21, procedure when using strategy files manually

Notice that that from BJStrike Version 4.0, regular index generation
as well as automatic index generation based on sampling are fully
supported for Spansih 21 and can be directly invoked from the GUI
Index Generation window without the need for manually modifying
strategy files. This should be sufficient for most of the total
dependent strategies and indices.

Using manual sampling based index generation, it is possible to
generate indices of much higher granularity than in regular index
generation. The term "manual" refers to the fact that we are
modifying a strategy file and manually entering the hand specification
at the proper strategy condition. From there on, everything is
fully automated and the index generation is invoked from the GUI
as in normal simulations.

This approach has the advantage that indices can be generated for any
decision and conditions that can be described in the strategy file,
which covers a wide  range of constructs.
For example different indices or basic strategy can be generated
based on number of cards in the hand or based on hand composition,
based on round number or based on hand composition.
This type of index generation can only be run one hand at a time.

Below is a summary of the manual procedure to generate custom indices
for Spanish 21 using the basic strategy template for redoubling included
BJstrike and to include the indices in a new strategy file for simulation.

As an example consider hard 16 vs. 10,  HIT vs. STAND

1. Manually copy the file sp21_redouble_shoe.strat to ind_16vs10.strat

2. Manually edit the file ind_16vs10.strat:
   Look in the file o see if there is any custom strategy for this hand.
   In this case there is an entry:
   ENTRY { SUM := 16;  DUP := 10 ;

   Replace the line "ALWAYS HIT;" with "CUSTOM HIT STAND 10;"
   so it will look this:
   ENTRY { SUM := 16;  DUP := 10 ;

Note: If there is no entry for the target hand you will
need to add a strategy definition for this hand similar to
the definition above with the two play types you
want to evaluate specified as CUSTOM Pl1 Pl2 10;

2b. In the beginning of your strategy file enter:
//++ INDGEN_SIM 2    (See below)
to indicate that index generation based on sampling should be invoked.

3. Now from the GUI do File - "Load setting" file SP21_redouble.rc

4. Define your count system as C1 with proper initial value.

5. Go to the simulation window and select "Custom strategy file"
select your file modified, ind_16vs10.strat as your strategy file.

6. Also, set number of players to '1' and shuffle point to
whatever you want, for example 220 cards.

7. Do File->"Save setting as" from the main window with a new
file name for example, SP21_ind_16vs10.rc not to over write the
original file.

8. Go to the index generation window and check the box for
"Index sampling mode". Make sure that this box is NOT checked.
This option is used only when we are using index generation
from the GUI, which was introduced in BJstrike Ver. 4.0

9. If needed adjust the "Count range" and step size ("Force step:")
for higher sample size. Close the window and go to the simulation

10. Run the index generation from "Start simulation" on the
simulation window.
If the simulation is started from the index generation window
the simulator will look for hands in the index generation
list and the intended index will not be run.

11. Do "Save setting" to save your final results and settings.
Notice that the complete results of the simulation are also saved
when doing "Save setting" in addition to the settings.

You may need to run 1G or 10G rounds (to get sufficient sample
size for less frequent hand types). For example, to run 10G rounds
choose 1G rounds and Scale factor 10 in the simulation window.
The standard error will be significantly higher for less frequent
hand types and TC's in this mode so it's always good to keep an eye
on the delta in EV at the break point compared to the standard
error reported in the results.

12. Repeat these steps (1-12) for all other index hands needed
and save the results in separate files.

The editor that get invoked from the GUI is fairly primitive, you
could use any other text editor of your choice as long it can save
in text-only (ascii) format. For minor changes it should still
be doable with the one included.

When all the index generation/BS generation is done you copy the
original strategy file sp21_redouble_shoe.strat to a new
file, my_sp21_count.strat. This is the final strategy file
you will use for simulation and analysis. Fill in all the
indices and/or modified basic strategy you generated at the
corresponding locations where you had the index generation construct
(CUSTOM x y 10;) in my_sp21_count.strat or add new hand entries
if there is no existing entry.

For example for the 16 vs. 10 case:
ENTRY { SUM := 16;  DUP := 10 ;
  // Fill in index here using for example SINGLE_INDEX or MULT_INDEX
  // or use basic strategy:  ALWAYS HIT; 

Notice, 16 vs. 10 was just an example here, I did not get any index
in my count system (always HIT for this hand). See also:

13. Select custom file, my_sp21_count.strat from the GUI and
you are ready to run simulations and specify betting and other

Notice that it is not possible to generate custom indices
for rescue surrender after DD (Basic strategy for sp21 is
hard coded and will have to be used for those decisions).

A good check to verify that the final playing strategy gets
properly interpreted by the simulator is to run a short simulation
while having the box "Report strategy matrix" checked. The strategy
as being applied will then be printed in the result file in a
different format for easier viewing.

While using index generation based on sampling from the index
generation window, the only options that are used are:
"Count search range" and "Force step:". See Section 11.4 for
details about these options. The search range may need to
be adjusted depending on hand and count system used. All other
options are ignored in this mode.

Some tricks to speed up simulation and increase the sample size
for less frequently occurring hands and counts:

1) Group the count range into for example 2 or more TC's
per sampling bin by setting "Force step:" to 2 or more.
Then, a greater number of samples will fall into each bin
resulting in lower standard error and higher accuracy in
the index generation. The penalty of using this approach is
that you will get a lower resolution, i.e. the index
break point will be given as a range, [x,x+1]. On the
other hand it should not have much impact for less common
hands whether I use index I1+1 or I1-1 for a hand that has
the exact index I1 on the overall efficiency
2) Another approach to run the index generation faster,
meaning you can increase the number of rounds, is to
use "INDGEN_SIM 2" as a command in the index generation
strategy file. When using this mode, during simulation
for index generation, initial hands that can never satisfy the
target hand are aborted as soon as they are detected.
For example, during simulation if my target index hand is 12 vs. 2
and the initial cards 58 are dealt or the dealer up card
is not 2 the hand is not simulated at all and a new round
is immediately dealt from the shoe. Only initial hands that
can result in the target hand are simulated. This should
not have any significant impact on the accuracy of the
indices generated. This mode changes the distribution of
hands slightly during simulation.

To use this mode, the command,
must be entered in the beginning of the strategy file 
used for index generation.
In addition, the box "Index sampling mode" must NOT be checked
on the Index generation window and the simulation must be launched
from the Simulation window and not the Index window of the GUI.
Otherwise, the default mode (INDGEN_SIM 1) chosen by the GUI 
would override the command entered in the strategy file.

See also:
for more examples of sp21 index generation and other

Back to support page

Home Products Ordering Contact

Copyright © 2002-2010 DFTSimuLab. All rights reserved.