52 cards, tracked by their original sorted position (A♠…K♣ = 0…51). Each algorithm is the real permutation math, not a cosmetic animation:
- Fisher–Yates — for i from 51 down to 1, swap card i with a uniformly random card j ≤ i. One pass already produces an exactly uniform random permutation (the textbook proof-correct shuffle).
- Riffle (GSR) — splits the deck into two packets of sizes k and 52−k, k drawn from a Binomial(52, 0.5) distribution (coin-flip cut), then drops cards one at a time from whichever packet has a cards left with probability a/(a+b). This is the Gilbert–Shannon–Reeds model that matches how humans actually riffle cards. Bayer & Diaconis (1992) proved it takes about 7 such riffles to bring a 52-card deck close to uniformly random — watch the inversions/runs counters climb toward the "random" reference values as you click through passes.
- Overhand — repeatedly peels a random chunk of 1..N cards off the top and stacks it onto a new pile. It reverses chunk order but barely mixes within a chunk, so even after many passes the inversions count stays far below the random reference — a well-known real-world result: overhand shuffling alone does not randomize a deck.
Inversions: number of card pairs that are out of their original relative order (0 = sorted, 1326 = perfectly reversed, ~663 = expected for a uniform random permutation). Ascending runs: the deck split at every place a card is followed by a lower-valued one (1 = sorted, ~26.5 expected for a random permutation) — both are standard permutation statistics used to measure how "shuffled" an arrangement really is.