As you may have noticed, Spotify shuffle is not a perfectly random shuffle. If you have a playlist with \(n\) songs, Spotify’s shuffle algorithm definitely does not make all \(n!\) permutations equally likely. Why not? Because people don’t actually want that. Spotify used to implement a pure random shuffle, but users complained that it was too patternful. For better or worse, the human brain is wired to detect meaningless patterns in random noise. For instance, the picture on the left is a “truly” random scatter of points; the one on the right is manipulated so the points don’t “clump”:

When you survey people that don’t know any better, they often feel like the second picture is “more random” than the first because it lacks clumps, but this is a misunderstanding. A truly random playlist shuffle will often have clumps: clumps of artists, clumps of genres, etc. So when people say that they want “random,” what they really mean is just “variety” in some vague sense, and this is what Spotify shuffle tries to deliver. I could not find a good source for what Spotify shuffle currently does, but whatever it is, I personally dislike it.

  1. Imagine your playlist of \(n\geq 3\) unique tracks contains \(2\leq k\leq \lceil n/2\rceil\) songs by the same artist. What is the probability that a random permutation of the tracks will contain at least one streak of songs by that artist? A streak is two or more of their songs in a row;
  2. This is the playlist I use when I grade exams (something I enjoy doing, btw). It contains \(n = 14\) songs. There are 11 artists with one song apiece1, and then Chaka Khan has \(k=3\) songs, because, why wouldn’t she? Shuffle this playlist at least twenty times2 and compute the proportion of the time the shuffle contained a “Chaka streak.” Using the previous part, compare this empirical proportion to the theoretical probability that would prevail if the shuffle was truly random.

Footnotes

  1. Martha Wash is technically heard twice, once in a solo capacity and once as a member of The Weather Girls, but let’s please not quibble;↩︎

  2. If you don’t have a Spotify account, collaborate with a classmate who does and please acknowledge them.↩︎