It’s true that we cannot generate pure random numbers, although the random.org proposes to provide true random, I wonder how they overcome the modulo division defect!
Shuffling is one technique that we use every day when playing music. Which is obviously achieved through random numbers. We have to generate random numbers n times where n is the size of the array. A naive approach to shuffle a list would be like
But the true randomness is not always favored, we need the songs to be biased based on our like. So i came up with a solution, somewhat look like this one
here the input i have taken is not same as the one before(regarding the notion). here the array is ranks of the songs based on listen count. I don’t know whether it’s an efficient but it surely does the job of playing more times the song whose listen count is more and the opposite for songs whose listen count is low. It’s MY ALGORITHM