Fun with iTunes Shuffle Feature

Discussion in 'Community Discussion' started by Mr. Durden, Oct 28, 2005.

  1. Mr. Durden macrumors 6502a

    Jan 13, 2005
    OK, so this may not be all that interesting to everyone, but I did a little experiment with my iTunes library at work.

    I have 1,088 songs in the library and have the "shuffle" button pressed. I pressed play and just let it run. All day. All night. And on and on...

    So now, just over 3 full days later, I check the play count for the songs and...

    About half of the songs havent been played yet, but others have been played multiple times. One song, Hustlers Ambition (the most recently purchased song) has been played 5 times. A bunch more have been played 4 times, and the majority have been played once.

    That makes me wonder just how random the shuffle feature is. Does it randomly choose the songs you have played the most and work its way down the list that way? It must be random every single time it picks a new song, and put the song it just played back into the list of available songs, since some have been played so many times?

    No point to this really, except that it struck me as interesting...

    Anyone else experiment with the shuffle feature with similar results?
  2. katchow macrumors 6502

    Feb 14, 2002
    Dayton, Ohio
    i haven't tried iTunes shuffle much but I've noticed over the years that computer programs often have a hard time w/ true randomness.
  3. OutThere macrumors 603


    Dec 19, 2002
    iTunes shuffle has always been a little silly...I maintained that it had a brain for many versions, but now it has a little slider so you can set how random it really is...I was right all along.

  4. tobefirst macrumors 68040


    Jan 24, 2005
    St. Louis, MO
    Or, are they just really good at it? I'm no statistics expert, but I do know that humans are really bad at "randomly" picking things from a list, even though we think we would be good at it. Perhaps it's not perfect, as Mr. Durden says over half of his songs haven't played yet...but maybe it's better than we give it credit for.

    What does everyone else think?
  5. saabmp3 macrumors 6502a

    Jul 22, 2002
    Tacoma, WA
    It uses a random number generator with a seed variable. That seed variable is usually the time, but the shuffle doesn't have a clock so it has to use something else. I bet that slider is just a number to be input in the random number generator.

  6. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    Nah, the "Smart Shuffle" slider description says:
    You can't do that with a simple change to the random number seed. Also, I don't think this slider has any effect on the iPod, just within iTunes(?)

    It's related to this problem discussed here which asks what the probability of having two 8's next to each other in a randomly shuffled deck would be. At least one estimate on that page says that it's close to 96%!

    I don't know what they do on the shuffle, but one approach would be to load up a number of random seeds generated from the last sync time every time you connect your Shuffle to the computer.

  7. kgarner macrumors 68000


    Jan 28, 2004
    Ummm...he was taking about the iTunes Shuffle feature, not the iPod Shuffle.
  8. iHateWindows macrumors 6502

    May 11, 2005
    Not true with a lot of things in Windows (bugs, viruses, spyware, etc.) :D
  9. pdpfilms macrumors 68020


    Jun 29, 2004
    Yeah, i've noticed that itunes will only shuffle to songs I have listened to... or really hate. There are certain artists i will NEVER, EVER hear, and others that I'll hit within 3 clicks... and this is in a 10,000 song, 1,000 artist library.
  10. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    Yesterday my 5G was on a U2 kick.

    I only have 6 U2 songs on the iPod and it played 4 of them among the 67 songs played yesterday.

  11. Abstract macrumors Penryn


    Dec 27, 2002
    Location Location Location
    If you play songs from your playlist on random, I believe it chooses your 5 star songs, and songs with the highest play count more often than the songs that have never been played all the way through.
  12. redAPPLE macrumors 68030


    May 7, 2002
    2 Much Infinite Loops
    i think the shuffle function will function correctly, if one uses the ratings correctly.
  13. TheMonarch macrumors 65816


    May 6, 2005
    Bay Area
    I hate how iTunes only randomizes songs the instant you click on the "shuffle" button... From then on, iTunes has a set order in which it will play the songs... So it doesn't use a time seed variable or whatever... You have to re-shuffle songs... Gah!
  14. commonpeople macrumors regular

    Nov 9, 2004

    There's some confusion here. Apple is probably using a 'pseudo-random' number generator- which although deterministic- it is practically indistinguishable from a real random sequence (such as tossing coins).

    It is natural, but quite mistaken to think that with a library of 1000 songs and performing say 5000 shuffles that you should get fairly even sampling of each song. However, there's an inherent noise with random numbers (goes as 1/sqrt(N)) whereby you don't get a smooth even distribution unless you run for many many steps, maybe 100,000. For only a few thousand shuffles, random numbers will almost certainly hit several songs multiple times, whereas other songs will not be hit at all. The fact that you observe 'spotty' selection of tunes is not inconsistent with the fact that a random number generator is being used- in fact- it is exactly what it should be like!

    This is the basis of 'Monte-Carlo' sampling methods used by physicists and other scientists. Wikipedia will tell you all.
  15. MongoTheGeek macrumors 68040


    Sep 13, 2003
    Its not so much where you are as when you are.
    The randomness really breaks down pulling from a fixed sized list.

    I have a list of songs that meet certain criteria. I haven't listened to them in 2 weeks, they are rated 4 or better. Limited to 200 songs by least played. When I hit play higher rated songs more often it plopped the same song down 10 times in a row.

Share This Page