Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Crunching the Math On iTunes

Posted by Zonk on Sun Aug 28, 2005 04:45 AM
from the not-completely-random dept.
markmcb writes "OmniNerd has posted an interesting article about the statistical math behind iTunes. The author makes some interesting observations concerning the same song playing twice in a row during party shuffle play, the impact that star ratings have on playback, and comparisons with plain old random play (star ratings not considered)." From the article: "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."
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

Crunching the Math On iTunes 25 Comments More | Login /

 Full
 Abbreviated
 Hidden
More | Login
Keybindings Beta
Q W E
A S D
Loading ... Please wait.
  • Ok... (Score:4, Funny)

    by jim_v2000 (818799) on Sunday August 28 2005, @04:51AM (#13420072)
    So from this we learn that the random play on iTunes really is random, and that rating a song really does have an effect. Who'd a thunk?

    Next, "iTunes really does play tunes!"
    • Re:Ok... (Score:5, Insightful)

      by QuantumG (50515) <qg@biodome.org> on Sunday August 28 2005, @05:27AM (#13420156) Homepage Journal
      Confirming something instead of just assuming it is the case. What's that called again.. oh yeah, Science! Clearly this article is in the wrong section.
      [ Parent ]
      • Re:Ok... (Score:5, Funny)

        by TheGavster (774657) on Sunday August 28 2005, @09:52AM (#13420814) Homepage
        All lies! The play order is too complex to occur naturally; there must be some intelligence that selects the order of the songs!

        And, of course, looking into the origins of said intelligence is blasphemy.
        [ Parent ]
  • Reminds me of... (Score:5, Funny)

    by Anonymous Coward on Sunday August 28 2005, @04:54AM (#13420081)
    the time my 2G iPod seemed to have a liking for the Aphex Twin's Selected Ambient Works Vol. 2. It was playing a track off it pretty much every other song. Those of you who know the album can appreciate that it's not the kind of music that you'd maybe choose as everyday listening material.

    It became so annoying that I ended up removing the album from iTunes, at which point my iPod promptly died. The replacement was big on Roxy Music IIRC...
    • Re:Reminds me of... (Score:4, Interesting)

      by hattig (47930) on Sunday August 28 2005, @05:15AM (#13420124) Journal
      Maybe songs need more than one rating.

      Rating For Morning Listening (* for Aphex Twin, Slayer, etc)
      Rating For Afternoon Listening (**)
      Rating For Evening Listening (****)
      Rating For Party Listening (**)
      Rating For ${mood} Listening

      Then instead of getting work done we can spend out entire lives rating music.
      [ Parent ]
      • Re:Reminds me of... (Score:4, Interesting)

        by Gorath99 (746654) on Sunday August 28 2005, @06:56AM (#13420322)
        I was thinking about something like this myself. Basically, what I'd like to have are two flags:

        1: Never play unless I explicitly say so.
        2: Don't include in shuffle.

        The first one I'd use to flag interviews etc. that are sometimes included on albums. Is not necessarily bad content, just something that you don't generally need to hear multiple times.

        The second one is for flagging things like Beethoven's 9th. It's really good music, but you don't want 67 minute long pieces in a random playlist.

        I currently just use the 1 and 2 star ratings for this, but it's not really ideal. It's too bad (but understandable) that iTunes has no option for looking at TXX frames [id3.org] or I could implement it in a better way.
        [ Parent ]
      • Re:Reminds me of... (Score:5, Interesting)

        by Dixie_Flatline (5077) <jan.bioware@com> on Sunday August 28 2005, @10:51AM (#13421016) Homepage
        I use the stars to indicate how often things should be played.

        * - Never play. It's only in the list for the sake of completeness (I hate having partial albums)

        ** - Play very rarely. If I'm in the mood, I might listen to it.

        *** - I'll listen to it at least once a week. If it comes up randomly on the shuffle, I won't take it out of the list.

        **** - I can listen to this several times in a day.

        ***** - I'll listen to this song anytime, anywhere. If it comes up twice in a row, no problem. If my playlist only has this song on it, I can cope with that for at least a few hours.

        This means that I have to periodically re-rate the songs. That seems only reasonable, though. Why would songs stay at the same rating forever? As the novelty wears off, I can relegate a song to 4 or 3 stars.

        I also keep extensive smart playlists that make sure that songs that are 3 stars or less only get played once every few days.
        [ Parent ]
  • Interesting (Score:5, Interesting)

    by hattig (47930) on Sunday August 28 2005, @04:57AM (#13420089) Journal
    I wish iTunes would get ratings from some online source much like it gets tracknames from Gracenote. Can you imagine a server of user-submitted ratings? You could opt to use an average rating from all users, or a rating from users with particular tasks (i.e., if you are a metaller, then you'll probably not want raver's musical opinions affecting your ratings!).

    Why? Because I haven't got the time to go around rating my entire music library. Judging from that article, it is dangerous to only do a few because of the weighting algorithm used - surely it would be more sensible to assume that 'not rated' meant 3 stars rather than 0 stars? That way you could rate down shitty songs, and rate up excellent songs, but ignore rating the vast majority of songs.
    • Re:Interesting (Score:4, Interesting)

      by the_unknown_soldier (675161) on Sunday August 28 2005, @05:03AM (#13420101)
      I only rate good songs... Indifference is the worst rating you can give to a song, so i think "0" fits in pretty well

      As for Gracenote: perhaps sales on the ITMS could act as a gauge of this. e.g. "This is this artist's most downloaded song and this artist compared to similar ones is bought 5x as much, so our algorithms suggest it should be rated 5" Then once you have downloaded it you can change it if you get the time.
      [ Parent ]
    • Re: Try last.fm (Score:5, Interesting)

      by P!Alexander (448903) on Sunday August 28 2005, @05:33AM (#13420170)
      That's exactly why I love last.fm [www.last.fm] (formerly Audioscrobbler & Last.fm). It automatically tracks what you listen to and then allows that information to be used to give you neighbors in the music world based on what interests you have in common. You can add friends, join groups, and even tag your music. All of this is extremely useful in finding new stuff. They've got plugins for all the major media players (and even some minor ones).

      Add on top of that the ability to play a custom-built radio station, set it to play only new music or listen only to music from a particular user profile.

      Linux and BSD supported! Open source plugins and radio station player! Could it get better? ;)

      ---
      but make sure that the last line
      Generated by SlashdotRndSig [snop.com] via GreaseMonkey [mozdev.org]
      [ Parent ]
    • Re:Interesting (Score:5, Interesting)

      by Stuart Gibson (544632) on Sunday August 28 2005, @06:21AM (#13420262) Homepage
      Select All -> Get Info -> My Rating -> Three Stars.

      Rate up and down others as necessary. OK, not the point that default should be doing this for you, but a quick fix if you want it to work that way.

      If you already have songs rated then create a 0 star smart playlist and repeat.

      Stuart
      [ Parent ]
    • Re:Interesting (Score:5, Funny)

      by Feanturi (99866) on Sunday August 28 2005, @06:30AM (#13420275)
      A public moderation system, cool. That never gets abused anywhere that I know of.
      [ Parent ]
  • Finally (Score:5, Funny)

    by Ed Thomson (704721) on Sunday August 28 2005, @05:03AM (#13420099)
    Someone to show how cool mathematics is
  • Underlying formula (Score:5, Informative)

    by Pemdas (33265) * on Sunday August 28 2005, @05:45AM (#13420191) Journal

    From their results, I'd venture a guess as to the underlying algorithm:

    Each song is given a number of points equal to (rating + 1). Then the probability of the song being played is (song rating)/(total points).

    Or, to put more succinctly:

    prob(song) = (rating)/(n + sum(i=1..n)(rating(i)))

    That yields probabilities in the given test case of:

    5 star - .285
    4 star - .238
    3 star - .190
    2 star - .143
    1 star - .095
    0 star - .048

    Which is reasonably close to what the author found. Heck, if I were implementing that feature, it's what I'd try first...

    • Re:Underlying formula (Score:5, Interesting)

      by ciroknight (601098) on Sunday August 28 2005, @06:07AM (#13420239)
      Your decimals look more like the pricing model than the weights for playing songs..

      5 star - .285 -- $299, iPod (full?) 20gb
      4 star - .238 -- $249, iPod mini 6gb
      3 star - .190 -- $199, iPod mini 4gb
      2 star - .143 -- $149, iPod shuffle 1gb
      1 star - .095 -- $99, iPod shuffle 512mb
      [ Parent ]
      • the REAL underlying formula (Score:5, Interesting)

        by Bert690 (540293) on Sunday August 28 2005, @12:37PM (#13421427)
        OK, after a bit more thinking, you were indeed very close. It appears the actual formula is:

        points(0 stars)=1
        points(1 stars)=3
        points(2 stars)=4
        points(3 stars)=5
        points(4 stars)=6
        points(5 stars)=7

        probability(X stars) = points(X stars) / 26

        This yields the following probabilities, listed along side the observed values from the article along with 95% condience intervals.

        p(5 star)=.2692 [.270 +- .0038]
        p(4 star)=.2308 [.230 +- .0036]
        p(3 star)=.1923 [.189 +- .0033]
        p(2 star)=.1538 [.154 +- .0031]
        p(1 star)=.1154 [.118 +- .0027]
        p(0 star)=.0385 [.039 +- .0016]

        As you can see each computed probability falls within the 95% confidence interval, so there's a good chance this is the correct forumla.

        Boy do I have too much time on my hands today.

        [ Parent ]
  • Why Assume a Bell Curve? (Score:5, Insightful)

    by TubeSteak (669689) on Sunday August 28 2005, @05:46AM (#13420195) Journal
    Seriously, on what basis is he assuming a bell curve of preferences?

    You'd think, with iTunes, that people would be buying music they like (a four or five rating) in a much higher proportion than music they'd rate as a three.

    Then there's music added from your own collection. Maybe its just me, but my preferences tend to be stronger than -, 1, 2, 3, 4, 5.

    I usually go through my music collection on a regular basis and delete crap that I don't listen to, which is usually anything less than a three, and definitely a - or a one.

    And is 4334 just a random arbitrary # of songs to use?
    (when you add up X0 through X5)

  • by Fr4ncis (763671) on Sunday August 28 2005, @05:48AM (#13420198) Homepage
    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 almost guarantee they will be played again within the next 50 songs and show a 50% chance they will play again within the next 25 songs. It's simply the mind's tendency to find a pattern that makes you think iTunes has a preference.

    A way to calculate the odds that 2% will be played in the next 50 songs doesn't work 50* (2/100) = 100% as the author does, and neither 25*(2*100) = 50% is correct.

    The correct calculations are: 1-(98/100)^50 = 63% and 1-(98/100)^25 = 39%.
    This way you calculate the odds a song will be played at least once in the next 50 or 25 songs.

    If you want to calculate the odds the song will be played exactly once in the next 50 or 25 songs:

    50 * (2/100) * ((98/100)^49) = 37% or 25 * (2/100) * ((98/100)^24) = 31%.

    I guess that's all..
  • From the article...trick of the mind (Score:4, Informative)

    by djupedal (584558) on Sunday August 28 2005, @05:50AM (#13420202)
    For those too lazy to go read for themselves...

    "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 almost guarantee they will be played again within the next 50 songs and show a 50% chance they will play again within the next 25 songs. It's simply the mind's tendency to find a pattern that makes you think iTunes has a preference."
  • Modal Music (Score:5, Interesting)

    by Johnny Mozzarella (655181) on Sunday August 28 2005, @08:35AM (#13420572)
    A friend of mine who worked at a radio station that played a very diverse range of music told me how they select music.

    She said that research had shown that listeners would rate the same song higher if it followed other song of a similar genre. If they play songs of different genres randomly the listener does not enjoy the music as much.

    So their tendency is to play "blocks" of music.
    For example....
    4 Classic Rock songs
    3 Blues Songs
    3 Folk songs
    4 Female Rockers
    3 Grunge
    etc.

    This is common knowledge in the radio world. I wonder if Apple has incorporated this type of logic into it's iTunes algorithms?

    The radio station in question is WXPN and can be found under iTunes > Radio > Public > WXPN
  • something i've noticed (Score:5, Funny)

    by macsox (236590) on Sunday August 28 2005, @10:37AM (#13420977) Journal
    there definitely seems to be some time-based randomness in the selection of tunes. often, i'll hear a song pop up randomly on my ipod in the car on the way into work, and then the song come up again, randomly, while being played on itunes at my desk.
  • Crunching the math on Slashdot (Score:5, Interesting)

    by AlpineR (32307) <wagnerr@umich.edu> on Sunday August 28 2005, @06:02PM (#13423019) Homepage
    Nice analysis of iTunes. I'm somewhat surprised at the small difference in play frequency between 3, 4, and 5 stars; and disappointed that unrated songs are almost never played. In my collection, unrated means that the music is new to my collection. I think 1 star should be the kiss of death, not a blessing upon a previously unrated song.

    But all this talk of 0, 1, 2, 3, 4, 5 has me thinking of another rating system. Would anybody care to do an analysis of the ratings in Slashdot comments? What are the relative populations (I expect a ton of 2's but how about the rest)? Do comments made in the first hour after a story is posted stand a better chance of reaching +5 than comments made later in the day?

    One of my gripes about the Slashdot comment system is that it discourages contemplation and discussion. Comments made more than 24 hours after a story is posted are rarely read and almost never moderated. This is in contrast with comments system like Usenet or other bulletin boards, where threads can remain lively for weeks.

    AlpineR

    • Re:I am not sure I see what he sees (Score:5, Informative)

      by jim_v2000 (818799) on Sunday August 28 2005, @04:56AM (#13420087)
      I think his point was that with a random order, it is possible for the same song to play twice in row. Not likely, but possible. He then goes on to say that people sometimes try to find patterns where there are none...which is correct. iTunes just happened to play the same song twice randomly.

      [ Parent ]
    • that sucks (Score:5, Funny)

      by Anonymous Coward on Sunday August 28 2005, @04:59AM (#13420094)
      I can't tell you how many Christian record stores I'm permanently banned from.

      [ Parent ]
    • Re:iTunes is a monopoly (Score:5, Insightful)

      by PaulusMagnus (797138) on Sunday August 28 2005, @07:15AM (#13420362)
      Reads just like one of those anti piracy adverts the MPAA forces us to watch at the movies, or that FACT in the UK put on their DVDs.

      Piracy happens because technology happens. We pirate music because it's easy to copy and considerably less than buying it. We don't pirate books because it's frankly too expensive in photocopying charges but there's a whole collection of pirated PDFs out there, if you care to look.

      Technology changes the world we live in. I don't recall the Horse & Cart Association of America (HCAA) suing people that moved to cars which put them out of business. I also don't recall the MPAA or RIAA suing Intel, IBM or Microsoft for giving us these tools that enable us to pirate music.

      If piracy destroys the music business, so be it. Technology often destroys antiquated business models whether it's children cleaning chimneys, horse drawn carriages, coal mining or farming by hand. These people need to find a business model that works. An artist only makes around 5% from every track sold, the label and distributors cream off the rest. That's unfair, IMO.

      Why do we also need to have movie distributors for every corner of the world bidding for the distribution rights? Are we not one global market?

      I think it's about time that the movie and music industries were overhauled as they've had way too much power and too much of a monopoly for too long. After all, we're not killing people here with this technology, we're just changing lives. We're just hurting the profit margins, I thought this is what happened in a capitalist and democratic society. Why do we in the Western world create these societies with freedom to innovate and freedom to make money but then try to shackle them when it starts to backfire?

      Bring on the technology, lets keep changing the world!!!
      [ Parent ]