2

I don't know much about group theory and card-shuffling theory, so this may already have a name I don't know about. I often shuffle a deck of cards using a method that is defined by a particular element of $S_{52}$, the symmetric group on 52 letters. In Mathematica notation, it is:

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

Similar to how a Faro shuffle returns a deck into its original order after 8 shuffles, the method I use returns the deck into it's original order after 272 shuffles:

G = PermutationGroup[{p}];
o = GroupOrder[G]
(*272*)

Unfortunately, that's not the end of the story. By applying a crude "sortedness metric" to the sequence of decks obtained by the shuffles, it's apparent that every 34 shuffles, the deck is in an "almost-ordered" state:

d = NestList[Permute[#, p] &, Range[52], o - 1];
s = Total@(Differences[#]^-2) & /@ d;
ListLinePlot[s, PlotRange -> All]

enter image description here

The sortedness metric is just the sum of the inverses of the squares of the elements of the delta sequence of the card-numbers of the deck, as can be inferred from above. The large spike at zero is just the original sorted deck, and the periodic spikes are correspond to almost-sorted states.

Here are the initial and 7 subsequent almost-sorted states (right-click the image and open in a new tab to get the full-size 1500 x 453 pixel size):

ListPlot[d[[#]], PlotLabel -> #] & /@ Flatten@Position[s, x_ /; x > 20]

enter image description here

These oscillations mean that in practice, the shuffle can only be used 34 times before the deck is suspiciously similar to its initial state.

So my question is:

  • Is there a name for these oscillations?
DumpsterDoofus
  • 1,600
  • 1
  • 9
  • 19

0 Answers0