The suspicious moment in a shuffled playlist is not a repeated song. It is the same artist returning immediately, as if the shuffle button has developed a minor fixation.
That can feel like evidence of a bad shuffle. I wanted to know how suspicious it should feel, so I made a toy playlist with 100 distinct tracks: ten tracks each from ten imaginary artists. Then I shuffled it 100,000 times and counted every place where one artist followed itself.
My prediction was that a fair shuffle would look less tidy than most listeners want. The result was considerably messier.
Nine awkward handoffs per playlist
The 100,000 shuffled playlists averaged 8.99937 same-artist adjacencies. The mathematical expectation is exactly nine.
That nine does not require a simulation. Pick any track except the last one. Among the 99 tracks that could follow it, nine belong to the same artist. There are 99 boundaries between tracks, so the expected count is:
99 boundaries × 9 same-artist tracks / 99 remaining tracks = 9
Individual shuffles wandered around that average, of course. That is the point of shuffling. But only seven of the 100,000 trials avoided back-to-back appearances by the same artist entirely. In this particular playlist, at least one artist repeat appeared in 99.993% of fair shuffles.
The clumps also grew longer. A run of at least three tracks by one artist appeared in 49.405% of trials. A run of four or more appeared in 4.756%.
No song played twice in any trial. Every track appeared exactly once. The repetitions existed only at the artist level, which is enough to make a person glare at the shuffle button.
Random is not the same as evenly spaced
People are not especially good at manufacturing randomness. A 2024 review of human-generated sequences describes familiar habits such as avoiding direct repetition and cycling toward choices that have not appeared recently.[3] We tend to make “random” sequences behave themselves.
A fair shuffle has no such manners. It gives every track a place without promising that artists, genres, moods, or decades will take turns. Preventing two songs by the same artist from touching may improve the listening experience, but it adds a rule. The result can be more varied and less random at the same time.
Spotify has had to negotiate exactly this distinction. The company describes its Standard Shuffle as purely random, while its default Fewer Repeats mode generates multiple random orders, scores them using recent listening, and chooses the freshest one.[1] That is not a scandal hiding inside the button. It is a product decision about what listeners usually mean when they ask for a shuffle: surprise me, but please do it tastefully.
What I tested, and what I did not
I used Python 3.11's random.shuffle with a fixed seed so the experiment can be reproduced. Python documents shuffle as an in-place random permutation and uses the deterministic Mersenne Twister generator for its ordinary random functions.[2] This was a toy model, not a test of Spotify, Apple Music, or any other player.
The playlist shape matters. Ten artists with ten tracks each creates more opportunities for artist clumps than a playlist with one track per artist. Different catalog sizes and listening-history rules will produce different numbers. The experiment answers one bounded question: what does a fair shuffle do with this balanced 100-track collection?
It makes clumps. Reliably. If the shuffle looks suspicious because the same artist appears twice in a row, suspicion is not proof that the software failed. Sometimes the least random-looking order is the one that needs the fewest excuses.