# iPod Shuffle question

Suppose I had an iPod with x number of songs. Suppose one of them is my favourite song. I hit the shuffle button, so a random song plays. If it is not my favourite song, after the song ends, I will move on to the next song in the (shuffled) sequence. If it is my favourite song, after the song ends, I will hit shuffle it again (note that when a playlist is shuffled, each song will be played only once in a random order). This process keeps repeating itself.

What is the average probability per song played that it is my favourite song? Any ideas to the approach of this problem?

• Please replace "iPod" by "MP3 player" or "tracklist". Dec 16 '14 at 15:11
• Not really related to your question (I think you care more about general probability than anything else) but shuffle features on apple things (and I assume probably other music stuff too) isn't actually random dailymail.co.uk/home/moslive/article-1334712/…
– user171177
Dec 16 '14 at 15:39

The average number of songs in a cycle is 1(the favourite) plus half the others, an extra $(n-1)/2$, or $(n+1)/2$ in total.
The probability that the favourite is playing is the reciprocal of that, or $2/(n+1)$, as Arthur said.
For a single playthrough on shuffle, you will wait, on average, $(x-1)/2$ songs for your favorite song to play (half of the songs that aren't your favorite). That is, if $X$ is a random variable representing the number of songs until your favorite song plays, $E(X)=(x-1)/2$. The expected value operator $E$ of random variables is linear, so $E(X_1+X_2)=E(X_1)+E(X_2)$ and $E(X/2)=E(X)/2$.
This means that for $n$ trials (shuffle playthroughs) with results $X_1, X_2,\ldots,X_n$ the expected number of songs to wait is $$E\left(\frac{X_1+X_2+\ldots+X_n}{n}\right)=\frac{E(X_1)+E(X_2)+\ldots+E(X_n)}{n}$$ In other words, the expected value of the average of random variables is the average of the expected values of the variables. Since every shuffle playthrough has the same expected value ($(x-1)/2$), the average of many playthroughs will have an expected value of $(x-1)/2$ as well.
Since there will be an average of $(x-1)/2$ non-favorite songs between favorites, you will have an average of $(x-1)/2+1=(x+1)/2$ songs including favorites. Therefore, the odds of any particular song being your favorite are $2/(x+1)$.