June 24, 2008

iPod Shuffle Algorithm

In my office, I listen to an iPod in shuffle mode most of the time. With nearly 8,000 songs on the 30GB model, you would imagine that the odds of hearing the same song twice in two days would be low, wouldn't you? And you'd expect that if you had different versions of the same song, they would not be played in sequence, right? Wrong! Yesterday I heard the song I Won't Stand in Your Way by the Stray Cats and immediately afterwards I heard the same song from a Brian Setzer Orchestra album! I thought I must be imagining things, so I hit the Previous Song button. Sure enough, I was in touch with reality -- well, at least as far as my hearing goes. But I thought what are the odds of that happening? Then a few hours later, I heard Beethoven's Fifth (yeah, I know, my tastes are pretty eclectic) and right after that, I heard it again this classical piece as a cut from a movie soundtrack! Curiouser and curiouser, I thought. I listen to the iPod with shuffle all of the time and although I do tend to hear some songs repeated on different days, this was the first time I'd experienced back-to-back plays of 2 versions of the same song -- and twice in one day!

So I emailed my friends Ted and Jeannie who are eagerly awaiting their first baby. Jeannie has a PhD is statistics, so I figured she might be able to calculate the probability of this double double-play. And maybe it would keep her mind off waiting for Little Richard to arrive. Tune in for the result in a later post.

Meanwhile, I googled iPod's pseudo-random number generator (PRNG) and found these 2 insightful hits: Is-an-ipod-on-shuffle-truly-random and a MacInTouch Reader Report from 2005 which offered this advice:

"iTunes still seems to have a tendency to pick some songs more frequently than others, and some songs never seem to get picked. My solution to this problem has been to create a "not recently played" smart Playlist which only picks songs which haven't been played in the past few months, and also have a low playcount. Then I use this smart Playlist to feed Party Shuffle."

No comments: