Nareed
Nareed
  • Threads: 373
  • Posts: 11413
Joined: Nov 11, 2009
September 14th, 2010 at 7:07:48 AM permalink
A deck of cards comes out of the factory in order by suit. Let's call that state of the deck the zero entropy state.

When you shuffle the deck, you destroy that state and enter one in which some cards will retain their former order and some won't. That's a low entropy state. More shfflings bring more movements and progressively higher entropy states.

Two questions:

Is it possible to calculate how many times a deck needs to be shuffled so that no card is next to the card it was next to when the deck was new? (ie the deuce of spades won't be next to the three of spades and so on) Which would be the deck's state of maximum entropy (and of course there are several such states)

Second, is it possible if you keep randomly shuffling the cards for the deck to regress to its original zero entropy state? from a purely probabilistic point of view, it should be very hard. After all there are millions of entropy states from low to maximum, but only one zero entropy state.

Discuss.
Donald Trump is a fucking criminal
DJTeddyBear
DJTeddyBear
  • Threads: 207
  • Posts: 10992
Joined: Nov 2, 2009
September 14th, 2010 at 7:51:53 AM permalink
The Wiz answered a similar question here, at the middle of the page: https://wizardofodds.com/ask-the-wizard/probability/
Quote:

What are the odds a deck could be shuffled back into starting order, with either a totally random shuffling method or with a perfect rifiling shuffle, and how many times would it take? - Andrew from Pewaukee,WI

The probability of a random shuffle resulting in starting order is 1 in 52!, or 1 in 8.06582*10^67. If you did a perfect shuffle, in which last card was the first to come down, thus remaining last, it would only take 8 shuffles to be back to the starting order. If the 26th card was the first two come down then it would take 72 shuffles to back to the starting order.

The '8 shuffles' is interesting. I couldn't find the reference, but it's faily well known that a deck should be shuffled at least 3 times, but never more than 7.

FYI: The '72' is a typo. It's easy to simulate it in Excel: You need 52 perfect shuffles to return a deck to where it was. It is equally simple to use Excel to show that you need only 8 'perfect' shuffles, where the top and bottom stay at the top and bottom, to return it to where it was.
Here: Admin note: removed link to www.djteddybear.com/shuffle.xlswww.djteddybear.com/shuffle.xls
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
Nareed
Nareed
  • Threads: 373
  • Posts: 11413
Joined: Nov 11, 2009
September 14th, 2010 at 8:20:12 AM permalink
Interesting.

I assume a perfect shuffle is one where exactly 26 cards are on each stack, and one card interleaves with another every time. Of course that would be easy to do if you did it slowly. Cound the cards carefulley, then place one card from each stack on top of a card in the other stack. It's still shuffling.

But I said random shuffle, which is the more common type. The Wizard gives that very low odds.

I read an article on entropy in an old Scientific American magazine the other day. It got me thinking of a more controlled type of entropy thought experiment than the spontaneaous unmixing of cream and coffee.
Donald Trump is a fucking criminal
ChesterDog
ChesterDog
  • Threads: 8
  • Posts: 1511
Joined: Jul 26, 2010
September 15th, 2010 at 6:24:33 AM permalink
Here is a simpler question regarding shuffles: How many different permutations of cards can be reached with one shuffle? Consider only a riffle shuffle, coarse, fine, or anywhere in between. (By the way, the coarsest shuffle would leave the deck in the original arrangement.)
DJTeddyBear
DJTeddyBear
  • Threads: 207
  • Posts: 10992
Joined: Nov 2, 2009
September 15th, 2010 at 7:35:37 AM permalink
Quote: Nareed

I assume a perfect shuffle is one where exactly 26 cards are on each stack, and one card interleaves with another every time. Of course that would be easy to do if you did it slowly. Cound the cards carefulley, then place one card from each stack on top of a card in the other stack. It's still shuffling.

I know. That's what's simulated in my Excel document.

Quote: Nareed

But I said random shuffle, which is the more common type.

Yeah, I know. I can't wrap my head around it. The math on that one is way too hard.



By the way, ever see or own one of these?

I own one. You just put stacks on each side and a motor moves the top card to the middle. You'd think that, if you cut exactly 26 cards, you'd get perfect shuffles.

Nothing could be further from the truth.

The cards colide casuing unpredictable results.

Not only does it sometimes push multiple cards in a row from one side, it also sometimes pushes multiple cards at once. I.E. Sometimes the multiple cards get a reverse sequence, sometimes not!

I'd use it more often if it wasn't so damn noisy!
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
Nareed
Nareed
  • Threads: 373
  • Posts: 11413
Joined: Nov 11, 2009
September 15th, 2010 at 7:41:28 AM permalink
Quote: DJTeddyBear

The cards colide casuing unpredictable results.

Not only does it sometimes push multiple cards in a row from one side, it also sometimes pushes multiple cards at once. I.E. Sometimes the multiple cards get a reverse sequence, sometimes not!



I've seen them in stores, but not in operation. I don't play cards enough at home to justify getting one, either.

I'm not surprised, though. I've worked with bill counting machines and they're fickle, too. They can take multiple bills and jam, detect half bills that are whole, flag false bills that are legitimate, etc etc etc.

I am surprised the automated shufflers at casinos don't jam or malfunction often. I suppose it helps that the cards are changed frequently, before they are too worn to start causing lots of problems. A brick of freshly printed bills goes through a counting machine without any trouble at all.
Donald Trump is a fucking criminal
DJTeddyBear
DJTeddyBear
  • Threads: 207
  • Posts: 10992
Joined: Nov 2, 2009
September 15th, 2010 at 7:49:13 AM permalink
Quote: Nareed

I am surprised the automated shufflers at casinos don't jam or malfunction often.

They occasionally do.

But you gotta remember that the $6 piece of plastic you get at the gift shop isn't like the tank that ShuffleMaster builds.


By the way, I updated the Excel document to show cards rather than numbers: Admin note: removed link to www.djteddybear.com/shuffle.xlswww.djteddybear.com/shuffle.xls
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
Nareed
Nareed
  • Threads: 373
  • Posts: 11413
Joined: Nov 11, 2009
September 15th, 2010 at 7:57:36 AM permalink
Quote: DJTeddyBear

They occasionally do.



Eventually everything does.

Quote:

But you gotta remember that the $6 piece of plastic you get at the gift shop isn't like the tank that ShuffleMaster builds.



Sure. But the $300 bill counting machine ought to be able to count a brick of every denomination without a hitch, barring defective bills, at least 90% of the time.

BTW the feature for detecting counterfit bills is not worth paying for. Not because of the many false positives, but because it failed to detect counterfits we fed it while testing. It did catch the B&W photocopy on plain bond paper, but not the color copy on plain bond paper.

Quote:

By the way, I updated the Excel document to show cards rather than numbers: Admin note: removed link to www.djteddybear.com/shuffle.xlswww.djteddybear.com/shuffle.xls



Very nice.
Donald Trump is a fucking criminal
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
September 15th, 2010 at 8:11:29 AM permalink
Shuffling math has been heavily researched.
See Persi Diaconis' paper on perfect (non-random) shuffles:
http://www-stat.stanford.edu/~cgates/PERSI/papers/83_05_shuffles.pdf
also http://mathworld.wolfram.com/RiffleShuffle.html

On the other hand, if you have a purely random shuffle, the probability of what you're calling zero-entropy is constant after every shuffle at 1/52!. You seem to be using different meanings for "shuffle" in your original post, at first talking about riffle shuffles but later referring to random shuffling. So you'll need to be more specific. If you do a perfect muck (random) shuffle, you don't necessarily increase the entropy with each successive shuffle because each deck permutation is equally likely. If you riffle-shuffle, then you're talking about the topic of the URLs above. That's a very different question.

As to your first question, the answer is 1 if you do a perfect riffle shuffle. I'll have to get back to you on the random shuffle answer.
"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
  • Jump to: