/gilbert-shannon-reeds

Python implementation of the Gilbert-Shannon-Reeds model for shuffling playing cards.

Primary LanguageHTMLMIT LicenseMIT

Gilbert-Shannon-Reeds

Python implementation of the Gilbert-Shannon-Reeds model for shuffling playing cards.

Mergify Status License Cron Jobs Pull Requests & Pushes pre-commit

From Wikipedia:

In the mathematics of shuffling playing cards, the Gilbert–Shannon–Reeds model is a probability distribution on riffle shuffle permutations that has been reported to be a good match for experimentally observed outcomes of human shuffling, and that forms the basis for a recommendation that a deck of cards should be riffled seven times in order to thoroughly randomize it.

The deck of cards is cut into two packets... [t]hen, one card at a time is repeatedly moved from the bottom of one of the packets to the top of the shuffled deck.

Here we implement the Gilbert–Shannon–Reeds model, and verify this recommendation of seven shuffles.