Hi guys,
My Monte Carlo simulator is able to calculate an EV for a specified card count, e.g., what is the EV for hitting 12 vs. 2 given a hi-lo count of +5?
The way it does this is to randomly generate a new deck with the specified count (by removing the appropriate number of high or low cards) before each iteration. This is unfortunately a time consuming process that requires floating point division and so forth, and it slows down the simulation enormously.
I had an idea a couple days ago based on a personal theory that statistically, doing more iterations with the same deck is more valuable than changing the deck. So I made a change to my simulator to only generate a new, random deck every 10 iterations.
I haven't done rigorous testing but at first blush this seems to be a valid optimization. I've run several simulations with the old code and the new code side-by-side and they both converge on the same values, but the new code with the optimization converges much faster because it's doing many more iterations per second. I would estimate that it's about 3 times faster.
So, if you have a Monte Carlo simulator, you might benefit from this optimization. (If you aren't doing it already, that is. To my knowledge there is no repository for information about blackjack programming so I don't know if this is already common practice.)
Cheers!

