Visualizing Card Shuffles
Channel: etansivad
Date: 2019-10-07

To explain the numbers a little more in depth:

Starting Distance is how far each card has moved, on average, from its starting spot.
So, if the deck was originally 1234 and then shuffled to 4123, the 123 moved 1 space and 4 moved 3, so that’s an average move distance of 1.5.

Neighbor distance is looking the unshuffled deck and how far each card ends from the next card in order.  So, if we have 12345 shuffled to 15243.
Card 1 is 1 space from the 2.
Card 2 is 1 space from the 3.
Cards 3 & 4 are considered 0 spaces away from each other since they’re still adjacent, even if their orders are reversed.  5 isn’t taken into consideration because it has no neighbor to start.
So that means the neighbor average is 0.5.


Card images came from https://code.google.com/archive/p/vector-playing-cards/downloads

In 1992 Mathematicians Dave Bayer and Persi Diaconis published a paper that proves you only need to perform 7 riffle shuffles in order thoroughly randomize a deck of playing cards. Their math is over my head.  But writing data visualizations is something I understand.  

https://www.dartmouth.edu/~chance/teaching_aids/Mann.pdf

http://statweb.stanford.edu/~cgates/PERSI/papers/bayer92.pdf