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.
(In reply to
re(6): Making a sequence (spoilers on the numbers) by Charlie)
Since I didn't really understand much of what you said, I decided to look at the numbers more closely and I noticed a few patterns. The powers of 2 are pretty obvious...
2=1, 4=2, 8=3, 16=4 32=5 etc.
The answer is equal to the exponent of 2. But there's a pattern for other numbers too.
3=2, 9=6, 27=18, 81=54, 243=162
It looks like for all numbers 3^x, each answer is equal to 3^(x1) * 2. IOW, it's 3 times more than the last one. So for 3^8 (6561) I'm guessing the answer is (3^7) * 2 or 4374.
The pattern for 4 is just double the exponent. But 4 is already an exponent of 2 so that's obvious.
5 follows a similar pattern to 3. For all numbers 5^x the answer is 5^(x1) * 4.
6 is weird.
6=4, 36=12, 216=28
1296 could be either 72 or 68 or even 36. i dunno, i need more numbers.
7=3, 49=21, So 343 would probably be 147.
It looks like all prime numbers have the same pattern. x^(n1) * (x1). Like 3, 5, 11, 13, even 2 works. But not 7 because it's one less than 8 which is a power of 2, so starts with a 3 instead of 6. So all odd numbers have to be the same as the even number higher immediately after it, before it can follow that formula. Like 7 and 31. But not 3 because it would have been a 2 anyway. And if the prime number is one less than a number that has a factor that is a prime then it can't follow that formula either. Like 17 is only 8 because 18 is a multiple of 9. But 29 works because 30 is NOT a multiple of a square. !!! BLLAH!!!! it's too complicated, forget it, i give up!
Edited on May 25, 2004, 1:46 pm

Posted by Danny
on 20040525 10:53:44 