Hacker News new | ask | show | jobs
by OisinMoran 2149 days ago
Yes it's 8 perfect riffles. What the article doesn't seem to stress is that there are two different riffles—an in shuffle (top card moves to second) and an out shuffle (top card stays on top). It's only 8 with an out shuffle I think, but 52 with an in shuffle. So presumably their figure of 7 is referring to the in shuffle (as being 1 shuffle away from the original order doesn't sound too shuffled to me).

The in shuffle is n shuffles in general to get back to the start but the out shuffle isn't such a simple pattern.

If you want to make a shuffle that will take _even longer_ to get back to it's starting point, the best you can do is the Landau function which as you can see can get very big: https://oeis.org/A000793/list (I have a calculation of g(52) but not on me right now)

2 comments

For more than you ever wanted to know on the mathematics of a perfect shuffle, see this paper:

http://statweb.stanford.edu/~cgates/PERSI/papers/83_05_shuff...

I saw one of the authors, Persi Diaconis, give a talk on this paper, and then perform a perfect shuffle. I was floored.

Your statement about in shuffles for general n is false. Consider that an in shuffle on n cards is identical to an out shuffle on the middle n of n+2 cards.

Also, the statement in the article is for a random riffle, not a perfect one. Any deck which has only been perfectly riffled is entirely determined.