Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering if there might be a fixed pattern/algorithm being followed by various music player for shuffling the playlist. From my guess i could figure it out that these media players uses same algorithm for shuffling. I say so that practically I have experimented the behavior of shuffle function of various players on the same playlist. Thus if this is the case then what is that algorithm?

Again If my guess is wrong and each player uses its own shuffling algorithm then how come i could get the same sequence of songs after shuffling from various players with same playlist

EDIT:

My question is to know whether all music player share a common algorithm for shuffling. if YES, then which algorithm ? if No, then how come I have got the same sequence of songs after shuffling the same playlist from my nokia mobile 5233, 5300, VLC media Player, Windows Media Player, etc.

share|improve this question
3  
The whole point is that if it is supposed to be 'random' then you shouldn't really be able to tell what algorithm is used unless you get the source code or ask the developer. There are open source media players of course. But a quick Google reveals something like this is very commonly used: en.wikipedia.org/wiki/Fisher-Yates_shuffle –  James Mar 20 '13 at 11:57
    
+1 I think you are correct. Its hard to tell exactly which is the algorithm that is being followed. And I too think that the most common algorithm is the Fisher-Yates. Thanks. Just frame it in an answer so that I can accept it. –  Mohsin Akhtar Mar 21 '13 at 5:01
    
even if the algorithms are same, the shuffle result should be random, i mean "you can't get same sequence of songs after shuffuling from various players with same playlist", or there's no need to shuffle cards when playing card games. –  LiuYan 刘研 Mar 21 '13 at 5:19
add comment

1 Answer

There are a number of different shuffle algorithms with Fisher-Yates being one of the more popular. Even if a player uses that algorithm it's implementation will depend on a number of other factors (coding language, random number support). Unless a player directly copies code from another program it will be different in implementation.

Additionally while most players 'shuffle' a playlist I've seen ones that always randomly pick the next song to play (resulting in the same song played twice in a row).

It's strange that you claim that different players 'shuffle' the same playlist in the same order. Even using the same algorithm (or same player) should result in a random playlist each time it is shuffled.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.