# Amarok and my Stats Fail

So, as I mentioned before, I wanted to try and make sure to get mostly unheard music on my random playlist so I could go through all my music.  So I put in a bias to make sure that there was an 80% that the next song picked was unplayed.  I started getting even more played music showing up than before!  I was baffled!  Then I realized it was my piss-poor understanding of statistics at fault.  Telling it that there should be an 80% of the music selected having never been played is equivalent to saying there should be a 20% change that the music selected should have been played before.  What the heck is going on?  So, if you look at my collection – when I moved to KDE 4, it lost the previous stats.  So all of my music was unplayed.  Let’s say I have 10,000 songs.  So when I tell it to randomly play music (with no bias), there’s, at first a 0/10,000 chance of a played song coming up.  After that, there’s a 1/10,000 chance of a previously played song showing up.  After a day, there’s a 26/10,000 chance of a played song coming up.  So because of randomness I could end up with previously played songs.  Stats only tell us what will happen in the long run.  In 10 flips of a coin you could get 10 heads.  But in infinite flips you should get half of them heads and half tails.  26/10,000 = 0.26% chance of a previously played song coming up.  So, when I set the bias so that theres a 20% of the songs that come up will have been played, I’m greatly increasing my changes of hearing a song again vs just leaving it on random!  At least for now.  Once I’d listened to most of my collection, it should flip.  There will be so many previously played songs that those will be random enough to satisfy me.  Right now not enough of them have been played relative to my collection’s size so the same ones keep coming up.

Unless I’ve gotten it all wrong again….