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 inshuffle.
If you repeat this inshuffling process, how many inshuffles 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, inshuffling 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 inshuffle yields 1,4,2,5,3.
i wrote out the full sequences for decks of sizes 10, 16, 20 and watched card #2 travel through the decks (since the top and bottom cards remain in their places). with each shuffle, the #2 card moves down through the deck, in numbers which double each time. once the card finds itself in the second half of the deck, it begins travelling back up the deck, trying eventually to make to the center (cutpoint) of the deck. in the case of a 52 card deck, it takes fifteen shuffles for the #2 to find itself in the #27 position, the first card of the second half, which is then arranged 2,4,6,8, etc. thus on the SIXTEENTH shuffle, the cards are in their original order.
answer: 16 shuffles

Posted by rixar
on 20040526 08:49:50 