A pack of cards riffled once is barely shuffled: every card is still close to where it started, and long runs of the original order survive intact. The randomness arrives suddenly rather than gradually, and the crossing point for a 52-card deck is seven riffles.
That figure comes from a 1992 analysis of how quickly the riffle shuffle mixes a deck, and it is the reason casinos shuffle more than feels necessary.
Why is it sudden rather than gradual?
Because the measure of how far the deck is from random barely moves for the first few shuffles and then falls off a cliff. Up to about five, the deck retains structure that can be detected and in some cases exploited; by seven it is close enough to random that the difference stops being usable.
Two or three riffles leave rising sequences — runs of cards still in their original relative order — long enough that the previous arrangement can be partly reconstructed. That is a real vulnerability rather than a theoretical one.
Going past seven keeps improving things and by progressively less. The interesting part of the result is not that more is better but that the useful threshold is a specific number rather than a matter of taste.
Which shuffle you use matters more
The overhand shuffle, where small packets are stripped from one hand to the other, mixes far more slowly. It needs thousands of repetitions to reach what a riffle reaches in seven, because each pass moves only a few cards relative to each other.
A cut is not a shuffle at all. It rotates the order without changing the sequence, so a cut deck is the same deck starting in a different place.
Spreading the cards face down and swirling them mixes well but takes a long time, which is why it is used as a first pass before riffling rather than instead of it.
How does a computer shuffle?
By walking the list once, swapping each position with a randomly chosen one at or before it. That produces every possible ordering with equal probability and does it in a single pass.
| Method | Unbiased | Cost |
|---|---|---|
| Walk and swap | yes | one pass |
| Sort by a random key | yes, if keys are unique | a sort |
| Sort with a random comparator | no | a sort |
| Repeatedly pick until all used | yes | slow at the end |
The third row is the common mistake. Handing a sort function a comparator that returns a random answer produces a distribution that is measurably biased, and in some languages an inconsistent comparator is undefined behaviour rather than merely unfair.
The last row is what people write first and it degrades badly. Picking at random and retrying on a repeat spends most of its time near the end hunting for the few remaining items.
Where does the randomness come from?
A generator, and which one matters for anything with a stake attached. A general-purpose generator is fine for a game and unsuitable for anything where predicting the next value would be worth something.
For a prize draw or anything that has to withstand a challenge, the browser’s cryptographic random source is the right one. It is available for exactly this and costs nothing extra.
The other half of a defensible draw is the record: what the pool was, when it was drawn, and who observed it. Randomness that cannot be evidenced afterwards is hard to defend even when it was sound.
Does any of it apply outside cards?
To any ordering that carries meaning you want to destroy. A playlist, a question order, a rota or a test set all have the same property — a partial shuffle leaves structure, and structure is what you were trying to remove.
It matters most where the input was already sorted. Shuffling an alphabetical list badly leaves it visibly alphabetical in places, which is exactly the pattern people notice and complain about.
A single pass of a proper shuffle removes it completely, which is the one advantage the computational version has over the physical one.
What does a badly shuffled deck look like?
Sorted in places. A deck riffled once or twice contains long stretches still in their original relative order, and if the pack came out of the box in suit order those stretches are visibly sequential.
The same signature appears in software. A list shuffled by a biased method tends to leave items near where they started, so the first few and the last few positions are the ones where the bias shows.
Checking for it is easy and rarely done: shuffle the same list many times and count how often each item lands in each position. A correct shuffle spreads them evenly, and a biased one produces a visible pattern within a few thousand runs.
Questions people ask
Is a machine shuffle better? A good one riffles many times. A poor one can be more predictable than hands.
Does cutting after shuffling help? Marginally. It defends against knowing the top card and adds no mixing.
Why do casinos use several decks? It changes the counting arithmetic rather than the shuffle quality.
Can a digital shuffle repeat? Only if the generator is seeded identically, which is a feature when reproducing a test and a flaw everywhere else.
Shuffle properly, then draw. The card shuffler and random playing card generator handle a deck, shuffle lines and shuffle words reorder text, and the lottery number generator draws without replacement from a fixed range.