## Shuffling a deck of cards using the GSR model.

As detailed in their article Trailing the Dovetail Shuffle to Its Lair (Ann. Appl. Probability 2, 294-313, 1992), David Bayer and Persi Diaconis explore the randomization of a deck of cards through successive shuffles.

This applet simulates the shuffling of a deck using the GSR model and tracks the number of rising sequences through the shuffles. (For a brief description of the GSR model and rising sequences, click here.) To begin, read the directions on the use of the applet and then investigate how many shuffles are needed to randomize a deck of cards. The study questions that accompany this applet can also help you discover the answer to this question!

### Directions for use of the Applet

Each time the applet runs a simulation it shuffles an ordered deck 9 times and records the number of rising sequences at each step. To run a simulation, click "Run Simulation". To run more than one simulation at a time, change the number in the text box to the left of the "Run Simulation" button.

The top panel of the applet shows the number of rising sequences that have occurred on average after each shuffle from all of the simulations run. You will notice that one of the bars has a green border. The second and third panels of the applet will show more detailed information for the shuffle with the green border. Click a different bar in the top panel to investigate a different shuffle.

The next panel shows the percentage of the time each of the possible rising sequences occurred after a particular shuffle. Again, you may look at different shuffles by clicking on the bars in the top panel. You will notice a blue curve overlayed for the fourth through ninth shuffles. This shows the probability of arriving at each number of rising sequences from that many shuffles. The curve is obtained from the probability transition matrix. The reader is encouraged to think about what the curve looks like for zero through three shuffles.

The third panel visualizes a shuffle from the most recent simulation. Click a card to see the rising sequence it belongs to. Click the "Colors" button to see a color-coded index of rising sequences. Once again, you may look at different shuffles from the most recent simulation by clicking on the bars in the very top panel.

created by Timothy P. Chartier and Reuben K. Fries
Cartoons thanks to Learn2.com