Page 1 of 4 123 ... LastLast
Results 1 to 13 of 43

Thread: Javascript simulation with graphs

  1. #1
    Member BackCounter's Avatar
    Join Date
    Dec 2023
    Location
    Northern California
    Posts
    30


    Did you find this post helpful? Yes | No

    Question Javascript simulation with graphs

    Hello; I have some information for the general community, and some questions for Don Schlesinger, if I may. I had wanted to see if I could calculate basic strategy so that I could actually see what was happening under the hood. (I do not know how software like CV does it.) I used javascript because 1) I already know how, and 2) it is very well suited for graphic output via html. The main problem is that it is relatively slow. I calculated win rates for each hand using each applicable action (hit, stand, double, split, surrender), which takes the better part of an hour for 1,000,000 sims of each hand/upcard/action combination (5,000,000 would be better). I did this for a range of counts, then created graphs for each hand that show the win rates vs. count for each action. You can see the relative return for each action, and more importantly, where the win rates cross over indicating the index for a departure from basic strategy.

    Then I ran sims to determine the count frequency for a given system and number of decks, and the hand frequency for each count using the strategy determined by the win rates for that count. (Everything is specific to the count, and rules etc.) Combine this with the
    bet ramp and you have win rate * hand frequency * count frequency * units bet; sum this for each count and you get the actual advantage obtained from each hand. This information can be used to calculate “illustrious” indices. The same thing can be done for insurance, getting the odds of the dealer drawing a 10 on an ace for each count.

    Yet another sim calculates the real-life win rate for each hand, including player and dealer blackjacks, that are not used when doing strategy win rates. Adding all these * hand frequencies gives the overall player advantage for the game.

    I ran a complete sim using the parameters provided on page 57 of Blackjack Attack. I have attached some screenshots of the results. The colors for the graphs — green: hit; red: stand; blue: double; gold: split; black: surrender (-0.5); gray: baseline reference (0); cyan: hand frequency. There is a vertical line for the starting count, which in these examples was zero.

    My top 18 indices are similar, but not identical, to the illustrious 18 in the book. Some of my questions involve the following:

    I ran all the sims with a bailout count of zero, meaning that no data were obtained for counts that went negative. The bet ramp on page 4 implies that, but page 57 does not come out and say it. Also, I used counts up to 10 (0, 2, 4, 6, 10); I don’t know if that was the right way to do it either. A full set of data would include every possible count, but high counts take forever as decks with each count have to be found at random (I reused them a number of times, shuffling the cards still in the shoe by several means, or it could take 10x as long or more for high counts). I do not know if I could exactly duplicate the illustrious 18 if I used the right parameters. Also, I used the baseline rules (S17, no DAS, no HSA, no RSA, no surrender). [edited]

    Just wondering if there is any interest. What I have is a collection of html documents whose output needs to be combined and run together for the final result. And there is some hand-coding involved, and judgment about how many threads to run. (In other words, not ready for prime time any time soon).

    -BC

    graphs.jpg

    indices.jpg

    insurance.jpg

    count.png

    bs.jpg
    Last edited by BackCounter; 12-23-2023 at 08:28 AM. Reason: clarified baseline rules

  2. #2


    Did you find this post helpful? Yes | No
    A few comments: You may want to start by looking here: www.amazon.com/Hi-Lo-Card-Counting-System-Complete/dp/1944877622/ref=sr_1_1?crid=1385E9L17A44K&keywords=the+hi-lo+card+counting+system+a+complete+guide+to+index+ play&qid=1703302360&sprefix=The+Hi-Lo+Card+%2Caps%2C84&sr=8-1

    You've basically described the book that Dave Brolley and I published recently. Strongly suggest you have a look. All the methodology is described in the text that precedes the 330 charts plus all the indices.

    You never mentioned for how many decks your work was for!

    No matter the decks, there are two errors in the BS charts: You don't hit 12 vs. 4, and you don't double A,A vs. 6, no matter what game you're playing. So, something's wrong there. Nor is insurance advantageous at TC >=+2, which makes me wonder if, somehow, this wasn't single deck. But then the BS would have even more errors. So, it surely looks like a 6-deck game.

    Write back after you've had a look at the book, which I'm sure won't disappoint you.

    Don

  3. #3
    Member BackCounter's Avatar
    Join Date
    Dec 2023
    Location
    Northern California
    Posts
    30


    Did you find this post helpful? Yes | No
    I will. Had not seen any references to that one.
    Just a few points, the sim was 4 decks like the ones in the book. Insurance index is +3.
    I think the 12 vs. 4 is "noise" from only 1,000,000 sims; they even out better at 5,000,000.
    Doubling A,A vs. 6 is just included in case you can't split it (as indicated in the splits); I get this result consistently. That row is not included in most charts.

  4. #4


    Did you find this post helpful? Yes | No
    This is very interesting! If you can, please set up a website to better display the results. One thing I am not understanding is the baseline rules (S17, no DAS, HSA, DSA, or surrender) you mention above. I guess this is far off from the baseline of today’s games. What is HSA? DSA? Do you mean hit split aces, double split aces? At least I haven’t seen any of these rules in any casinos. I guess simulations need to serve the users here.
    Last edited by aceside; 12-23-2023 at 06:42 AM.

  5. #5


    Did you find this post helpful? Yes | No
    Quote Originally Posted by BackCounter View Post
    Doubling A,A vs. 6 is just included in case you can't split it (as indicated in the splits); I get this result consistently. That row is not included in most charts.
    For a hand A,A vs 6, you either split or stand. There is no such an option as double for you in whatever casinos. For each ace, you can only take one card. Just my thoughts.

  6. #6


    Did you find this post helpful? Yes | No
    Quote Originally Posted by aceside View Post
    For a hand A,A vs 6, you either split or stand. There is no such an option as double for you in whatever casinos. For each ace, you can only take one card. Just my thoughts.
    It is correct to double down A,A vs 6 if they don't allow splitting a pair of aces. But in which casino is it not allowed to split them? BTW, stand is not correct.

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

  7. #7
    Random number herder Norm's Avatar
    Join Date
    Dec 2011
    Location
    The mote in God's eye
    Posts
    12,473
    Blog Entries
    59


    Did you find this post helpful? Yes | No
    Quote Originally Posted by aceside View Post
    For a hand A,A vs 6, you either split or stand. There is no such an option as double for you in whatever casinos. For each ace, you can only take one card. Just my thoughts.
    There are so many variations:

    • Standard split and get one card each
    • Resplit aces
    • No splitting aces
    • Double after Splitting aces Allowed
    • Split and hit multiple times
    • Split and multiple draw, but ace is always = 11
    • Split and double on just the ace (I think at the Kewadin Casino)
    • Split and discard one of the hands
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  8. #8
    Member BackCounter's Avatar
    Join Date
    Dec 2023
    Location
    Northern California
    Posts
    30


    Did you find this post helpful? Yes | No
    Hello, and thank you everyone for the replies.

    These results are very preliminary; still working on the system. For example, when I run a straight sim without any constraints, I get a player advantage of -0.54641%, which is closer to what I expect than the sum of the individual advantages, -0.571%; I don't know why. Yet.

    To clarify the baseline rules, it is S17, no (DAS, HSA, RSA, or surrender). (DSA was a typo.) These are specified on page 492, and at least one other place I can't find at the moment. What I was trying to do is duplicate the conditions under which the illustrious 18 were generated, and this is my best guess.

    Maybe it is overinclusive, but the A,A vs. 6 win rates have double ahead of hit. So, IF one were in a place that did not allow resplitting aces, but did allow hitting them, doubling would be it. I included that row "because it's there."

    winRates.jpg

  9. #9


    Did you find this post helpful? Yes | No
    Quote Originally Posted by BackCounter View Post
    Insurance index is +3.
    Then why does it say 1.15% edge at +2? Or, is it because, weirdly, your TC bins are two counts wide, so +2 means from +2 to +4? You really need to fix that.

    Don

  10. #10


    Did you find this post helpful? Yes | No
    Quote Originally Posted by BackCounter View Post
    Maybe it is overinclusive, but the A,A vs. 6 win rates have double ahead of hit. So, IF one were in a place that did not allow resplitting aces, but did allow hitting them, doubling would be it. I included that row "because it's there."
    Yes, that's correct. See p. 432 of BJA3. Doubling is slightly better than hitting.

    Don

  11. #11
    Member BackCounter's Avatar
    Join Date
    Dec 2023
    Location
    Northern California
    Posts
    30


    Did you find this post helpful? Yes | No
    Quote Originally Posted by DSchles View Post
    Then why does it say 1.15% edge at +2? Or, is it because, weirdly, your TC bins are two counts wide, so +2 means from +2 to +4?
    Once again, I should clarify. I used 0, 2, 4, 6, and 10 as data points; each one took an hour or more. The graphs are interpolated between those points. The 1.15% edge is the overall player advantage for the game at a count of +2. Will flesh it all out some more at some point. It is a work in progress.

    Can you tell me if my assumptions about the i. 18 are correct? As in the baseline rules, and the bailout of zero?

  12. #12


    Did you find this post helpful? Yes | No
    There was no back counting for the I18, otherwise, how would you have had negative indexes? In a 4-deck game, you cannot show the insurance edge at +1.15% for TC = 0. Then you say the insurance index is +3. Huh?
    The rules were four decks, S17, NDAS.

    Don

  13. #13
    Member BackCounter's Avatar
    Join Date
    Dec 2023
    Location
    Northern California
    Posts
    30


    Did you find this post helpful? Yes | No
    Quote Originally Posted by DSchles View Post
    There was no back counting for the I18, otherwise, how would you have had negative indexes?
    That makes sense, thank you.

    The graph below insurance is the overall player advantage, the one used for calculating Kelly bets. It says at TC 0 the house has an advantage of 0.571%; at TC +2 the player has a 1.15% advantage.

    count advantage
    0-0.571%
    2 1.15%
    4 2.93%
    6 4.83%
    10 9.42%

Page 1 of 4 123 ... LastLast

Similar Threads

  1. simulation help?
    By Meistro123 in forum General Blackjack Forum
    Replies: 9
    Last Post: 05-24-2018, 02:28 PM
  2. Any JavaScript or JQuery gurus here?
    By DBJT in forum Software
    Replies: 4
    Last Post: 12-24-2013, 08:01 AM
  3. CVBJ Graphs ?
    By RS in forum General Blackjack Forum
    Replies: 3
    Last Post: 01-27-2013, 12:13 PM
  4. Norm Wattenberger: 21,890 graphs added to CVCX Online
    By Norm Wattenberger in forum Blackjack Main
    Replies: 2
    Last Post: 07-25-2005, 03:40 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.