[All Platforms][Playlists] Shuffle of (any) list should be random and complete

I started to use shuffle on tracks in an album and found that at the third shuffle of my tracks on my first album, the same track is selected again. That's too much of a coincidence and shows that it's random (good) but not shuffled (better). It has been commented on before that the shuffle is really a random selection.

 

Consider, if you ask most people what they mean by "shuffling a pack of cards", they will say that the order is randomised so that all 52 cards can be drawn in a random sequence. So, getting the "Ace of Spades" several times with 52 cards chosen would be an "error" and getting all the cards after selecting 52 is “good” or if selecting the first 10 cards, they are all different (also “good”).

 

They would also say the concept is equally valid with any chosen sequence of tracks e.g. in Spotify e.g. Ace of Spades equates to track 3 (again).

 

I did however notice that when selecting the next shuffled track, that the sequence can be reversed e.g. 1, 5, 2, 11 becomes 11, 2, 5 and 1 again. Like a person counting cards (in Poker) this is a sign that a "chosen" list is being maintained - that's a good thing.

 

I hope to show later that "best" is a simple algorithm that is easily understood, cheap (in computing terms) to implement and "pleasing" in the outcome especially if it "improves" on the previous solution.

 

To solve a problem, you need an effective algorithm. So, the point of the rest of this post is to show how simple it can be - in the hope that it will be implemented. It's not to show an optimal solution - just that it's really not too difficult. 

 

For something as simple as shuffling a deck of cards (or tracks) on an album - you simply have to select a random card (or track) and move it from a "free" list to a "chosen" list. For a computer (and the programmer) this is a trivial thing to do.

 

If the list of tracks, like the counting of cards, is for a larger selection e.g. 50 packs of cards then, for a computer, that's not a problem. However, it may be appropriate to limit the "chosen" list to a limited number e.g. 512. That's because most users will have either forgotten that the track (or card) has repeated or may be willing to accept it repeating after such a long sequence. In my experience a repeat with an apparent list of 2 (or 3) is too short!

 

FWIW the "free" list is also anything not in the "chosen" list and that's important if the lists are too big e.g. a 100,000,000 "free" list need not be stored when the "chosen" list is limited e.g. to 512 because not being in the "chosen" implies it's also in the "free" list (which may not be stored). This means that the simple algorithm can be implemented with limited "cost" - no longer is this a problem with mobile devices (plenty of memory) but you aim for perfection and accept quality (often). In computer terms any list is really a list of pointers (or hashes) to something else e.g. entries in a database - so the "relative cost" of holding a “chosen” list can be minimised.

Child Item
Status: Active
Child Item
Child Item
Child Item

Comments

Updated on 2019-09-02

Hey @Simon_M2 

 

The shuffle function discussion is located here, and only one thread can exist per idea:

 

https://community.spotify.com/t5/Implemented-Ideas/Implement-an-actual-shuffle-function/idi-p/27607

 

Regardless of status, please vote for it, and add a comment there, so it may be improved. Any update on the matter should be posted there.

 

You might find this article interesting too.

 

Please check this related Ideas too:

 

https://community.spotify.com/t5/Live-Ideas/Shuffle-Prioritise-certain-songs-in-a-playlist/idi-p/4567602

 

https://community.spotify.com/t5/Live-Ideas/Playlists-Shuffle-playlist-remember-what-song-was-played-last/idi-p/4607010

 

https://community.spotify.com/t5/Ongoing-Issues/Connect-only-plays-100-song-chunks-of-playlists/idi-p/1284690

 

For more info on how the Ideas Board works, click here. 🙂

Child Item
Child Item