Hi,
Is there somebody using Eric Farmers C++ blackjack lib ?
I'm currently working with his code, as I'm writing a program with the aim of faster calculations. My code is independent from Eric's version, I just use it to verify results.
The most difficult part is calculating split EVs, due to the complexity of the problem. I use a quite simple approximation which is reasonable fast, and over the majority of split hands .vs upcards, Eric's EVs and my EVs are identical (with difference of 10^-8) Since I'm using single precision floating point operations, this error is well expected.
But some split hands have a far higher deviation (most are about 10^-6, but a few are up to 10^-3). The highest difference between both codes was split 2-2 vs. 6 on SD S17, D9-11, DAS (no resplit).
I'm not sure how Eric's code works (I suck at reading codes). My approximation is, calculating the EV of a single card 2 vs. 6 (with another 2 missing from the deck), and estimate that this will be the EV for both hands.
Erics code give a EV of 25.87%, while the approximation gives a 26.56%.
In order to at least test which value is off, I did a simulation of 500.000 splits, and the first hand got an EV of 26.53% +/- 0.37% (actually half of that). The second hand played afterwards gets an EV of 27.60% +/- 0.37%. The second hand EV is higher, as more cards are already known.
My question is: The approximation of single hand 2 vs. 6 gives an accurate estimate (26.56%) of first hand (26.53% +/- 0.37% by simulation), while second hand must perform better, and hence real split EV should be > 26.5% (27.06% +/ 0.33% in simulation).
Why does Eric's code estimate so low (as 25.87%), while other split configurations are much more precise (10^-8 with single-hand method)?
How does Eric estimate splits, and why is it off from simulation such large (where a simple approximation performes better) ?
Is there somebody using Eric Farmers C++ blackjack lib ?
I'm currently working with his code, as I'm writing a program with the aim of faster calculations. My code is independent from Eric's version, I just use it to verify results.
The most difficult part is calculating split EVs, due to the complexity of the problem. I use a quite simple approximation which is reasonable fast, and over the majority of split hands .vs upcards, Eric's EVs and my EVs are identical (with difference of 10^-8) Since I'm using single precision floating point operations, this error is well expected.
But some split hands have a far higher deviation (most are about 10^-6, but a few are up to 10^-3). The highest difference between both codes was split 2-2 vs. 6 on SD S17, D9-11, DAS (no resplit).
I'm not sure how Eric's code works (I suck at reading codes). My approximation is, calculating the EV of a single card 2 vs. 6 (with another 2 missing from the deck), and estimate that this will be the EV for both hands.
Erics code give a EV of 25.87%, while the approximation gives a 26.56%.
In order to at least test which value is off, I did a simulation of 500.000 splits, and the first hand got an EV of 26.53% +/- 0.37% (actually half of that). The second hand played afterwards gets an EV of 27.60% +/- 0.37%. The second hand EV is higher, as more cards are already known.
My question is: The approximation of single hand 2 vs. 6 gives an accurate estimate (26.56%) of first hand (26.53% +/- 0.37% by simulation), while second hand must perform better, and hence real split EV should be > 26.5% (27.06% +/ 0.33% in simulation).
Why does Eric's code estimate so low (as 25.87%), while other split configurations are much more precise (10^-8 with single-hand method)?
How does Eric estimate splits, and why is it off from simulation such large (where a simple approximation performes better) ?