See the top rated post in this thread. Click here

Page 3 of 13 FirstFirst 12345 ... LastLast
Results 27 to 39 of 158

Thread: Proving CA algorithms incorrect (or at least inexact)

  1. #27


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Cacarulo View Post
    Yes, the strategy comes from Table B10. The crucial detail lies in how we treat 16 vs T: I surrender with a two-card 16, but I stand with any other 16, even after splitting.
    The EV might only improve slightly if you hit with two cards after splitting. This scenario is quite extreme, as it would involve splitting eights repeatedly until you have four
    hands and then receiving eights again. I could potentially adjust the code to handle this, but I’m not sure it would be worth the effort.

    Actually, I’m aware of the accumulated rounding errors that occur with double precision. When testing with 13 or more decimals, the sum stops being zero precisely
    due to precision issues. I'm confident that this wouldn't happen with arbitrary precision, and on that, we completely agree.
    But do we really need more than 12 decimals? Or more than 6 for linear estimators?

    Sincerely,
    Cac
    Actually, I’m aware of the accumulated rounding errors that occur with double precision. When testing with 13 or more decimals, the sum stops being zero precisely


    A picture is worth 1000 words, or at least, that’s what people in China use to say.


    s17, das, spl3, spa1, ls

    15 decimals 14 decimals 13 decimals 12 decimals
    A -0.092812947057872 -0.09281294705787 -0.0928129470579 -0.092812947058
    2 0.069793252937073 0.06979325293707 0.0697932529371 0.069793252937
    3 0.084016043042540 0.08401604304254 0.0840160430425 0.084016043043
    4 0.114628494474984 0.11462849447498 0.1146284944750 0.114628494475
    5 0.146376815919007 0.14637681591901 0.1463768159190 0.146376815919
    6 0.075502946395121 0.07550294639512 0.0755029463951 0.075502946395
    7 0.040436959680344 0.04043695968034 0.0404369596803 0.040436959680
    8 -0.011476595397272 -0.01147659539727 -0.0114765953973 -0.011476595397
    9 -0.042505038691486 -0.04250503869149 -0.0425050386915 -0.042505038691
    T -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    J -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    Q -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    K -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    m(6) -0.331703578486916 -0.33170357848692 -0.3317035784869 -0.331703578487
    ss 0.101240441159861 0.10124044115986 0.1012404411599 0.101240441160
    cks 0.000000000000071 0.00000000000007 0.0000000000001 0.000000000000



    Seems to be with 12 decimals, the upper limit for a zero checksum.


    Zenfighter

  2. #28


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Zenfighter View Post
    Actually, I’m aware of the accumulated rounding errors that occur with double precision. When testing with 13 or more decimals, the sum stops being zero precisely


    A picture is worth 1000 words, or at least, that’s what people in China use to say.


    s17, das, spl3, spa1, ls

    15 decimals 14 decimals 13 decimals 12 decimals
    A -0.092812947057872 -0.09281294705787 -0.0928129470579 -0.092812947058
    2 0.069793252937073 0.06979325293707 0.0697932529371 0.069793252937
    3 0.084016043042540 0.08401604304254 0.0840160430425 0.084016043043
    4 0.114628494474984 0.11462849447498 0.1146284944750 0.114628494475
    5 0.146376815919007 0.14637681591901 0.1463768159190 0.146376815919
    6 0.075502946395121 0.07550294639512 0.0755029463951 0.075502946395
    7 0.040436959680344 0.04043695968034 0.0404369596803 0.040436959680
    8 -0.011476595397272 -0.01147659539727 -0.0114765953973 -0.011476595397
    9 -0.042505038691486 -0.04250503869149 -0.0425050386915 -0.042505038691
    T -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    J -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    Q -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    K -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    m(6) -0.331703578486916 -0.33170357848692 -0.3317035784869 -0.331703578487
    ss 0.101240441159861 0.10124044115986 0.1012404411599 0.101240441160
    cks 0.000000000000071 0.00000000000007 0.0000000000001 0.000000000000



    Seems to be with 12 decimals, the upper limit for a zero checksum.


    Zenfighter
    Thank you very much, Zen! It's true, sometimes a picture is worth a thousand words.

    Sincerely,
    Cac




    .
    Luck is what happens when preparation meets opportunity.

  3. #29


    Did you find this post helpful? Yes | No
    Hi Eric,

    I feel like I was very unclear in my initial post here. I'm not suggesting that we all start reporting arbitrary precision results from our CAs, or start reporting 12 or 17 or however many digits of precision, etc. My intent was simply to point out an additional software testing approach, that has proved useful to me, and to at least two other developers, as a means of checking for bugs and/or algorithm flaws. I've had-- and found-- both in my code in the past.
    Your initial post was very clear, and your point was well understood. What I was trying to convey is that the check you proposed—where the sum of EORs isn’t zero—doesn’t necessarily indicate a flaw in the splitting algorithm. For the sum to be zero, the same strategy simply needs to be applied for each removed card. This can still be achieved even with a suboptimal algorithm.

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

  4. #30


    Did you find this post helpful? Yes | No
    The starting condition for pair splitting in blackjack is that generally number of undealt pair cards is very low relative to number of undealt pair cards. For an infinite deck probabilities are:

    pair = non-ten
    pair card = 1/13; non-pair card = 12/13

    pair = ten
    pair card = 4/13; non-pair card = 9/13

    As prob(pair card) increases prob(non-pair card) decreases but sum of both always = 1. What happens when prob(pair card) increases and eventually approaches 1 while prob(non-pair) approaches 0? I wonder in a more extreme condition such as this if computation of exact splitting EV is possible. It would seem that in an extreme condition if unlimited splitting is allowed probability of endless splitting approaches 1 while in a more normal condition such as prob(pair card) = 1/13, prob(non-pair card) = 12/13 probability of endless splitting approaches 0.

    We know that for "normal" compositions, EV(unlimited splitting for infinite deck) = 2*(1-p)/(1-2*p)*EVN
    where p = prob(pair card), EVN = EV(drawing a non-pair card)

    This suggests that prob(pair card) must be < 1/2 for unlimited splitting formula to be valid.

    The roundabout point is that this also may (or may not?) suggest a computation of an EV that only approaches a perfect value but is still accurate enough might be appropriate in order to be able to adapt to more extreme conditions.

    k_c
    "Perfection is the enemy of success."
    -Elon Musk-

  5. #31


    Did you find this post helpful? Yes | No
    It seems to me that "le mieux est l'ennemi du bien" (Volataire, 1770) predates Elon Musk by a very, very long time!

    Don

  6. #32


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Zenfighter View Post
    A picture is worth 1000 words, or at least, that’s what people in China use to say.


    s17, das, spl3, spa1, ls

    15 decimals 14 decimals 13 decimals 12 decimals
    A -0.092812947057872 -0.09281294705787 -0.0928129470579 -0.092812947058
    2 0.069793252937073 0.06979325293707 0.0697932529371 0.069793252937
    3 0.084016043042540 0.08401604304254 0.0840160430425 0.084016043043
    4 0.114628494474984 0.11462849447498 0.1146284944750 0.114628494475
    5 0.146376815919007 0.14637681591901 0.1463768159190 0.146376815919
    6 0.075502946395121 0.07550294639512 0.0755029463951 0.075502946395
    7 0.040436959680344 0.04043695968034 0.0404369596803 0.040436959680
    8 -0.011476595397272 -0.01147659539727 -0.0114765953973 -0.011476595397
    9 -0.042505038691486 -0.04250503869149 -0.0425050386915 -0.042505038691
    T -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    J -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    Q -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    K -0.095989982825592 -0.09598998282559 -0.0959899828256 -0.095989982826
    m(6) -0.331703578486916 -0.33170357848692 -0.3317035784869 -0.331703578487
    ss 0.101240441159861 0.10124044115986 0.1012404411599 0.101240441160
    cks 0.000000000000071 0.00000000000007 0.0000000000001 0.000000000000

    Seems to be with 12 decimals, the upper limit for a zero checksum.

    Zenfighter
    (Sorry for weirdly long delay in reply; I've been on "completely disconnected" vacation, which I highly recommend. )

    I'm still not sure what picture this is intended to paint. Cacarulo states, "Actually, I’m aware of the accumulated rounding errors that occur with double precision. When testing with 13 or more decimals, the sum stops being zero precisely due to precision issues" (my emphasis added). This simply doesn't follow. That is, if P is the proposition "the sum* of EORs is zero when rounded to D=12 decimal digits" and Q is the proposition "the EVs reported by our CA are accurate to D digits", then the claim seems to be that P implies Q. This is untrue... despite the fact that Q happens to be true in this particular case.

    (*) As an aside, it's a bit odd to perform this test by computing the *sum* of EORs, which is only even sensible when distinguishing the 10-valued ranks as you've done above. The units of the sum are "1300 times the initial wager." The *average* EOR makes more sense, preserving the same units as the EV, and you can verify suggests 13 digits of accuracy instead of 12, which is the actual correct value.

    Cacarulo also states, "I'm confident that this wouldn't happen with arbitrary precision, and on that, we completely agree." My point here is that confidence in the accuracy of our CA doesn't logically rest on the output of this exercise, on the picture you've painted in the table above.

    To demonstrate this point, let's look at another example. Consider the same rules (6D, S17, DOA, DAS, SPL3, LS), but played using full-shoe CDZ- strategy. Let's "test" another CA using the same procedure you've executed above:

    Code:
    E[X]   = -0.33051231489072685
    EOR[A] = -0.09346291873071691
    EOR[2] =  0.06907495555899118
    EOR[3] =  0.081964864492504313
    EOR[4] =  0.11154206154045318
    EOR[5] =  0.14201417819121528
    EOR[6] =  0.074232005629511211
    EOR[7] =  0.039193443497114594
    EOR[8] = -0.011707823381252452
    EOR[9] = -0.042290678394506231
    EOR[T] = -0.092636511499340907
    (Note that there is no need to iteratively re-display the same values with decreasing number of digits of precision. The 17 digits above unambiguously specify the underlying 64 bits of the double-precision values involved, if you want to verify calculations yourself.)

    The average of these EORs is about 0.00000108, which would suggest, exactly as you've suggested above, that this CA's values are accurate to 5 decimal digits... and any inaccuracy beyond those 5 digits "are due precisely to precision issues," and *only* to precision issues. Looking at this another way, we can compute the "average expected return" (i.e., averaged over each possible single-card removal) as E[E[X]] = -0.3305112347056537, which also agrees with the full-shoe EV above to 5 digits.

    But our "confidence" in the accuracy of those leading 5 digits is not justified by this experiment. This CA's values reported above are *not* accurate even to 5 decimal digits; they are only accurate to 4. These results are from the old v5.2 of my CA, from over two decades ago, where I *knew* my resplit algorithm was an approximation, a tradeoff of accuracy for speed of execution. You can verify this inaccuracy checking against the exact EV of

    -636491186124390779995774550739146028101753/192719583540554771243108474049609438884038125

    obtained from my CA's latest v7.6, of using k_c's CA, or MGP's (at least for full non-depleted shoes), all of which can evaluate CDZ- strategy.

    In short, "average EOR==0 to D digits" doesn't imply "D digits of accuracy." In other words, given a non-zero average EOR, I don't know how to "separate" the contributions to that error from (a) cumulative rounding errors of limited double precision vs. (b) algorithmic flaws, bugs, approximations, whatever you want to call them, that result in the value being computed not being expressible as an average, over all n! permutations of the shuffled shoe, of a random variable mapping a prefix of that arranged shoe to an outcome of the round (so that the "extended true count theorem" would apply).

  7. #33


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    (Sorry for weirdly long delay in reply; I've been on "completely disconnected" vacation, which I highly recommend. )

    I'm still not sure what picture this is intended to paint. Cacarulo states, "Actually, I’m aware of the accumulated rounding errors that occur with double precision. When testing with 13 or more decimals, the sum stops being zero precisely due to precision issues" (my emphasis added). This simply doesn't follow. That is, if P is the proposition "the sum* of EORs is zero when rounded to D=12 decimal digits" and Q is the proposition "the EVs reported by our CA are accurate to D digits", then the claim seems to be that P implies Q. This is untrue... despite the fact that Q happens to be true in this particular case.

    (*) As an aside, it's a bit odd to perform this test by computing the *sum* of EORs, which is only even sensible when distinguishing the 10-valued ranks as you've done above. The units of the sum are "1300 times the initial wager." The *average* EOR makes more sense, preserving the same units as the EV, and you can verify suggests 13 digits of accuracy instead of 12, which is the actual correct value.

    Cacarulo also states, "I'm confident that this wouldn't happen with arbitrary precision, and on that, we completely agree." My point here is that confidence in the accuracy of our CA doesn't logically rest on the output of this exercise, on the picture you've painted in the table above.

    To demonstrate this point, let's look at another example. Consider the same rules (6D, S17, DOA, DAS, SPL3, LS), but played using full-shoe CDZ- strategy. Let's "test" another CA using the same procedure you've executed above:

    Code:
    E[X]   = -0.33051231489072685
    EOR[A] = -0.09346291873071691
    EOR[2] =  0.06907495555899118
    EOR[3] =  0.081964864492504313
    EOR[4] =  0.11154206154045318
    EOR[5] =  0.14201417819121528
    EOR[6] =  0.074232005629511211
    EOR[7] =  0.039193443497114594
    EOR[8] = -0.011707823381252452
    EOR[9] = -0.042290678394506231
    EOR[T] = -0.092636511499340907
    (Note that there is no need to iteratively re-display the same values with decreasing number of digits of precision. The 17 digits above unambiguously specify the underlying 64 bits of the double-precision values involved, if you want to verify calculations yourself.)

    The average of these EORs is about 0.00000108, which would suggest, exactly as you've suggested above, that this CA's values are accurate to 5 decimal digits... and any inaccuracy beyond those 5 digits "are due precisely to precision issues," and *only* to precision issues. Looking at this another way, we can compute the "average expected return" (i.e., averaged over each possible single-card removal) as E[E[X]] = -0.3305112347056537, which also agrees with the full-shoe EV above to 5 digits.

    But our "confidence" in the accuracy of those leading 5 digits is not justified by this experiment. This CA's values reported above are *not* accurate even to 5 decimal digits; they are only accurate to 4. These results are from the old v5.2 of my CA, from over two decades ago, where I *knew* my resplit algorithm was an approximation, a tradeoff of accuracy for speed of execution. You can verify this inaccuracy checking against the exact EV of

    -636491186124390779995774550739146028101753/192719583540554771243108474049609438884038125

    obtained from my CA's latest v7.6, of using k_c's CA, or MGP's (at least for full non-depleted shoes), all of which can evaluate CDZ- strategy.

    In short, "average EOR==0 to D digits" doesn't imply "D digits of accuracy." In other words, given a non-zero average EOR, I don't know how to "separate" the contributions to that error from (a) cumulative rounding errors of limited double precision vs. (b) algorithmic flaws, bugs, approximations, whatever you want to call them, that result in the value being computed not being expressible as an average, over all n! permutations of the shuffled shoe, of a random variable mapping a prefix of that arranged shoe to an outcome of the round (so that the "extended true count theorem" would apply).
    The sum of the EORs equal to zero indicates that we have used exactly the same strategy obtained with the full shoe, with each of the cards removed. The average of the EORs is the first time I see it, although it should be equal to zero if the sum of the EORs is zero.
    If the sum or average of the EORs is 0.00000108, this means that you are not applying exactly the same strategy for each of the cards removed. Could you verify that? And this doesn't seem to be an issue of arbitrary precision.

    Sincerely,
    Cac

    PS: Does anyone know anything about MGP's life? I haven't seen him around the forums for a while and I've lost his email address.
    Luck is what happens when preparation meets opportunity.

  8. #34


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Cacarulo View Post
    The sum of the EORs equal to zero indicates that we have used exactly the same strategy obtained with the full shoe, with each of the cards removed.
    This isn't quite true, although the converse is. That is, *if* we accurately compute EVs always applying the same strategy, *then* the sum of EORs must equal zero. But a zero sum of EORs does not necessarily imply that we are accurately computing EVs. The linked blog post has some examples of this (see the end of the section titled "Extended True Count Theorem".)

    Quote Originally Posted by Cacarulo View Post
    The average of the EORs is the first time I see it, although it should be equal to zero if the sum of the EORs is zero.
    Right. This idea applies much more generally, in situations where the sum doesn't even make sense: given a starting "full" shoe S, let the random variable X indicate the outcome of a round played using some fixed strategy off the top of S, and let the random variable Y indicate the outcome of first burning a single card from the top of S, then playing a round (using that same fixed strategy).

    Then E[Y]=E[X]. Or in terms of effect of removal, E[Y-E[X]]=E[Y]-E[X]=0. But instead of just "burning a single card from the top of S," let Y be the outcome of playing a round after burning *two* cards. Or after flipping a coin to decide whether to burn one or three cards. Or after playing a round of blackjack (so that Y is the outcome of the *second* round off the top of the shoe). Etc. In any of these cases, we're still verifying that E[Y]=E[X]. But in these more general scenarios, computing a "sum" doesn't even make sense, since we need to weight by the various probabilities of each possible "burn procedure" outcome.

    Or even if we are just focused on effect of single-card removal, it's still useful to do this sort of testing in depleted shoes as well, where each card rank doesn't have the same probability, so again a simple sum doesn't work.

    Quote Originally Posted by Cacarulo View Post
    If the sum or average of the EORs is 0.00000108, this means that you are not applying exactly the same strategy for each of the cards removed. Could you verify that? And this doesn't seem to be an issue of arbitrary precision.
    It's sort of worse than that (which was the whole point of this example). It wasn't really that I was applying a *different strategy* for each card removed, it was that the formula for EV of resplits was of a form-- constructed for efficiency of execution at the expense of accuracy-- that didn't correspond to the expected value of a random variable mapping a prefix of a shuffled shoe to a round outcome. (For example, suppose that we compute the expected value of a single "half" of a split hand with a single pair card removed... then approximate the return from splitting and resplitting to a maximum of 4 hands by multiplying this single-hand EV by some multiplier. This doesn't really involve "changing strategy," but it can still result in a non-zero sum/average EOR, even when computed to arbitrary precision.)

    But again, a sum/average of EORs with "large" departures from zero-- calculated in limited double precision-- doesn't necessarily "mean that you are not applying exactly the same strategy." For example, several years ago, I updated my CA to compute not just expected value but the exact entire probability distribution of outcomes of a round (only for SPL1; this was to help with the study that Gronbog and Don did). We can use this full distribution to compute the EV, and in turn to compute average EOR as we've been doing in this thread. I've verified that this produces the same results as my (much faster) EV-only algorithm... but in my initial version, conducting this average EOR exercise would have implied that it was only accurate to about 7 or 8 digits when executed in double precision. This doesn't mean I wasn't applying a fixed strategy, or that the "math was wrong" in some other way; it's just that the algorithm was more susceptible to rounding error, since we're having to sum a very large number (roughly half a billion) of probabilities, that are in turn widely varying in magnitude.

    Using compensated (Kahan) summation as shown in the linked code below-- but otherwise keeping the algorithm, the "math", itself exactly the same-- increases that accuracy back to EV-only levels.

    https://github.com/possibly-wrong/bl...k_pdf.cpp#L136

    Quote Originally Posted by Cacarulo View Post
    PS: Does anyone know anything about MGP's life? I haven't seen him around the forums for a while and I've lost his email address.
    I haven't heard from him, but I do have an email address of his from private communication a few years ago. I can try to ping him there if that would be desired?

  9. #35


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    This isn't quite true, although the converse is. That is, *if* we accurately compute EVs always applying the same strategy, *then* the sum of EORs must equal zero. But a zero sum of EORs does not necessarily imply that we are accurately computing EVs. The linked blog post has some examples of this (see the end of the section titled "Extended True Count Theorem".)
    Well, I think we're saying the same thing, it's just that you're adding the obvious condition of "if we calculate the EVs accurately".

    Right. This idea applies much more generally, in situations where the sum doesn't even make sense: given a starting "full" shoe S, let the random variable X indicate the outcome of a round played using some fixed strategy off the top of S, and let the random variable Y indicate the outcome of first burning a single card from the top of S, then playing a round (using that same fixed strategy).

    Then E[Y]=E[X]. Or in terms of effect of removal, E[Y-E[X]]=E[Y]-E[X]=0. But instead of just "burning a single card from the top of S," let Y be the outcome of playing a round after burning *two* cards. Or after flipping a coin to decide whether to burn one or three cards. Or after playing a round of blackjack (so that Y is the outcome of the *second* round off the top of the shoe). Etc. In any of these cases, we're still verifying that E[Y]=E[X]. But in these more general scenarios, computing a "sum" doesn't even make sense, since we need to weight by the various probabilities of each possible "burn procedure" outcome.

    Or even if we are just focused on effect of single-card removal, it's still useful to do this sort of testing in depleted shoes as well, where each card rank doesn't have the same probability, so again a simple sum doesn't work.
    Maybe, but here we are talking about EORs calculated from a full shoe where we only remove one card at a time. In this case, the sum must equal zero if and only if we apply the same fixed strategy for each removal.

    It's sort of worse than that (which was the whole point of this example). It wasn't really that I was applying a *different strategy* for each card removed, it was that the formula for EV of resplits was of a form-- constructed for efficiency of execution at the expense of accuracy-- that didn't correspond to the expected value of a random variable mapping a prefix of a shuffled shoe to a round outcome. (For example, suppose that we compute the expected value of a single "half" of a split hand with a single pair card removed... then approximate the return from splitting and resplitting to a maximum of 4 hands by multiplying this single-hand EV by some multiplier. This doesn't really involve "changing strategy," but it can still result in a non-zero sum/average EOR, even when computed to arbitrary precision.)

    But again, a sum/average of EORs with "large" departures from zero-- calculated in limited double precision-- doesn't necessarily "mean that you are not applying exactly the same strategy." For example, several years ago, I updated my CA to compute not just expected value but the exact entire probability distribution of outcomes of a round (only for SPL1; this was to help with the study that Gronbog and Don did). We can use this full distribution to compute the EV, and in turn to compute average EOR as we've been doing in this thread. I've verified that this produces the same results as my (much faster) EV-only algorithm... but in my initial version, conducting this average EOR exercise would have implied that it was only accurate to about 7 or 8 digits when executed in double precision. This doesn't mean I wasn't applying a fixed strategy, or that the "math was wrong" in some other way; it's just that the algorithm was more susceptible to rounding error, since we're having to sum a very large number (roughly half a billion) of probabilities, that are in turn widely varying in magnitude.

    Using compensated (Kahan) summation as shown in the linked code below-- but otherwise keeping the algorithm, the "math", itself exactly the same-- increases that accuracy back to EV-only levels.

    https://github.com/possibly-wrong/bl...k_pdf.cpp#L136
    I think some time ago we had a similar discussion with k_c regarding the calculation of EORs and how the sum should be zero if the same strategy was applied correctly. I remember that the calculation he did, which used a more precise algorithm than mine (maybe CDZ-, I’m not sure), resulted in exactly zero. Maybe he remembers what I’m talking about. In my case, for the calculation of EORs, I use one of two strategies (TD-BS or CD-BS for the first 2 cards + TD for the rest). If, for example, I tried to use the CDP strategy, the sum of the EORs would never equal zero.

    I haven't heard from him, but I do have an email address of his from private communication a few years ago. I can try to ping him there if that would be desired?
    It would be nice to see him back on the forums. I've been away for more than 20 years.

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

  10. #36


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Cacarulo View Post
    Well, I think we're saying the same thing, it's just that you're adding the obvious condition of "if we calculate the EVs accurately".
    I think some time ago we had a similar discussion with k_c regarding the calculation of EORs and how the sum should be zero if the same strategy was applied correctly. I remember that the calculation he did, which used a more precise algorithm than mine (maybe CDZ-, I’m not sure), resulted in exactly zero. Maybe he remembers what I’m talking about. In my case, for the calculation of EORs, I use one of two strategies (TD-BS or CD-BS for the first 2 cards + TD for the rest). If, for example, I tried to use the CDP strategy, the sum of the EORs would never equal zero.

    Sincerely,
    Cac
    The discussion you're referring to was about computing without knowledge of dealer up card. My CA does this. It has 2 compute modes: optimal and basic strategy for either knowledge of dealer up card known or unknown. Additionally if basic strategy is chosen 2 other options exist: CDZ- or CDP1.

    If optimal mode is chosen eors will not sum to 0 because strategy is not fixed. This might be useful relative to count indexes or something like that. With basic strategy mode eors should sum to 0 because strategy is fixed.

    I think any fixed strategy should sum to zero regardless of its efficiency. For example mimic the dealer is a fixed strategy so its eors should sum to zero but it certainly isn't optimal.

    Pair splitting is complicated because it boils down to evaluating removals of possible combinations of pair cards and non-pair cards for a given number of allowed splits and a given fixed strategy. I think what Eric is saying that if an algorithm misevaluates these removals this will be mainfested in average_ev (following removal of 1 card) disagreement with full shoe EV. With mimic the dealer there would be no such disagreement because it would be an equal opportunity misevaluation for every split hand.

    k_c
    "Perfection is the enemy of success."
    -Elon Musk-

  11. #37


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Cacarulo View Post
    Maybe, but here we are talking about EORs calculated from a full shoe where we only remove one card at a time.
    Sure. We're only talking about presence or absence of a factor of 13 here, so I'm not sure what argument there is for sticking with the sum with so much more limited applicability. At any rate, the real benefit of this "EOR test" has not been in these full-shoe situations, though. I participated in many past discussions (mostly on the old blackjackinfo.com) with k_c, MGP, ICountNTrack, and others, that I found to be very useful, sharing and comparing output from our CAs in various situations, most of them depleted shoe subsets, that helped (me, at least) to iron out a lot of kinks in my understanding of the math, and find and eliminate a lot of bugs/flaws in my code.

    For a specific and relatively recent example where this test helped me find an issue in my CA, consider the shoe (6, 6, 1, 5, 8, 2, 5, 9, 2, 34), i.e. 6 aces, 34 tens, etc., S17, DOA, DAS, SPL1, played using CDZ- strategy (for that depleted shoe). My CA used to report 5.327%, but after some EOR-ish testing I found and fixed a problem in v7.5 so that it now reports 5.261%. (The latter agrees with MGP's CA, and interestingly, k_c's online CA agrees with the former, suggesting that we were likely doing something very similar in our code. The issue has to do with "when" to correct the computed expected return of standing on ten-ace to account for the 3:2 blackjack payoff.)

    Quote Originally Posted by Cacarulo View Post
    In this case, the sum must equal zero if and only if we apply the same fixed strategy for each removal.
    No. I'm not sure if maybe the disconnect here is just one of language/terminology? When you say the phrase "if and only if", I read that as any mathematician would, with a very specific interpretation. To make it easier to talk about this, let's suppose Alice plays a round off the top of the shoe, using some strategy; and Bob plays a round after first burning a card off the top of the shoe, using some strategy. Let E[A] be the expected value of Alice's round, and E[B] be the expected value of Bob's round.

    Then by "the sum must equal zero if and only if we apply the same fixed strategy for each removal," you are claiming that both of the following statements are true:

    1. If Alice and Bob play their respective rounds using the same strategy, then the average EOR must be zero, i.e., E[B]-E[A]==0.

    2. If the average EOR is zero, i.e., E[B]-E[A]==0, then Alice and Bob must be playing their respective rounds using the same strategy. (Or the logically equivalent contrapositive: if Alice and Bob play different strategies, then the average EOR must be non-zero.)

    I agree with (1), but (2) is false. I'll refer again to the linked blog post for several concrete examples... but those are admittedly simplified examples, using a game of "high card wins" to demonstrate the fundamental idea without the unnecessary complexity of the particular game of blackjack.

    But if we want to focus on blackjack, then following is the simplest counterexample I can think of: consider a shoe with nothing but 6s, and suppose that Alice plays a mimic the dealer strategy, i.e., hit once then stand on 18, while Bob splits and resplits at every opportunity, only falling back to mimic the dealer after reaching the maximum number of split hands. Then E[A]=E[B]=E[B]-E[A]=0, but Alice and Bob are not playing the same fixed strategy.

  12. #38


    Did you find this post helpful? Yes | No
    Quote Originally Posted by ericfarmer View Post
    For a specific and relatively recent example where this test helped me find an issue in my CA, consider the shoe (6, 6, 1, 5, 8, 2, 5, 9, 2, 34), i.e. 6 aces, 34 tens, etc., S17, DOA, DAS, SPL1, played using CDZ- strategy (for that depleted shoe). My CA used to report 5.327%, but after some EOR-ish testing I found and fixed a problem in v7.5 so that it now reports 5.261%. (The latter agrees with MGP's CA, and interestingly, k_c's online CA agrees with the former, suggesting that we were likely doing something very similar in our code. The issue has to do with "when" to correct the computed expected return of standing on ten-ace to account for the 3:2 blackjack payoff.)
    Hi Eric,

    I can't speak for anyone else but my CA does not compute CDZ- for depleted shoes. It only has CDZ- (or CDP1) option to apply full shoe basic strategy to depleted shoes. So 5.327% displayed is using CDP1 strategy which I refer to as "optimal." If basic strategy option is chosen then display for this depleted shoe using CDZ- full shoe basic strategy is 3.062%. If basic strategy option is chosen and instead of CDZ- CDP1 full shoe basic strategy is chosen 3.062% is also displayed. In order to be able to input enough tens I input 3 for number of decks so basic strategy values are relative to 3 decks.

    The "optimal" value using CDP1 would apply regardless of number of decks input which is what determines the starting composition. For depleted shoes you may have to trick the CA by inputting a number of decks large enough to accommodate your desired input because it is programmed so as not to allow impossible values given number of decks but again CDZ- is not an option to apply to depleted shoes, only CDP1.

    Regards,
    k_c
    "Perfection is the enemy of success."
    -Elon Musk-

  13. #39


    Did you find this post helpful? Yes | No
    Quote Originally Posted by k_c View Post
    I can't speak for anyone else but my CA does not compute CDZ- for depleted shoes. It only has CDZ- (or CDP1) option to apply full shoe basic strategy to depleted shoes. So 5.327% displayed is using CDP1 strategy which I refer to as "optimal."
    Ah, I see, I misunderstood the interface. The "Depleted shoe split strat" (my emphasis) and grayed out selection make more sense now, thanks.

Page 3 of 13 FirstFirst 12345 ... LastLast

Similar Threads

  1. Incorrect Strategy Errors CVBJ
    By jmeezy in forum Software
    Replies: 1
    Last Post: 04-20-2020, 12:04 PM
  2. Help on Uk casino algorithms.
    By smallville1979 in forum Software
    Replies: 2
    Last Post: 02-06-2018, 11:34 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.