See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 13 of 15

Thread: Fast Implementation for Simulation of Real Shuffles

  1. #1


    Did you find this post helpful? Yes | No

    Fast Implementation for Simulation of Real Shuffles

    Simulation of real shuffles is much more difficult than just randomizing the shoe using a robust Pseudo-RNG (no LCGs!!!) for two main reasons:

    a) It is computationally much more expensive to simulate "riffling", "plugging", "cutting", "stripping" because it involves inserting and deleting into an indexed sequence container (more details below)

    b) It is crucial to simulate shuffling errors such as imprecise slug grabs by the dealer, cards dropped on a riffle, imprecise plugging location in the shoe, because errors can have a significant impact on player's edge (i was always disturbed with the precision of certain advanced technique sims)

    The results will depend on the complexity of the shuffle, which includes the number of steps involved in the shuffle. So for instance for a 6D shoe, having 2 giant 156 card grabs riffled will be faster than making 39 deck grabs riffle and restack. For this example, the shuffle was as single pass shuffle: split 6D shoe into 2, 39 card grabs riffled, restacked, followed by cut. Speed results on AMD Ryzen 5950X (sorry Intel, our love-hate relationship has come to an end):

    100,000,000 real shuffles --> 1024 seconds
    100,000,000 random shuffles --> 28 seconds
    Chance favors the prepared mind

  2. #2
    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
    One of the most expensive areas in CVData is during the riffle. Typically, dealers drop one card 80% of the time, two cards 17%, 3 cards 3%, and rarely 4 cards. This is the default. Although, this can get worse in a cheap casino that doesn't change decks often. But, I believe some dealers tend to riffle less precisely at the end of the riffle because the angle of the thumb against the cards becomes more severe. Optionally, you can tune this effect, but it substantially adds to CPU time.
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  3. #3


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Norm View Post
    One of the most expensive areas in CVData is during the riffle. Typically, dealers drop one card 80% of the time, two cards 17%, 3 cards 3%, and rarely 4 cards. This is the default. Although, this can get worse in a cheap casino that doesn't change decks often. But, I believe some dealers tend to riffle less precisely at the end of the riffle because the angle of the thumb against the cards becomes more severe. Optionally, you can tune this effect, but it substantially adds to CPU time.
    Thanks Norm, I dont have that feature implemented but sounds interesting and indeed realistic. I have my checkbook next to my keyboard and notice the same thing when i riffle the checks, towards the end of the riffle more checks are dropped. How do you implement this? Do you change the distribution of cards dropped at a deep point in the grab?
    Chance favors the prepared mind

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


    2 out of 2 members found this post helpful. Did you find this post helpful? Yes | No
    For 1, 2, 3, 4 four cards dropped, you set percentages at the start and end of a riffle. It gradually changes the percentages during the riffle. There is also a match uneven grabs option. When set, the "dealer" will attempt to drop more cards from the larger pile throughout the riffle instead of just dropping a big leftover bunch of cards from the larger pile.

    Some of this probably makes little difference to a shuffle tracker, unlike grabs. It would to an ace sequencer. In any case, you are certainly correct that human dealers are not robots and that matters.
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  5. #5


    Did you find this post helpful? Yes | No
    Quote Originally Posted by iCountNTrack View Post
    Simulation of real shuffles is much more difficult than just randomizing the shoe using a robust Pseudo-RNG (no LCGs!!!) for two main reasons:

    a) It is computationally much more expensive to simulate "riffling", "plugging", "cutting", "stripping" because it involves inserting and deleting into an indexed sequence container (more details below)

    b) It is crucial to simulate shuffling errors such as imprecise slug grabs by the dealer, cards dropped on a riffle, imprecise plugging location in the shoe, because errors can have a significant impact on player's edge (i was always disturbed with the precision of certain advanced technique sims)

    The results will depend on the complexity of the shuffle, which includes the number of steps involved in the shuffle. So for instance for a 6D shoe, having 2 giant 156 card grabs riffled will be faster than making 39 deck grabs riffle and restack. For this example, the shuffle was as single pass shuffle: split 6D shoe into 2, 39 card grabs riffled, restacked, followed by cut. Speed results on AMD Ryzen 5950X (sorry Intel, our love-hate relationship has come to an end):

    100,000,000 real shuffles --> 1024 seconds
    100,000,000 random shuffles --> 28 seconds
    I agree. Just think about riffling.
    In the case of riffling we can say that there are 2 types (left and right) with their respective errors (grab errors and drop errors). In my code, I handle these errors with a function to which I pass both variables. If the drop error is set to 4, it means that between 0 and 4 cards can be dropped randomly. Same with grab errors. For instance: it is rare that a dealer would split 52 cards into 2 equal parts of 26. In this case I can set the grab error to 3. What does this mean? that the size of the grab could be between 23 and 29 cards randomly (26 +/- 3). If I set the error to zero, the grab would be exactly of 26 cards.
    The left riffle means that the bottom card of the left grab is going to be the first to land on the table.
    The right riffle means that the bottom card of the right grab is going to be the first to land on the table.
    This distinction is very important. A consistent dealer will always use one of these two. But it could happen that he alternates between one and the other.
    The same goes for plugging, cutting, and stripping.
    I would say that it is impossible for a dealer to perform a shuffle routine like a robot.

    Sincerely,
    Cac

  6. #6
    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
    Three maps of a simple, one pass R&R.

    First, a robot dealer
    Second 80% one drop, 17% 2 drop, grabs +/-6
    Third, a sloppy dealer

    dhh1.jpg

    dhh2.jpg

    dhh3.jpg
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  7. #7


    Did you find this post helpful? Yes | No
    Very interesting! In the second case, are the grabs even or uneven?

    Cac

  8. #8
    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
    Uneven. +/-6.
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  9. #9


    Did you find this post helpful? Yes | No
    È da un po' che ci provo, ma ho anche una domanda: nel caso numero 2 come sarebbe?

  10. #10


    Did you find this post helpful? Yes | No
    I regret not taking Spanish classes seriously
    Chance favors the prepared mind

  11. #11
    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
    Italian I think. But, don't know what it means even translated.
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  12. #12


    Did you find this post helpful? Yes | No
    Quote Originally Posted by iCountNTrack View Post
    I regret not taking Spanish classes seriously
    It's Italian.

    Cac

  13. #13


    Did you find this post helpful? Yes | No
    Translated: "I've been trying for a while, but I also have a question: in case number 2 what would it be like?"

Page 1 of 2 12 LastLast

Similar Threads

  1. Tried Blackjack for real in the real world for the first time...Help? :/
    By Blackjack Newbie in forum General Blackjack Forum
    Replies: 6
    Last Post: 10-09-2019, 08:37 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.