[Math] the probability that a song will be played twice in a row when the music player is set to random?

probabilityrandomstochastic-processes

Problem : In a music player, if it is set to shuffle (random), will a song be played twice in a row? If so, what would the probability be?

Example: Take Spotify. Suppose I have $100$ songs in my downloads. And I'm listening to the songs in shuffle. It is in shuffle, so any song can play RANDOMLY, even the same song, twice. My question is, What is the probability that the same song will play twice? And the music player won't block a song from playing twice. It's completely random.

Best Answer

I would assume that a music player would leave out the previous track in the selection for the next track under normal circumstances. In this case the probability would be 0.

Otherwise, you have probability of $\frac 1N \frac 1N=\frac 1{N^2}$ to choose a particular song twice in a row and because there are N songs you have probability of $\frac N{N^2}= \frac 1N$ to choose any song twice in a row.