[Math] Probability Question – Mp3 player chooses songs

probability

A mp3 player contains 10 different songs in its memory and chooses songs randomly (every choice is independent on the previous choices).

Let X be the number of songs one will hear until the first time (including this time) the same song will be chosen twice in a row .

A. Write the probability function of X

B. What is the expectation of X?

My attempt:
I am not quite sure, but this is what I thought:
First , $max(X)= 10 $ . So all I need is to calculate the probability $p$ of choosing the same song twice in a row and then in A, $P(X=k)=Geometric(p)$ .

Is the following calculation correct?
$$
P(X=k)= \frac{9\cdot 8 \cdot …\cdot (9-k+2) }{10^k}
$$

But how can I relate this to a geometric distribution that will allow me to calculate part B ?

Thanks in advance!

Best Answer

The random variable $Y=X-1$ will be geometric with parameter $0.1$. (You can't get a match on the first song; but after that, the probability of a match with the immediately previous song is $0.1$ on each trial.)

So $P(X=x) = 0.9^{x-2}\cdot 0.1$ for $X = 2, 3, 4, \dots$

And $E[X]=1+E[Y]=1+\frac{1}{0.1}=1+10=11$