After hearing one artist played over and over during a shuffled play of your entire music library in iTunes you may think your player has a preference of its own. Apple claims the iTunes’ shuffle algorithm is completely random.1 The shuffle algorithm chooses songs "without replacement." In other words, much like going through a shuffled deck of cards, you will hear each song only once until you have heard them all… or until you have stopped the player or selected a different playlist.
iTunes Party Shuffle2 is a different matter. Its algorithm selects songs "with replacement," meaning the entire deck of cards is reshuffled after each song is played. The play higher rated songs more often option does exactly what it says, but how much preference is given to higher rated songs?
To test the option’s preference for 5-stars, I created a short playlist of six songs: one from each different star rating and a song left un-rated. The songs were from the same genre and artist and were changed to be only one second in duration. After resetting the play count to zero, I hit play and left my desk for the weekend. To satisfy a little more curiosity, I ran the same songs once more on a different weekend without selecting the option to play higher rated songs more often. Monday morning the play counts were as shown in Table 1.
’’’Table 1.‘’’ The play higher rated songs more often option showed a distinct change in rating play counts. | border | align: center
The play counts in the random trial were very close to each other, as can be expected with a random selection. For the rating-biased trial the preference algorithm appears to be linear from 12% to 27% for the rated songs. Moving from the 5-star rating downward, the linear preference declines around 4% with each step down in rating, but doubles over the drop from 1-star to unrated with a fall of 8%. While one star may seem like the lowest rating, no-rating proved the black sheep of the lot.
’’’Figure 1.‘’’ The unrated play count dropped well below the liner bias iTunes showed for rated songs. | border | align: center
Changing the number of songs within each rating will change these probabilities. With multiple songs of each rating, the chance of a song with rating r coming up next in the ratings-biased party shuffle can be calculated using the equation in Figure 2.
’’’Figure 2.‘’’ The chance of a song of certain rating playing next; where x = number of songs with each rating, P = rating biased preference, and subscript = star rating. | border | align: center
With iTunes’ preference probabilities for each rating determined from the trial, the resulting equation is:
’’’Figure 3.‘’’ The chance of a song of certain rating playing next in iTunes Party Shuffle. | border | align: center
Although the higher rated songs are given preference, you will not definitively hear more 5-star rated songs than all other ratings. Most people follow a bell shaped curve for their ratings, with the 3-star rating being the most common. Table 2 displays a hypothetical iTunes library with this bell shaped curve for the rating song count. Figure 4 displays the resulting probabilites after running these hypothetical numbers through the equations above.
’’’Figure 4.‘’’ Probability of a rating playing next is greatly determined by song count. | border | align: center
As you can see in Figure 4, the chance of a rating coming up next in the playlist is greatly determined by the song count within the rating. The iTunes preference for higher rated songs and dislike for lower rated songs only slightly lowers or raises the probability determined first from the song count.
These chances of hearing a certain rating can be applied to find the chances of hearing a particular song. If we remove the song count from the numerator in Figure 3 we can calculate the chance of a certain song coming up next, not just the rating.
About a month after running these tests, I noticed my iTunes party shuffle at work played the same song two times in a row. This was the first time I had noticed a consecutive repeat and I checked the playlist. Not only did I find Nirvana’s Territorial Pissings listed twice in a row, but AFI’s Death of Seasons was listed twice in a row three tracks later. I use the play higher rated songs more often option, but these were each middle-of-the-road 3-star songs in my song library of nearly 4000. The odds may seem outrageous at first, but not if you consider just how many songs you hear throughout a workday. If I average ten hours at work each day and a 3.5 minute song duration, odds say I should hear another consecutive repeat in less than a month.
Many claim to still see patterns as iTunes rambles through their music collection, but the majority of these patterns are simply multiple songs from the same artist. Think of it this way: If you have 2000 songs and 40 of them are from the same artist, there is always a 2% chance of hearing them next with random play. So right after one of their songs finishes, odds show a 50% chance they will play again within the next 35 songs and a 64% chance they will be played again within the next 50 songs. This can be calculated using the following equation:
’’’Figure 6.‘’’ The chance of one particular artist playing within song count n. | border | align: center
It’s simply the mind’s tendency to find a pattern that makes you think iTunes has a preference.
1 Levy, Steven. "Does Your iPod Play Favorites." 31 January 2005. http://msnbc.msn.com/id/6854309/site/newsweek/ Accessed 4 June 2005.
2 Hofferth, Jerrod. "Using Party Shuffle in iTunes." 22 August 2004. http://ipodlounge.com/index.php/articles/comments/using-party-shuffle-in-itunes/ Accessed 4 June 2005.
Similarly tagged OmniNerd content:
- markmcb's Top 5 iPhone App Picks for 2009, by markmcb almost 4 years ago
- Virtual Server for Leopard, by VnutZ almost 6 years ago
- Radiohead Lets Consumers Pay What They Want for Latest Album, by Brandon about 6 years ago
- Serving a Website from a Home Network on Mac OS X, by markmcb almost 7 years ago