Rolling an $n$-sided die until repeat is found Problem: We are rolling an $n$-sided die. You roll until you reach a number which you have rolled previously. I need to calculate the probability $p_m$ that we have rolled $m$ times for such a repeat.
My first thought was to try some inputs. I took $n=6$. I noticed that when $m=1$, we will always get a probability of $0$, since you are only rolling one time. Also, for $m>7$, we will also have $0$, since we will never reach that case. Now, I don't get how to find a general formula for when $1<m<8$

the first roll does not matter, the second roll, since you dont want it to have the same number as the first, then the prob is $\frac{n-1}{n}$, so does for the third, forth, and so on until the $(m-1)$th roll. And for the last, because you want it to have same number, the probability is $\frac{1}{n}$. Hence, the answer is $\frac{(n-1)^{m-2}}{n^{m-1}}$.
