You are Here:
The amount of possible sequences of the cards in a deck

Author (Read 3024 times)

The amount of possible sequences of the cards in a deck
« on: January 09, 2014, 09:47:16 AM »
 

MagikFingerz

  • Forum Regular
  • *
  • 109
    Posts
  • Reputation: 18
I'm watching through all of QI (or as much of it as there is on youtube) and this part came up. I thought it was, as you might expect, quite interesting, so I thought I'd share.

http://youtu.be/RkD8RJrmIoI?t=39m11s
- Tom
 

Re: The amount of possible sequences of the cards in a deck
« Reply #1 on: January 09, 2014, 10:48:14 AM »
 

Lee Asher

  • CardStar
  • Administrator
  • Frequent Flyer
  • *
  • 798
    Posts
  • Reputation: 204
  • Is this thing on?

  • Skype:

  • Twitter:
Wonderful. The explanation was spot-on, and his table faro was pretty solid!

Thanks for sharing this Tom.
 

Re: The amount of possible sequences of the cards in a deck
« Reply #2 on: January 09, 2014, 12:02:44 PM »
 

52plusjoker

  • Frequent Flyer
  • *
  • 887
    Posts
  • Reputation: 49
That's a great little vignette - I'd have guessed a lower number without doing the multiplication!
Tom Dawson
52 Plus Joker Playing Card Collectors Club
 

Re: The amount of possible sequences of the cards in a deck
« Reply #3 on: January 09, 2014, 01:30:47 PM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
That's a great little vignette - I'd have guessed a lower number without doing the multiplication!

Most people don't have a proper clue about how huge the number of possible orderings of playing cards in a deck is.  If you included two jokers, as some games are played with both, that number would be 2,862 times larger than it is...  Using just one joker, it's only 53 times greater.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #4 on: January 09, 2014, 11:48:20 PM »
 

PurpleIce

  • 52 Plus Joker Member
  • Discourse Royalty
  • *
  • 485
    Posts
  • Reputation: 23
I hope i don't sound nerdy, but that's so cool!

I guess its just one of those stuff that we do everyday but never really put a thought to it.

That's a great little vignette - I'd have guessed a lower number without doing the multiplication!

I did not believe the number so I tried on my regular calculator and it would not let me multiply after (X48)
 

Re: The amount of possible sequences of the cards in a deck
« Reply #5 on: January 10, 2014, 12:38:57 AM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:

I did not believe the number so I tried on my regular calculator and it would not let me multiply after (X48)

For that kind of calculation, short of doing the work by hand, you'd need Mathematica by Wolfram Alpha.  It's a high-level math program that can handle the vast majority of math problems you can throw at it.  Pretend your graphing calculator mated with Deep Blue, and this would be their baby.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #6 on: January 10, 2014, 05:44:12 AM »
 

splice42

  • True Member
  • *
  • 48
    Posts
  • Reputation: 1
For that kind of calculation, short of doing the work by hand, you'd need Mathematica by Wolfram Alpha.

You can also use their web knowledge engine, which is pretty amazing.

http://www.wolframalpha.com/input/?i=52%21

It also tells you the proper wording of the number, or at least part of it: it's about 80 unvigintillion (8 with 67 zeroes after it).
 

Re: The amount of possible sequences of the cards in a deck
« Reply #7 on: January 10, 2014, 08:39:12 AM »
 

John B.

  • Don't you have work you should be doing? We are watching you.
  • Jack of Diamonds
  • *
  • 1,916
    Posts
  • Reputation: 49

  • YouTube:
just because there are that many choices does not mean every shuffle will be different. you do have a chance of getting an order hit before. Its like flipping a coin. Every time you flip it in could be heads or tails.
Do you guys even read this? Like I could have the meaning of life here and I doubt you would know it.
 

Re: The amount of possible sequences of the cards in a deck
« Reply #8 on: January 10, 2014, 01:01:46 PM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
Below, I've included a more precise number, and that number's full name.

just because there are that many choices does not mean every shuffle will be different. you do have a chance of getting an order hit before. Its like flipping a coin. Every time you flip it in could be heads or tails.

While it is indeed true that you could hit a repeat if you are not putting the deck in a specific order to start with, the fact remains that it's statistically a near-impossibliity.  You would likely have a better chance of winning the Powerball lottery grand prize for two straight drawings.  The odds against are huge to the point of stultifying.  In fact, you'd probably have a better chance of two people losing a coin toss with a 2013 US quarter - one bets head, the other bets tails and the coin lands on a hard surface on its edge, remaining in that state.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #9 on: January 10, 2014, 01:10:04 PM »
 

splice42

  • True Member
  • *
  • 48
    Posts
  • Reputation: 1
