All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Perfect Shuffle (Posted on 2004-05-19)
You have a deck of 52 cards - for convenience, number them 1 through 52. You cut the cards into two equal halves and shuffle them perfectly. That is, the cards were in the order
1,2,3,...,52
and now they are
1,27,2,28,...,26,52. Let's call this a perfect in-shuffle.

If you repeat this in-shuffling process, how many in-shuffles will it take for the deck to return to its initial ordering (taking for granted that the cards will eventually do so)?
________________________

How does the solution change if you have a deck of 64 cards, or 10, or in general, n cards? For odd integer values of n, in-shuffling will take 1,2,3,...,n to 1,(n+3)/2,2,(n+5)/2,...,n,(n+1)/2. For example, when n=5, the first in-shuffle yields 1,4,2,5,3.

 No Solution Yet Submitted by SilverKnight Rating: 4.2500 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Cycle Notation Comment 20 of 20 |
I was just shuffling my cards today, when I suddenly thought of this particular puzzle.  I realized that this puzzle is vulnerable to cycle notation.  I have no idea whether this came up in previous comments.

Cycle notation is a way of notating different permutations.  For example, if 123456 changes to 214653, then the cycle notation would be (12)(346)(5).  I know I'm not explaining it very well, but you can figure out the rest.

So anyway, in cycle notation, you can tell how many cycles are in the permutation, and the length of each cycle.  Naturally, the number of in-shuffles required is the least common multiple (LCM) of each of the cycles' lengths.

So for a 52 card deck:

(1)(2,27,14,33,17,9,5,3)(4,28,40,46,49,25,13,7) (6,29,15,8,30,41,21,11)(12,32,42,47,24,38,45,23) (16,34,43,22,37,19,10,31)(18,35)(20,36,44,48,50,51,26,39)(52)

The lengths of each cycle are 1,8,8,8,8,8,2,8, and 1.  The LCM is 8.  It's funny how it all seems to reduce down to that.

I'm sure that someone with more time could derive a general equation from this, but I think it would get very messy very soon.

 Posted by Tristan on 2005-03-23 00:33:01

 Search: Search body:
Forums (0)