See the top rated post in this thread. Click here

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: MGP's BJCA

  1. #11
    Senior Member
    Join Date
    Jun 2015
    Location
    In orbit around Saturn
    Posts
    902


    Did you find this post helpful? Yes | No
    Maybe we are not all talking about the same program.

    I'm talking about https://www.blackjackinfo.com/free-b...rial-analyzer/
    from MGP

    And not about http://www.bjstrat.net/programs.html
    from KC (great program too)

    KC agree with me. I quote
    "I agrre with you. My program displays unconditional EV in the cases of early surrender or ENHC even though the 'conditioned on no dealer blackjack where applicable' box is checked. To me conditional EV is not applicable in these cases although it could theoretically (and pretty meaninglesssly) still be computed"
    Peek AND early surrender seems rare (maybe only in Fun21 ?)
    And MGP choose to apply inconveniently 'conditioned on no dealer blackjack'' even for surrender.




    Last edited by Phoebe; 06-14-2019 at 11:58 PM.

  2. #12


    Did you find this post helpful? Yes | No
    Quote Originally Posted by dogman_1234 View Post
    Question: would these "errors" be the result of how MGP et. al. computed split hands? If so, I was under the impression that MGP and Cacarulo had found out the optimal splitting algorithm to get exact results for all in-order split hands.
    Yes, I think the errors are due to the handling of split hands. I should clarify: you are correct that MGP's CA computes correct, exact expected values for splitting assuming any of CDZ-, CDP, or CDPN post-split playing strategies (although I'm not sure what you mean by "optimal"?)... almost all of the time, where I believe (but can't yet point to specific lines of code causing the problem) that the only time where reported values are in error are when some card ranks are missing from the depleted shoe being evaluated, as in the example described previously.

    However, although when I observe errors, there is always at least one card rank missing, I don't know if the converse is true; that is, I don't know if the reported values are always wrong when a card rank is missing. (If so, this is certainly not a negligible edge case-- dealing 5 decks into a 6-deck shoe, the probability of encountering such a subset is about 0.0913734).

    Quote Originally Posted by dogman_1234 View Post
    Now that I think about it: Certain split hand are dependent on the deck subset. Take for instance [22] vs 6; *assume SP1:

    We get two hands: {2x, 2x}, we cycle though all x's from Ace to Face (1-10).
    We then take the weighted expectations for each new [2x] hand and multiply by two. That is Split_22_6 = 2 * (EV_max[2A] + EV_max[22] + ... + EV_max[2T])

    What becomes an issue is that the right-most [2x] hand has an immediate effect on the outcome of the left-most [2x] hand. That is, the conditional expectation changes per card removed (and as an effect, changes the conditional probabilities for each dealer hand for up-card rank 6.) This would result in different weighted expectations and a different overall expectation for each split decision and overall strategy expectation.

    Sorry for the tangent. Just popped into my mind and would be interested in what others thought.
    I may misunderstand your description here, but as long as we assume that the strategy applied is the same for both halves of the split hand, the expected return from each of those halves is exactly the same... and when evaluating that expected return, we only need to "remove" one additional pair card from the shoe to compute the necessary probabilities of outcomes of the dealer's hand.

    Furthermore, this is true even if we are allowed to split more than once. That is, for example with SPL3, if we just condition on the subset of cases where we only split to exactly two hands (i.e., where we split our 2s, and neither of the drawn cards completing the two halves is another 2), then the expected return from both halves of the split is the same. (Actually, I recall having a discussion about exactly this perhaps-non-intuitive result with MGP on bjmath.com over 15 years ago.)

  3. #13


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    Yes, I think the errors are due to the handling of split hands. I should clarify: you are correct that MGP's CA computes correct, exact expected values for splitting assuming any of CDZ-, CDP, or CDPN post-split playing strategies (although I'm not sure what you mean by "optimal"?)... almost all of the time, where I believe (but can't yet point to specific lines of code causing the problem) that the only time where reported values are in error are when some card ranks are missing from the depleted shoe being evaluated, as in the example described previously.

    However, although when I observe errors, there is always at least one card rank missing, I don't know if the converse is true; that is, I don't know if the reported values are always wrong when a card rank is missing. (If so, this is certainly not a negligible edge case-- dealing 5 decks into a 6-deck shoe, the probability of encountering such a subset is about 0.0913734).
    Interesting. No clue.


    I may misunderstand your description here, but as long as we assume that the strategy applied is the same for both halves of the split hand, the expected return from each of those halves is exactly the same... and when evaluating that expected return, we only need to "remove" one additional pair card from the shoe to compute the necessary probabilities of outcomes of the dealer's hand.

    Furthermore, this is true even if we are allowed to split more than once. That is, for example with SPL3, if we just condition on the subset of cases where we only split to exactly two hands (i.e., where we split our 2s, and neither of the drawn cards completing the two halves is another 2), then the expected return from both halves of the split is the same. (Actually, I recall having a discussion about exactly this perhaps-non-intuitive result with MGP on bjmath.com over 15 years ago.)
    Basically, for our split 22 vs 6, we will compute the overall expectation first by splitting both rank card into two separate 1-card hands: {2x, 2x}. We then compute the right-most 2x vs dealer 6 with the inclusion of a missing deuce, and cycle through all x's : 1-10. Now, when it comes to computing the left-most 2x, we must not only remove a deuce, (as we did with the right-most 2x), but we must also remove the given right-most x of the hand. That is, when we compute the left-most split, we must also do so for the removal of each additional x that we cycle through. Here is where the thinking is going in a visual manner:

    ---SPLIT 22 v 6---
    [22] -> {2x, 2x}; deck:[4 2 4 4 4 3 4 4 4 16]

    ---Remove 2 and draw first rank---
    {2x, 2x}; deck[4 2 4 4 4 3 4 4 4 16] -> {2x, 2A}; deck:[3 2 4 4 4 3 4 4 4 16]

    ---Compute 2A, then go to left-most 2x to compute it's conditional expectations---
    {2x, 2A}; deck[3 2 4 4 4 3 4 4 4 16] -> {2A, 2A}; deck:[2 2 4 4 4 3 4 4 4 16]

    ---Snip---

    What should be apparent here is that the given deck subset is different for each given pair hand after split; even when the overall substance for each hand is similar. The Expectations for the right most 2A is:

    2A v 6
    deck:[4 3 4 4 4 4 4 4 4 16]:: *we have removed the left-most deuce from the deck*
    Stand: -9.587
    Hit: 17.82
    Double: 26.25

    The Expectation for the left-most 2A is:

    2A v 6
    deck[3 3 4 4 4 4 4 4 4 16]:: *we removed the right-most cards [2A] from the deck*
    Stand: -6.556
    Hit: 19.22
    Double: 30.24


    While our overall strategy does not change (that is the given decision is to double/draw for DAS/nDAS,) our overall expectation would be different rather than taking the product of the split hand with it's pair card removed and timing it by 2.

    I would be interested in seeing how MGP and Calc both came up with their exact/optimal split algorithm. Why is it that for SPL1 that we can do EV = 2*EV(x) ?

    Hopefully this helps a little. Or not...maybe I got too carried away! :/

  4. #14


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No
    I suppose at this point we should acknowledge to the OP that we've moved away from the original question that started this thread. (Although if it helps, we are indeed still talking about MGP's CA, not k_c's.)

    Quote Originally Posted by dogman_1234 View Post
    ---SPLIT 22 v 6---
    [22] -> {2x, 2x}; deck:[4 2 4 4 4 3 4 4 4 16]

    ---Remove 2 and draw first rank---
    {2x, 2x}; deck[4 2 4 4 4 3 4 4 4 16] -> {2x, 2A}; deck:[3 2 4 4 4 3 4 4 4 16]

    ---Compute 2A, then go to left-most 2x to compute it's conditional expectations---
    {2x, 2A}; deck[3 2 4 4 4 3 4 4 4 16] -> {2A, 2A}; deck:[2 2 4 4 4 3 4 4 4 16]

    ---Snip---

    What should be apparent here is that the given deck subset is different for each given pair hand after split; even when the overall substance for each hand is similar. The Expectations for the right most 2A is:

    2A v 6
    deck:[4 3 4 4 4 4 4 4 4 16]:: *we have removed the left-most deuce from the deck*
    Stand: -9.587
    Hit: 17.82
    Double: 26.25

    The Expectation for the left-most 2A is:

    2A v 6
    deck[3 3 4 4 4 4 4 4 4 16]:: *we removed the right-most cards [2A] from the deck*
    Stand: -6.556
    Hit: 19.22
    Double: 30.24


    While our overall strategy does not change (that is the given decision is to double/draw for DAS/nDAS,) our overall expectation would be different rather than taking the product of the split hand with it's pair card removed and timing it by 2.
    But it's not different; the above is more work than we need to compute the expected value of splitting without resplitting. Let's use your example of splitting 2-2 vs. dealer 6, in single deck with S17 SPL1, and let's assume nDAS to simplify the "brute force" calculations. We are assuming CDZ- playing strategy, which in this case is to hit any hand drawn to the split.

    First, hopefully we can agree that the overall CDZ- expected value of splitting 2-2 vs. 6 is 0.1189818683947885 (as a fraction of initial wager). This can be confirmed by any of the accessible CA's (e.g., mine, MGP's, or k_c's).

    We can compute this value as 2E[X;1], where E[X;1] is the expected value of:

    1. Starting with the full single deck, removing the dealer's up card, and two pair cards.
    2. Randomly draw a card to yield a split hand, e.g., drawing an ace yields the hand 2-A.
    3. Play out that single "half" of the split and note the outcome.

    The random draw in steps 2 and 3 means that we must evaluate each possible card drawn to the single half of the split:

    Code:
    P(draw 1) = 0.081632653061224483
        E(hit) = 0.1782246889194101
    P(draw 2) = 0.040816326530612242
        E(hit) = 0.046675159884156783
    P(draw 3) = 0.081632653061224483
        E(hit) = 0.033124919547275714
    P(draw 4) = 0.081632653061224483
        E(hit) = 0.02672233027248045
    P(draw 5) = 0.081632653061224483
        E(hit) = 0.082372375465304196
    P(draw 6) = 0.061224489795918366
        E(hit) = 0.1387543650852183
    P(draw 7) = 0.081632653061224483
        E(hit) = 0.21256816781977234
    P(draw 8) = 0.081632653061224483
        E(hit) = 0.32250214058632209
    P(draw 9) = 0.081632653061224483
        E(hit) = 0.36250247649994238
    P(draw 10) = 0.32653061224489793
        E(hit) = -0.15416412723710496
    Weighted sum     = 0.059490934197394249
    Overall E(split) = 0.1189818683947885
    It's important to note that this isn't just computational convenience. That is, it's not that we simply "get the same answer" by doing the calculation this way. The expected outcome of the two halves of the split are indeed identical.

    And even for resplitting, we can similarly take advantage of that same linearity of expectation by "grouping" the various possible split/resplit outcomes according to the "pattern" of number of pair-cards and non-pair-cards drawn to the split hands (weighted by the number of ways that each such pattern can occur). For example, consider SPL3: among those outcomes where we only split 2-2 once (i.e., we draw a non-deuce to both halves of the split), let X be the outcome of the first half of such a split, and Y be the outcome of the second half of such a split. Then E[X]=E[Y]. See this paper for more details on how we can use this to efficiently (and still exactly) compute split EVs. (This is how my CA does it, for example.)

    Eric

    P.S. Following is the example code using my CA to illustrate how we can compute the values in the above example:

    Code:
    #include "blackjack.h"
    #include <iostream>
    #include <iomanip>
    
    int main()
    {
        std::cout << std::setprecision(17);
    
        // Assume SD, S17, nDAS, SPL1.
        BJShoe shoe(1);
        BJRules rules(false, true, true, true, false, false, false, false, false);
        BJStrategy cdz;
        BJProgress progress;
        BJPlayer *basic = new BJPlayer(shoe, rules, cdz, progress);
    
        // Evaluate split 2-2 vs. 6 by considering each possible single drawn card.
        int pair_card = 2, up_card = 6;
        double ev_split = 0;
        BJHand hand;
        hand.deal(pair_card);
        shoe.deal(pair_card);
        BJPlayer *split = new BJPlayer(shoe, rules, cdz, progress);
        shoe.deal(pair_card);
        shoe.deal(up_card);
        for (int draw = 1; draw <= 10; ++draw)
        {
            hand.deal(draw);
            double p = shoe.getProbability(draw);
            int strategy = basic->getOption(hand, up_card, true, false, false);
            double ev_draw = (strategy == BJ_STAND ?
                    split->getValueStand(hand, up_card) :
                    split->getValueHit(hand, up_card));
            ev_split += p * ev_draw;
            std::cout << "P(draw " << draw << ") = " << p << std::endl;
            std::cout << "    E(" << (strategy == BJ_STAND ? "stand" : "hit") <<
                ") = " << ev_draw << std::endl;
            hand.undeal(draw);
        }
        std::cout << "Weighted sum     = " << ev_split << std::endl;
        std::cout << "Overall E(split) = " << 2 * ev_split << std::endl;
        delete basic;
        delete split;
    }

  5. #15


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    First, hopefully we can agree that the overall CDZ- expected value of splitting 2-2 vs. 6 is 0.1189818683947885 (as a fraction of initial wager). This can be confirmed by any of the accessible CA's (e.g., mine, MGP's, or k_c's).
    Both BJA3 and bjstrat (KC) give 0.1259. What am I missing??

    Don

  6. #16


    Did you find this post helpful? Yes | No
    Quote Originally Posted by DSchles View Post
    Both BJA3 and bjstrat (KC) give 0.1259. What am I missing??

    Don
    Don,

    I believe ericfarmer is using k_c's program with the "Compute mode" set to "Basic strat" rather than the default setting of "Best strat".

    Hope this helps!

    Dog Hand

  7. #17


    Did you find this post helpful? Yes | No
    What you are missing is that Eric is using CDZ- as strategy for split hands. CDZ- means strategy for split hands is determined prior to splitting by duplicating the strategy of non-split hands. My program has this option for a full shoe whereas Eric's can use this strategy for any shoe composition. In order to choose this option for a full shoe in my program you need to select 'Basic strat' under 'Compute mode' and 'Pre-split' under 'Depleted shoe split strat'. My program uses this as an option to compute basic strategy EVs for a depleted shoe. The default of my program is to use the optimal strategy of the first split hand and for a full shoe split EV for 2-2 v 6 s17 nDAS is more optimal using this strategy instead of using the strategy determined by pre-spilt hands.

    It might sound complicated but it's simply a difference in the fixed strategy that is used for splitting.

    k_c

  8. #18


    Did you find this post helpful? Yes | No
    Thanks. Understood. Never used that mode, nor was it used in BJA3, as the results are suboptimal.

    Don

  9. #19


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    But it's not different; the above is more work than we need to compute the expected value of splitting without resplitting. Let's use your example of splitting 2-2 vs. dealer 6, in single deck with S17 SPL1, and let's assume nDAS to simplify the "brute force" calculations. We are assuming CDZ- playing strategy, which in this case is to hit any hand drawn to the split.

    First, hopefully we can agree that the overall CDZ- expected value of splitting 2-2 vs. 6 is 0.1189818683947885 (as a fraction of initial wager). This can be confirmed by any of the accessible CA's (e.g., mine, MGP's, or k_c's).

    We can compute this value as 2E[X;1], where E[X;1] is the expected value of:

    1. Starting with the full single deck, removing the dealer's up card, and two pair cards.
    2. Randomly draw a card to yield a split hand, e.g., drawing an ace yields the hand 2-A.
    3. Play out that single "half" of the split and note the outcome.

    It's important to note that this isn't just computational convenience. That is, it's not that we simply "get the same answer" by doing the calculation this way. The expected outcome of the two halves of the split are indeed identical.

    And even for resplitting, we can similarly take advantage of that same linearity of expectation by "grouping" the various possible split/resplit outcomes according to the "pattern" of number of pair-cards and non-pair-cards drawn to the split hands (weighted by the number of ways that each such pattern can occur). For example, consider SPL3: among those outcomes where we only split 2-2 once (i.e., we draw a non-deuce to both halves of the split), let X be the outcome of the first half of such a split, and Y be the outcome of the second half of such a split. Then E[X]=E[Y]. See this paper for more details on how we can use this to efficiently (and still exactly) compute split EVs. (This is how my CA does it, for example.)

    Eric
    Okay, so:

    1.) From what I am gathering here is that the method of computing exact split Expectation's for single-split hands is 2 times the overall weighted Expectations for each new hand drawn, conditioned on a pair card removed. That is, even when computing the overall split Expectation for 22 vs 6, we only need to be aware of one single hand conditioned on its pair-rank removed from a full deck. We don't need to be cognizant of the other card nor of the other hand's make-up. So, for splitting 22 vs 6 , we don't need to evaluate {2A, 2A} directly; taking into account the missing deuce and Ace in the second hand for the Expectation of the first. We simply need to do {2x, 2A} and add the new Expectation of 2A conditioned on the missing 2 pair-rank removed to properly find the correct E/Action for 2A. Summing for each new draw rank 1-10, we combine them (by their overall weighted Expectations as E[Split] = P(A) * E(A) + ...P(10) * E(10)) taking a factor of two (for the two hands) and we should properly derive the conditional expectation of splitting 22 vs 6 for 1D, S17, (n)DAS, SPL1.

    2.) Further splitting gets more complicated as we most of the time hit a "wall" of non-pair ranks. So, to split 22 vs 6 for SP2: we can have {2x, 2x}, draw a 2 and develop {2x, 2x, 2x}, we then cycle through each rank x, from 1-10, for the right-most 2x, and times it by the number of ways that hand state can be ordered. But, from your paper, this is (not?) the way this is done. I would assume the multinomial coefficient of the given split rank values to determine the overall Expectation of splitting 22 v 6 for SP2. Assume we draw an Ace after splitting to 3 deuces, we have a MC of 4. We then take this MC and times it by the overall weighted expectation for each optimal action (similar to our SP1 example.) However; drawing a third deuce is not guaranteed and so this method is wrong, correct? As per your paper, what I just described is incorrect and there involves some level of detail that I am missing.
    Last edited by dogman_1234; 06-16-2019 at 07:18 PM.

  10. #20


    Did you find this post helpful? Yes | No
    Quote Originally Posted by DSchles View Post
    Thanks. Understood. Never used that mode, nor was it used in BJA3, as the results are suboptimal.

    Don
    They aren't suboptimal, they simply make a different assumption about the allowed expressive power in specifying the player's strategy. CDZ- is in fact *more* optimal than the strategy assumed by Cacarulo in BJA3 in that composition-dependence doesn't stop at three cards, so to speak. And CDP1 (roughly what is assumed in BJA3, at least the part relevant to pair splitting) is also less optimal than, say, CDP (also evaluated at least by MGP's and my CAs), where the player can not only consider essentially *whether* he has split a given pair in modifying his strategy, but also *how many times*.

    At any rate, for the purpose of this particular issue raised by dogman_1234, the distinction between CDZ- and CDP1 doesn't matter; the same assertion holds, namely, that the expected value of the two halves of the split are identical.

Page 2 of 3 FirstFirst 123 LastLast

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.