In fact, you'd probably have a better chance of two people losing a coin toss with a 2013 US quarter - one bets head, the other bets tails and the coin lands on a hard surface on its edge, remaining in that state.

I'm not sure about a quarter, but a nickel has been calculated to land on its side 1 out of 6000 tosses (not flips) (approximate).

http://adsabs.harvard.edu/abs/1993PhRvE..48.2547M
« Last Edit: January 10, 2014, 01:10:28 PM by splice42 »
 

Re: The amount of possible sequences of the cards in a deck
« Reply #10 on: January 10, 2014, 01:54:37 PM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
In fact, you'd probably have a better chance of two people losing a coin toss with a 2013 US quarter - one bets head, the other bets tails and the coin lands on a hard surface on its edge, remaining in that state.

I'm not sure about a quarter, but a nickel has been calculated to land on its side 1 out of 6000 tosses (not flips) (approximate).

http://adsabs.harvard.edu/abs/1993PhRvE..48.2547M

A traditional coin toss is either flipping the coin in the air, catching it in your hand, flipping the coin onto the back of the opposing hand and reading the result OR flipping the coin in the air and letting it land on a hard surface, such as a table, the floor, the sidewalk, etc.  Nickels aren't of the same design - they have a wide, smooth edge and a lower center of gravity.  And I did mention it was a QUARTER, right?  Not a nickle.

The point being, it's not impossible to shuffle the deck the same way twice in your lifetime, but the odds of that occurring makes it a statistical impossibility, in that the chances are infinitesimal.

Even the most avid magician, cardist or card playing likely doesn't shuffle a deck more than a thousand times a day - not without having a raging case of carpal tunnel syndrome.  But let's assume that you could and do just that.

That adds up to:
365,000 shuffles a year (we'll pretend there's no leap years, for simplicity).
3,650,000 a decade.
365,000,000 over the course of a 100-year lifespan.

Now look at the number below.  That number I'll call X for the moment.
You have X:1 odds of hitting the same shuffle twice in the course of that entire 100-year lifespan.  Don't forget the bit at the end: "x 10^59", or ten to the fifty-ninth power.
« Last Edit: January 10, 2014, 02:01:21 PM by Don Boyer »
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #11 on: January 11, 2014, 03:45:45 AM »
 

th4mo

  • Junior Member
  • *
  • 22
    Posts
  • Reputation: 2
In fact, you'd probably have a better chance of two people losing a coin toss with a 2013 US quarter - one bets head, the other bets tails and the coin lands on a hard surface on its edge, remaining in that state.

I'm not sure about a quarter, but a nickel has been calculated to land on its side 1 out of 6000 tosses (not flips) (approximate).

http://adsabs.harvard.edu/abs/1993PhRvE..48.2547M

A traditional coin toss is either flipping the coin in the air, catching it in your hand, flipping the coin onto the back of the opposing hand and reading the result OR flipping the coin in the air and letting it land on a hard surface, such as a table, the floor, the sidewalk, etc.  Nickels aren't of the same design - they have a wide, smooth edge and a lower center of gravity.  And I did mention it was a QUARTER, right?  Not a nickle.

The point being, it's not impossible to shuffle the deck the same way twice in your lifetime, but the odds of that occurring makes it a statistical impossibility, in that the chances are infinitesimal.

Even the most avid magician, cardist or card playing likely doesn't shuffle a deck more than a thousand times a day - not without having a raging case of carpal tunnel syndrome.  But let's assume that you could and do just that.

That adds up to:
365,000 shuffles a year (we'll pretend there's no leap years, for simplicity).
3,650,000 a decade.
365,000,000 over the course of a 100-year lifespan.

Now look at the number below.  That number I'll call X for the moment.
You have X:1 odds of hitting the same shuffle twice in the course of that entire 100-year lifespan.  Don't forget the bit at the end: "x 10^59", or ten to the fifty-ninth power.

