See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 14 to 26 of 26

Thread: Could a computer win at blackjack flat betting?

  1. #14


    Did you find this post helpful? Yes | No
    The key here is optimal play. Yes, a CA can also inform the user what the measured EV is for composition dependent play is; card counting simply is a method of linearizing this process to make it more human friendly.

    The Theory of Blackjack is an excellent book on this treatment. Highly recommend if you are interested in the mathematics of how 21 works and is beaten. While a bit maths heavy, the clear-text sections at the start of each chapter can be of great use!

  2. #15


    4 out of 4 members found this post helpful. Did you find this post helpful? Yes | No
    Quote Originally Posted by Cardguy View Post
    Thanks for the replies. I was just thinking that a computer could track every single card (i.e. it would know there are nine 7's left but only four 8's, etc.). With this additional information, it could make MUCH more informed decisions than Hi-Lo Full Index or any other counting system possible for a human. I thought this might make it possible to win flat betting 6D, S17, 5/6 pen, LS, DAS, RSA
    I thought this was an intriguing question, with some contradictory responses in this thread that make it even more interesting. Following is an attempt at providing a quantitative answer.

    perfect_play.jpg

    There is a lot going on here. I considered four sets of rules: 6D, S17, DOA, DAS, SPL3 as a baseline shown in purple, with the four colored curves indicating the four possible combinations of including (or not) RSA and/or LS. The x-axis indicates a particular assumed penetration. The y-axis indicates the overall expected return, in percentage of flat-bet unit wager, from long-term play, that is, repeatedly playing from the top of each shuffled shoe down to the cut card at the corresponding penetration.

    This is a combination of CA and simulation, using the count.exe tool (binary and source code available on GitHub, so anyone can review or even reproduce these results). For each of the four rule sets, I simulated 10,000 shoes to 5.5/6 penetration, for each round evaluating the pre-round EV assuming CDZ- strategy for that exact composition of depleted shoe. From this, we can evaluate any candidate intermediate penetration from 0/6 (i.e., reshuffle after each round, at x=0, which we can verify agrees with the full-shoe EV reported by e.g. the strategy.exe CA tool at the above link) to 5.5/6 (note the constant behavior of each curve beyond this point is thus an artifact of my stopping each simulated shoe there).

    We might think 10,000 simulated shoes (or roughly 530,000 rounds) is a hopelessly small sample; but keep in mind that each sample is not just an outcome of each corresponding round but rather each sample is itself an exact expected value of the return from the corresponding current depleted shoe. The gray curves flanking each colored curve indicate the 95% (roughly 2-sigma) confidence interval for our estimate of the overall expected return played to a given penetration.

    The baseline purple curve corresponds to my choice of rules in a 2013 analysis where I made the following comment: "... perfect play yields an expected return of only -0.2333%. In other words, even equipped with a laptop at the table, the house still has an advantage! This is not as surprising as it sounds; since we are focusing on playing efficiency, we are assuming flat betting. This merely emphasizes the point that, in shoe games, accurate betting strategy is more important than varying playing strategy."

    In that analysis, I assumed 4.5/6 penetration; the -0.2333% value corresponds to the x=4.5 point on the purple curve above. Widening our view with this new analysis, we can see that:

    1. Even pushing deeper to 5.5/6, those baseline rules still don't yield a flat-betting player advantage.
    2. Even allowing both resplit of aces and (late) surrender requires 5/6 penetration to even start to see a flat-betting advantage.
    3. Although RSA and LS individually have comparable effects on full-shoe EV (i.e., the green and blue curves closely agree at x=0), with deeper penetration surrender is more advantageous than RSA.

    Finally, the "wiggle" near x=0 is interesting. Granted, it's an unrealistic region of penetration (i.e., we aren't dealing more than one, but less than half dozen rounds between shuffles), but I don't yet understand what's happening there.

    These results were calculated in about a laptop-day of CPU time; I'm wondering if there has been similar past analysis of "penetrating computer perfect play" (more precisely, any analysis based on strategy maximizing EV for each pre-round depleted shoe), e.g. supporting any of the claims in earlier comments in this thread, that would be interesting to compare with?

  3. #16
    Senior Member
    Join Date
    Dec 2015
    Location
    Everywhere & Nowhere
    Posts
    204


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    These results were calculated in about a laptop-day of CPU time; I'm wondering if there has been similar past analysis of "penetrating computer perfect play" (more precisely, any analysis based on strategy maximizing EV for each pre-round depleted shoe), e.g. supporting any of the claims in earlier comments in this thread, that would be interesting to compare with?
    The link below may be what you're looking for. I don't know Rust, so I'm not able to compile it and verify the results reported in the README file. Obligatory "this is not me and not my code".

    https://github.com/joshuaprince/blackjack_composition

  4. #17
    Senior Member
    Join Date
    Jan 2025
    Location
    USA
    Posts
    144


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    ....

    We might think 10,000 simulated shoes (or roughly 530,000 rounds) is a hopelessly small sample; but keep in mind that each sample is not just an outcome of each corresponding round but rather each sample is itself an exact expected value of the return from the corresponding current depleted shoe. The gray curves flanking each colored curve indicate the 95% (roughly 2-sigma) confidence interval for our estimate of the overall expected return played to a given penetration.

    ...
    I am glad you mentioned this. When I use your code to do simulations, I just simulate to the point where i can get an exact EV for the strategy in play, rather than play out a single branch of the tree that was used to get that EV value. This reduces the computing time for convergence by a huge factor.

  5. #18


    Did you find this post helpful? Yes | No
    Eric, when you combine CA and sim during these types of analysis, do you also physically play out player and dealer hands or do you simply compute the overall EV based on what remains in the shoe from card position i? Basically, how do you go about such analysis? What do you qualify as a “shoe”? What do you qualify as a “round”? Do you compute overall EV’s for each shoe depth 0, 1, 2, …, 312?

  6. #19


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    I thought this was an intriguing question, with some contradictory responses in this thread that make it even more interesting. Following is an attempt at providing a quantitative answer.

    perfect_play.jpg

    There is a lot going on here. I considered four sets of rules: 6D, S17, DOA, DAS, SPL3 as a baseline shown in purple, with the four colored curves indicating the four possible combinations of including (or not) RSA and/or LS. The x-axis indicates a particular assumed penetration. The y-axis indicates the overall expected return, in percentage of flat-bet unit wager, from long-term play, that is, repeatedly playing from the top of each shuffled shoe down to the cut card at the corresponding penetration.

    This is a combination of CA and simulation, using the count.exe tool (binary and source code available on GitHub, so anyone can review or even reproduce these results). For each of the four rule sets, I simulated 10,000 shoes to 5.5/6 penetration, for each round evaluating the pre-round EV assuming CDZ- strategy for that exact composition of depleted shoe. From this, we can evaluate any candidate intermediate penetration from 0/6 (i.e., reshuffle after each round, at x=0, which we can verify agrees with the full-shoe EV reported by e.g. the strategy.exe CA tool at the above link) to 5.5/6 (note the constant behavior of each curve beyond this point is thus an artifact of my stopping each simulated shoe there).

    We might think 10,000 simulated shoes (or roughly 530,000 rounds) is a hopelessly small sample; but keep in mind that each sample is not just an outcome of each corresponding round but rather each sample is itself an exact expected value of the return from the corresponding current depleted shoe. The gray curves flanking each colored curve indicate the 95% (roughly 2-sigma) confidence interval for our estimate of the overall expected return played to a given penetration.

    The baseline purple curve corresponds to my choice of rules in a 2013 analysis where I made the following comment: "... perfect play yields an expected return of only -0.2333%. In other words, even equipped with a laptop at the table, the house still has an advantage! This is not as surprising as it sounds; since we are focusing on playing efficiency, we are assuming flat betting. This merely emphasizes the point that, in shoe games, accurate betting strategy is more important than varying playing strategy."

    In that analysis, I assumed 4.5/6 penetration; the -0.2333% value corresponds to the x=4.5 point on the purple curve above. Widening our view with this new analysis, we can see that:

    1. Even pushing deeper to 5.5/6, those baseline rules still don't yield a flat-betting player advantage.
    2. Even allowing both resplit of aces and (late) surrender requires 5/6 penetration to even start to see a flat-betting advantage.
    3. Although RSA and LS individually have comparable effects on full-shoe EV (i.e., the green and blue curves closely agree at x=0), with deeper penetration surrender is more advantageous than RSA.

    Finally, the "wiggle" near x=0 is interesting. Granted, it's an unrealistic region of penetration (i.e., we aren't dealing more than one, but less than half dozen rounds between shuffles), but I don't yet understand what's happening there.

    These results were calculated in about a laptop-day of CPU time; I'm wondering if there has been similar past analysis of "penetrating computer perfect play" (more precisely, any analysis based on strategy maximizing EV for each pre-round depleted shoe), e.g. supporting any of the claims in earlier comments in this thread, that would be interesting to compare with?

    Hi Eric,

    Your results in some way confirm what I wrote above. If the rules aren’t good enough, even having a computer at hand won’t give us any advantage. That’s why I mentioned ES as the baseline.
    Notice that even with LS and RSA, it’s still not enough unless the penetration is 5.5/6.

    Twenty years ago, I modified my simulator to incorporate CA and analyze each round exhaustively. At that time, it was so time-consuming that analyzing 10,000 shoes would take me months.

    Clearly, the computing power back then didn’t help at all. So, I took an interesting shortcut using EORs, just like Peter Griffin did in TOB. That was the best I could do in terms of speed,
    and I remember the results were quite solid. Of course, the overall EV was still negative, but I knew I was using the most efficient playing strategy available.


    Sincerely,
    Cac
    Luck is what happens when preparation meets opportunity.

  7. #20


    Did you find this post helpful? Yes | No
    Quote Originally Posted by JohnGalt007 View Post
    The link below may be what you're looking for. I don't know Rust, so I'm not able to compile it and verify the results reported in the README file. Obligatory "this is not me and not my code".

    https://github.com/joshuaprince/blackjack_composition
    Thanks for the link; I reviewed the code and unfortunately see numerous errors in implementation (e.g., incorrect handling of conditioning on no dealer blackjack, pair splitting, etc.), so I don't think the results there help us much here.

  8. #21


    2 out of 2 members found this post helpful. Did you find this post helpful? Yes | No
    Quote Originally Posted by lij45o6 View Post
    Eric, when you combine CA and sim during these types of analysis, do you also physically play out player and dealer hands or do you simply compute the overall EV based on what remains in the shoe from card position i? Basically, how do you go about such analysis? What do you qualify as a “shoe”? What do you qualify as a “round”? Do you compute overall EV’s for each shoe depth 0, 1, 2, …, 312?
    Yes and yes . That is, for each simulated shoe, we start by shuffling, than play a series of rounds to 5.5/6 penetration. For each round we record (a) the *pre*-round depleted shoe composition, (b) the *pre*-round expected return assuming that we "will" play EV-maximizing strategy for the currently depleted shoe, and (c) the *post*-round outcome of playing that EV-maximizing strategy (e.g., +1.5 for player blackjack, -2.0 for a split and two busted halves of the split, etc.), dealing cards from the shuffled shoe to resolve player and dealer hands as usual.

    Once we've simulated a desired number of shoes, to produce the figure presented here, for each candidate penetration from x=0 to x=5.5, we can restrict the population sample accordingly, including only those rounds whose pre-deal composition (a) contains at least 52(6-x) cards, and compute a corresponding average return (i.e., y-coordinate in the figure) as the mean of the restricted sample of returns.

    If we had the time to do this for billions of shoes, we could do this by computing the mean of (c) values, the actual outcomes of each round. Instead, we average the samples of pre-deal exact expected returns (b).

  9. #22


    3 out of 3 members found this post helpful. Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    perfect_play.jpg
    <snip>
    Finally, the "wiggle" near x=0 is interesting. Granted, it's an unrealistic region of penetration (i.e., we aren't dealing more than one, but less than half dozen rounds between shuffles), but I don't yet understand what's happening there.<snip>
    eric,

    The wiggle shows the cut card effect.

    When the penetration is 5 cards or less so that only a single round is played, the EV is constant: that's why each curve begins with a small flat section.

    When the pen is 6 cards, we almost always get only one round. The only time we get to round 2 is when on round 1 neither the dealer nor the player drew: this means either both had standing hands or at least one had a BJ. This means that round 2 began with at best a neutral HiLo running count (BJ vs. 2 smalls or 8,9 vs. 8,9) and at worst a HiLo running count of -4. Thus, on average the RC (and so the TC) is negative on the rare round 2 hands for a pen of 6, so the EV falls.

    If you were to re-run your analysis for a single-deck game, I predict the wiggles would be even more dramatic.

    Hope this helps!

    Dog Hand

  10. #23


    Did you find this post helpful? Yes | No
    Really interesting stuff, Eric. Thanks for sharing this.

    Dog, Thanks for the explanation on that. Makes sense.

    Really learning something here and enjoying this convo.

  11. #24
    Senior Member
    Join Date
    Jan 2025
    Location
    USA
    Posts
    144


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    Yes and yes . That is, for each simulated shoe, we start by shuffling, than play a series of rounds to 5.5/6 penetration. For each round we record (a) the *pre*-round depleted shoe composition, (b) the *pre*-round expected return assuming that we "will" play EV-maximizing strategy for the currently depleted shoe, and (c) the *post*-round outcome of playing that EV-maximizing strategy (e.g., +1.5 for player blackjack, -2.0 for a split and two busted halves of the split, etc.), dealing cards from the shuffled shoe to resolve player and dealer hands as usual.

    Once we've simulated a desired number of shoes, to produce the figure presented here, for each candidate penetration from x=0 to x=5.5, we can restrict the population sample accordingly, including only those rounds whose pre-deal composition (a) contains at least 52(6-x) cards, and compute a corresponding average return (i.e., y-coordinate in the figure) as the mean of the restricted sample of returns.

    If we had the time to do this for billions of shoes, we could do this by computing the mean of (c) values, the actual outcomes of each round. Instead, we average the samples of pre-deal exact expected returns (b).
    I did a very similar study recently for the new online single-deck BJ game with a maximum of three spots. I was trying to get at the EV of the third hand using all of the information about extra cards revealed by the play of the first two spots. Instead of doing MC simulation, I just calculated the probability of removing N random cards from the shoe by the play of the first two hands. This means I did not sample; I iterated over every possible combination of four cards removed from the deck by the play of two hands, then every possible combination of five cards, etc. There is no MC component to my calculation.

    However, this introduces a bias. If only four cards are played in the first two spots, then these are much more likely to have been four high cards. If there were four non-ace low cards, then one or more cards are likely to be drawn to those two hands. The EV that I calculate for perfect play of the third and final hand is going to be biased because the I don't weight the probabilities for each combination for their chances of appearing in actual play using proper strategy for the first two spots.

    I don't know how much this bias affects my EV calculations. I think the single-deck problem is small enough that I can do this properly by playing out every possible distinct permutation of cards in the first two spots and assigning exact probabilities for arriving at the third hand with any N specific cards exposed.

    I am using your code to calculate the EVs once I get to the third hand, so I just need to get the right weights for getting to that point. Then the EV will be exact, with no Monte Carlo uncertainty.

  12. #25


    Did you find this post helpful? Yes | No
    There are exactly 33203125 shoe subsets for 1D blackjack. While most of them, I imagine, are not needed, you could theoretically get a speed up in computation via pre-computing dealer conditional probabilities for each shoe. What I would do next is pre-compute each possible player hand, using a table if 3 pointers, to construct a set of player hand subsets and compute each hand to get the overall EV. Basically, similar to how CDO splitting is computed, but truncated for only 3 hands. This program could run prior to your play at a specific casino: input the rules, let the CA run for a bit, play after it finishes number-crunching.

  13. #26


    3 out of 3 members found this post helpful. Did you find this post helpful? Yes | No
    Quote Originally Posted by Dog Hand View Post
    eric,

    The wiggle shows the cut card effect.

    When the penetration is 5 cards or less so that only a single round is played, the EV is constant: that's why each curve begins with a small flat section.

    When the pen is 6 cards, we almost always get only one round. The only time we get to round 2 is when on round 1 neither the dealer nor the player drew: this means either both had standing hands or at least one had a BJ. This means that round 2 began with at best a neutral HiLo running count (BJ vs. 2 smalls or 8,9 vs. 8,9) and at worst a HiLo running count of -4. Thus, on average the RC (and so the TC) is negative on the rare round 2 hands for a pen of 6, so the EV falls.

    If you were to re-run your analysis for a single-deck game, I predict the wiggles would be even more dramatic.

    Hope this helps!

    Dog Hand
    Ah, you're right, thanks for the very clear explanation. The figure below shows the results for 1D (otherwise the same baseline rules with neither RSA nor LS) that confirm your prediction.

    perfect_play_1d.jpg

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Will flat betting buy me any time?
    By LoneWoLF in forum General Blackjack Forum
    Replies: 38
    Last Post: 06-01-2016, 09:53 PM
  2. Flat betting
    By TeamMoney in forum General Blackjack Forum
    Replies: 10
    Last Post: 04-08-2016, 05:30 AM
  3. Flat Betting v. Card Counting v. Progression Betting
    By BJ_WIN in forum The Disadvantage Forum
    Replies: 17
    Last Post: 10-20-2015, 02:20 PM
  4. Help regarding Blackjack Simulator an flat betting 1000000 hands
    By niqueclyde in forum General Blackjack Forum
    Replies: 14
    Last Post: 10-21-2014, 03:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

About Blackjack: The Forum

BJTF is an advantage player site based on the principles of comity. That is, civil and considerate behavior for the mutual benefit of all involved. The goal of advantage play is the legal extraction of funds from gaming establishments by gaining a mathematic advantage and developing the skills required to use that advantage. To maximize our success, it is important to understand that we are all on the same side. Personal conflicts simply get in the way of our goals.