When “Random” Isn't So Random
I recently purchased a new car that has the ability to stream music over bluetooth or via USB. After tiring of handling the sometimes buggy bluetooth connection, I threw about 700 songs on a USB stick and left it plugged into the car. Now, if I’m too lazy to futz with a bluetooth connection I still have a subset of my music available for instant play.
Sounds great, right? Well, it is, mostly. I had arranged everything in folders by Artist and then subfolders for each album. That’s great for listening to an album straight through but not so much if I just wanted a random mix.
Enter the “Random” option
Luckily, the head-unit on this Kia Optima has a Random button. At first it seemed to do just that… randomly select tracks from the various folders and subfolders, giving me a nice mix of my music.
The more I used the feature I started noticing that the same few songs were playing far more frequently than others after I hit the random button. (The car every time the car is turned off, for some odd reason)
The system seemed to favor the very first folder, “Adam F” and his album (also the first) “Colours”. Additionally, it seemed to pick even songs from that directory.
This repeatable behavior got me thinking about randomization algorithms. Being a developer, I’ve gotten used to fairly robust and actually seemingly random randomization functions. It felt foreign to me that something that says “Randomize” actually wasn’t random. I felt cheated.
So I did what any self-respecting coder would do… start searching Google.
I’m not alone
I quickly found that other Kia owners were .
So, what’s going on here? Why use a substandard randomization function? (considered pseudo-random?)
Is it an issue with UI responsiveness and something more comprehensive would take too long?
Is it an issue with actually getting a string of organic data that can be used as a seed value? (why not use the clock?)