Nice explanation! It's implied in your example that the one same (evidently indestructible) deck of cards is used throughout the 100 year lifespan.
But what if you always start with a deck where the cards are in the exact same order to begin with? Say, the order of a standard deck of Bicycle cards when it is first opened?
If you took every deck of bicycles, for however long they have been packaging their cards in the same order, that has ever been opened (I'll let you calculate what that number might be)
and then shuffle each of those decks only FOUR times (as he does in the video), i bet you might get more than a few repeated sequences.

Now, I won't claim that he started with a brand new unshuffled deck, since he flashes the four of spades on the bottom before he starts shuffling. But i would wager that it takes shuffling any new deck more than four times to achieve the full range of values of 52 factorial.... 
just sayin'... ;D

Edit: Couldn't resist googling this myself, and apparently people much better at math then myself have determined that 7 shuffles is the minimum number to "approach" true randomness.
And this is only true for "good" shuffling methods...  One author says quote "By the way, the overhand shuffle is a really bad way to mix cards: it takes about 2500 overhand shuffles to randomize a deck of 52 cards!"
The reason for this has to do NOT with the total possible number of permutations, but with the number of "rising sequences in the permutation"...
Here's a link to the full math explanation for those of you who can handle it (Not me!)
http://www.dartmouth.edu/~chance/teaching_aids/Mann.pdf
« Last Edit: January 11, 2014, 03:59:03 AM by th4mo »
 

Re: The amount of possible sequences of the cards in a deck
« Reply #12 on: January 11, 2014, 06:05:38 AM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:

Nice explanation! It's implied in your example that the one same (evidently indestructible) deck of cards is used throughout the 100 year lifespan.
But what if you always start with a deck where the cards are in the exact same order to begin with? Say, the order of a standard deck of Bicycle cards when it is first opened?
If you took every deck of bicycles, for however long they have been packaging their cards in the same order, that has ever been opened (I'll let you calculate what that number might be)
and then shuffle each of those decks only FOUR times (as he does in the video), i bet you might get more than a few repeated sequences.

Now, I won't claim that he started with a brand new unshuffled deck, since he flashes the four of spades on the bottom before he starts shuffling. But i would wager that it takes shuffling any new deck more than four times to achieve the full range of values of 52 factorial.... 
just sayin'... ;D

Edit: Couldn't resist googling this myself, and apparently people much better at math then myself have determined that 7 shuffles is the minimum number to "approach" true randomness.
And this is only true for "good" shuffling methods...  One author says quote "By the way, the overhand shuffle is a really bad way to mix cards: it takes about 2500 overhand shuffles to randomize a deck of 52 cards!"
The reason for this has to do NOT with the total possible number of permutations, but with the number of "rising sequences in the permutation"...
Here's a link to the full math explanation for those of you who can handle it (Not me!)
http://www.dartmouth.edu/~chance/teaching_aids/Mann.pdf

Actually, there's no such implication at all.  It need not be the same deck with every shuffle.

It doesn't matter the condition in which the deck started.  You could reorder the deck every single time to "factory-fresh" order, but as long as you completely randomize the deck, the odds of repeating a previous shuffle are still the same.

And to my knowledge, Professor/Magician Persi Diaconis of Stamford University was the first to discover that a deck required at least seven thorough riffle shuffles in order to be randomized, preferably more.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #13 on: January 12, 2014, 07:30:05 PM »
 

th4mo

  • Junior Member
  • *
  • 22
    Posts
  • Reputation: 2

Nice explanation! It's implied in your example that the one same (evidently indestructible) deck of cards is used throughout the 100 year lifespan.
But what if you always start with a deck where the cards are in the exact same order to begin with? Say, the order of a standard deck of Bicycle cards when it is first opened?
If you took every deck of bicycles, for however long they have been packaging their cards in the same order, that has ever been opened (I'll let you calculate what that number might be)
and then shuffle each of those decks only FOUR times (as he does in the video), i bet you might get more than a few repeated sequences.

Now, I won't claim that he started with a brand new unshuffled deck, since he flashes the four of spades on the bottom before he starts shuffling. But i would wager that it takes shuffling any new deck more than four times to achieve the full range of values of 52 factorial.... 
just sayin'... ;D

Edit: Couldn't resist googling this myself, and apparently people much better at math then myself have determined that 7 shuffles is the minimum number to "approach" true randomness.
And this is only true for "good" shuffling methods...  One author says quote "By the way, the overhand shuffle is a really bad way to mix cards: it takes about 2500 overhand shuffles to randomize a deck of 52 cards!"
The reason for this has to do NOT with the total possible number of permutations, but with the number of "rising sequences in the permutation"...
Here's a link to the full math explanation for those of you who can handle it (Not me!)
http://www.dartmouth.edu/~chance/teaching_aids/Mann.pdf

Actually, there's no such implication at all.  It need not be the same deck with every shuffle.

Well, when you say "shuffle a deck more than a thousand times a day" i kind of think it does imply shuffling the same deck over and over, whether you meant it that way or not. I'm sure you'll be quick to correct me, but assumptions will be made by your audience if you don't stipulate, and it's always easier to "clarify" after the fact. In any case, that's not the point...
 
My point was that one cannot say that "no two shuffled decks in the history of cards have ever been in the same order". Which is actually a subtly different point from what they said in the video.
I still say that if you always start with the "new deck sequence" and you shuffle only four times, and you repeat this process millions of times, it is probable that you will have some non-unique sequences.

It doesn't matter the condition in which the deck started.  You could reorder the deck every single time to "factory-fresh" order, but as long as you completely randomize the deck, the odds of repeating a previous shuffle are still the same.

You say it doesn't matter what order the deck starts in as long "as you completely randomize the deck", which you later say requires at least seven shuffles...?
So in other words... it does matter what order the deck starts in, if you are only shuffling it four times...  ;)

All I am trying to say boils down to just this: "I bet most people who open a new deck of cards don't shuffle it well enough the first time to achieve a truly random permutation...i.e. seven times or more...".

And to my knowledge, Professor/Magician Persi Diaconis of Stamford University was the first to discover that a deck required at least seven thorough riffle shuffles in order to be randomized, preferably more.

Yes, Diaconis. The link I included refers to the analysis by Bayer and Diaconis on the first page, and is an extensive exposition of the math involved. It's kind of fun to try to follow along...
And while 7 is Diaconis' preferred number of shuffles, he does claim that as few as 4 may be enough for games like blackjack where the suits are inconsequential. Other mathematicians have come up with even higher numbers of shuffles than 7, based on different ways of measuring and quantifying "randomness".

Cheers!
 

Re: The amount of possible sequences of the cards in a deck
« Reply #14 on: January 12, 2014, 10:08:12 PM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:

Well, when you say "shuffle a deck more than a thousand times a day" i kind of think it does imply shuffling the same deck over and over, whether you meant it that way or not. I'm sure you'll be quick to correct me, but assumptions will be made by your audience if you don't stipulate, and it's always easier to "clarify" after the fact. In any case, that's not the point...
 
My point was that one cannot say that "no two shuffled decks in the history of cards have ever been in the same order". Which is actually a subtly different point from what they said in the video.
I still say that if you always start with the "new deck sequence" and you shuffle only four times, and you repeat this process millions of times, it is probable that you will have some non-unique sequences.

If you tell me you've eaten a candy bar 500 times since you were born, was it the same candy bar all five hundred times?  Don't be ridiculous - of course a single deck isn't going to survive that many shuffles.

To date, approximately 108 billion people have lived on the Earth.  Let's almost double that, to 200 billion.  Let's assume each and every person, even those born before the invention of playing cards, had a pack or two of playing cards lying around at all times and shuffled a deck for grand total over the course of a lifetime some ridiculous number number of times, let's say one trillion times.  It's an insanely big number, right?

That's 200 sextillion times, a.k.a. 2 times 1023 times, a.k.a. 200,000,000,000,000,000,000,000 times.

That means all of humanity since the dawn of time has only seen a little less than 2.4795999 * 10-43 percent of the possible combinations of shuffles.  Here's another way of seeing that number.

0.00000000000000000000000000000000000000000024795999%

The chance that any two shuffles generated the same combination randomly over the course of the life span of all of humanity has a percent chance SMALLER than that number.  Not the kind of odds I'd want my life hanging on...

Shuffling a deck fewer than four times and starting from a specific order every time is NOT randomizing the deck.

It doesn't matter the condition in which the deck started.  You could reorder the deck every single time to "factory-fresh" order, but as long as you completely randomize the deck, the odds of repeating a previous shuffle are still the same.

You say it doesn't matter what order the deck starts in as long "as you completely randomize the deck", which you later say requires at least seven shuffles...?
So in other words... it does matter what order the deck starts in, if you are only shuffling it four times...  ;)

All I am trying to say boils down to just this: "I bet most people who open a new deck of cards don't shuffle it well enough the first time to achieve a truly random permutation...i.e. seven times or more...".

Very true.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: The amount of possible sequences of the cards in a deck
« Reply #15 on: January 13, 2014, 05:47:50 AM »
 

th4mo

  • Junior Member
  • *
  • 22
    Posts
  • Reputation: 2
Shuffling a deck fewer than four times and starting from a specific order every time is NOT randomizing the deck.

Glad you took the time to actually read my post before spewing zeros at me... because this is what i've been saying the whole time!  ;D
 

Re: The amount of possible sequences of the cards in a deck
« Reply #16 on: January 13, 2014, 09:27:27 AM »
 

Lee Asher

  • CardStar
  • Administrator
  • Frequent Flyer
  • *
  • 798
    Posts
  • Reputation: 204
  • Is this thing on?

  • Skype:

  • Twitter:
That's 200 sextillion times, a.k.a. 2 times 1023 times, a.k.a. 200,000,000,000,000,000,000,000 times.

Seems like my father-in-law's wifi WEPA code!
 

Re: The amount of possible sequences of the cards in a deck
« Reply #17 on: January 13, 2014, 01:22:46 PM »
 

yoel

  • Forum Regular
  • *
  • 109
    Posts
  • Reputation: 1
Don't be ridiculous - of course a single deck isn't going to survive that many shuffles.


Maybe KEM cards could?