In: Statistics and Probability
Someone is listening to a playlist of 100 songs on an original iPod, and it is programmed to play in random order. Sometimes the same song would play twice in a row; many people thought the iPod was broken. What was the problem?
There was no problem with the iPod. Since the iPod was using a random number generator algorithm in order to shuffle through the songs, therefore it is very likely that the random number generator selected the same song as the earlier one. Maybe the random number generator algorithm used in iPod is some Pseudo-random number generator, and it cannot be guaranteed that same numbers would not repeated by using such an algorithm. For example - every one of the 100 songs were assigned a random digit, then the generator shuffled through the playlist, selecting a random digit and playing the song corresponding to that digit. The same digit can come successively which will lead to the same song being played. Ideally, a conditional loop should have coded along the random number generator to ensure that the same song is not repeated successively.
Let me know in the comments if anything is not clear. I will reply ASAP! Please do upvote if satisfied!