ajemeister
ajemeister
Joined: Mar 20, 2012
  • Threads: 16
  • Posts: 208
December 11th, 2015 at 12:16:39 PM permalink
So i'm in the early stages of writing an educational blackjack/video poker app for myself and I had run into a bit of an issue with shuffle processes. As part of the learning process I like to make things as realistic as possible, so I came up with three processes for shuffling but there could be more? Please let me know if I have any of these processes wrong, as most of the reason I'm programming this is to learn the process of each shuffle for myself, even if it doesn't build any value into the app

Hand Shuffle -
Divide remaining card pile after cut card into approximate thirds, insert first 1/3 into bottom of discard pile, second into middle and third into top. Divide in approximate half. Divide in approximate thirds. Grab small pile 10-20 cards from each pile for each half and riffle shuffle twice. Repeat until shoe is finished. Break shoe in half and repeat 1 more time. Insert cut card and move bottom half of cut to top. re-insert or precalculate a new shuffle cut card

Automatic Shuffle -
(not really sure about this one as they seem to be more like black boxes.. anyone with input I'd appreciate learning the process)
(either for continuous shuffler or for regular finished shoe auto shuffler)
probably going to be a combination of above and below. Longer process with a more thorough shuffling to be sure cards don't get clumped together.

Random Shuffle-
(use for video poker or something where a quick shuffle is needed)
Create empty shoe of the same size as current shoe. Move card at random index in current shoe to another random index in new shoe. Loop until all cards have been moved. Cards can only move into a non-full position in the new shoe and we won't move cards from the old shoe that were already moved.
MathExtremist
MathExtremist
Joined: Aug 31, 2010
  • Threads: 88
  • Posts: 6526
December 11th, 2015 at 2:00:07 PM permalink
Start here: https://en.m.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
Dieter
Administrator
Dieter 
Joined: Jul 23, 2014
  • Threads: 8
  • Posts: 2151
December 12th, 2015 at 4:11:33 AM permalink
Quote: ajemeister


Hand Shuffle -
Divide remaining card pile after cut card into approximate thirds, insert first 1/3 into bottom of discard pile, second into middle and third into top. Divide in approximate half. Divide in approximate thirds. Grab small pile 10-20 cards from each pile for each half and riffle shuffle twice. Repeat until shoe is finished. Break shoe in half and repeat 1 more time. Insert cut card and move bottom half of cut to top. re-insert or precalculate a new shuffle cut card



That's not an awful description, but I can tell you're not used to talking about shuffles.

The first part - slugging the remainder of the deck into the discards - is not part of the shuffle. If you're going to simulate that, keep it separate. (Why? Because at least once, it won't be needed.) Same with "inserting the cut card" - that's not part of the shuffle. (That's done after the shuffle.)

You're not terribly specific about which grabs come from which piles, and the order they get stacked. Shuffle procedures are extremely specific about this.

There are a whole lot of other ways to shuffle a deck of cards. (I use "deck" to describe the set of cards used for a game, and "pack" to describe the 54 card set that comes from the manufacturer (excluding premium cards, but including jokers. The most common use of "deck" is a 52 card set; the jokers having been removed from the pack to form the deck... as is used in cribbage, and commonly for poker. A deck can also be formed from several packs (or partial packs) of cards.)

I think you should be looking for something like the Shuffle Tracker's Cookbook as a starting point.


On "automatic shuffles" - modern elevator shuffle machines implement a physical version of the Fisher-Yates shuffle.

Random shuffle - please look up the Fisher-Yates shuffle.


Now, that said... the only real reason to simulate a shuffle other than Fisher-Yates is to look for an advantage to be gained from weaknesses in a shuffle.

And you'll probably want to start looking into Persi Diaconis' research.
May the cards fall in your favor.
ajemeister
ajemeister
Joined: Mar 20, 2012
  • Threads: 16
  • Posts: 208
December 14th, 2015 at 7:54:26 AM permalink
thanks everyone! going to look into the fisher-yates shuffle to save memory space. Still doing some research online for a common hand shuffle process. Had to take a quick trip to AC to do some research this weekend :)

Unfortunately I still don't have it down yet. I guess i'll have to look more into the creation of the 6 piles and order you take off the top. I'll try looking into the shuffle tracker's cookbook if I can find a preview on google somewhere, but not looking to spend $50.

  • Jump to: