# How smart is iTunes or iPhone's shuffle function?

Is iTunes shuffle function is just a programming language `random()` function or it's smarter than that? Does it use play count, skip count and other parameters to play better songs first?

• Would the question be better phrased as, "How random is iTunes or iPhone's shuffle function?" Commented Mar 27, 2012 at 8:26

This has been a point for discussion for a very long time!

Here's a great article looking at this exact issue - How Much Does iTunes Like My Five-Star Songs? Bear in mind this is from 2005 but I see very similar behaviour to what is described here.

The standout image for me is this one:

It shows pretty clearly that shuffle does use rating in determining which song to play. I find it strange that mid-rated songs are much more likely to be played than high-rated songs.

AskDifferent user Ian C. did some interesting experiments last year and found that the appearing non-randomness of shuffle is probably due to the algorithm re-using the seed rather than being completely random.

The meaning of this is that shuffle is not truly random, only pseudorandom. As this Random Seed article (Wikipedia) explains, having the seed used in a pseudorandom process will allow you to recreate the same "random" results. True randomness is actually very, very hard to get. (While working on a mobile phone at Siemens years ago a doctor of mathematics had to be brought in to write the random function - the ordinary programmers weren't considered qualified, and the C library function considered inadequate.)

• I think you've misinterpreted that graph. It shows a typical library that contains more mid-rated songs than high or low rated songs. The blue represents the normal shuffle and yellow the play higher rated songs more often (or rating biased) shuffle. So it shows that rating biased shuffle will play your higher rated songs more often than it would in normal shuffle. Commented Mar 29, 2012 at 3:05