For a playlist of length n, the probability that the xth song will be a repeat of a previously played song is given by
{[n!/(n-x+1)!]/n^(x-1)}[(x-1)/n] for n ≥ x
and [P(x-1)]/(x-2) for n < x
If we graph this equation for n=18, we find that x=5 returns the greatest value, and thus it is more likely that it will be the 5th song than any other single song. (I think you could use the second derivative or something to find out the same thing, but we haven't gotten that far yet in Calculus)
How I arrived at my answer:
I started with n=4
[TABLE="width: 500"]
[TR]
[TD]x[/TD]
[TD]P(x is a repeat given there haven't been any repeats yet) = c[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]0 already-played songs to repeat / 4 total = 0/4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1 already-played songs to repeat / 4 total = 1/4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2/4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3/4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4/4[/TD]
[/TR]
[/TABLE]
But that assumes that none of the previous songs have been repeats. Thus, to find the probability the xth song will be a repeat, we need to multiply c by the probability none of the previous have been repeats (d)
so:
[TABLE="width: 500"]
[TR]
[TD]x[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]undefined? (there were no previous songs)[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4/4=1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4/4*3/4=3/4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4/4*3/4*2/4=3/8[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4/4*3/4*2/4*1/4=3/32[/TD]
[/TR]
[/TABLE]
[TABLE="width: 500"]
[TR]
[TD]x[/TD]
[TD]c*d = P(x)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]0/4*1=0[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1/4*1=1/4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1/2*3/4=3/8[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3/4*3/8=9/32[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1*3/32=3/32[/TD]
[/TR]
[/TABLE]
But of course this only works with 4 songs. To extrapolate to 18 songs, we need to formulate an equation to describe n=4 that will apply to all values of n.
We continue to separate c and d, because the equation for c is very easy: (x-1)/n.
So what's the equation for d? It definitely has something/n^(x-1) because we see in the table for d that we are always multiplying by a number of fractions with n in the denominator equal to x-1. The numerator, then, is n!/(n-x+1)!
That's how I arrived at {[n!/(n-x+1)!]/n^(x-1)}[(x-1)/n]
I noticed it didn't work for values where x>n, so I generated another equation to solve those values.
any questions?
EDIT: so apparently everyone else understood it to mean the value of x at which the sum of x and all smaller values of x is greater than .5, which I also calculated and found to be 6 using my equation, but the way the question was worded, I thought we were supposed to find the single value of x which had the highest probability of being the first repeat. I used the graph on
this page to find that value