Assume you have a fair three sided die. Now roll the die, until a number repeats. What is the average number of rolls?
I know that the average is just the sum of all the numbers divided by the number of items in the set.
Assuming that we first roll a 1, I got:
(1,2)(1,3)(1,1)
(1,2,1)(1,3,1)(1,2,3)(1,3,2)(1,2,2)(1,3,3)
(1,2,3,1)(1,2,3,2)(1,2,3,3)(1,3,2,1)(1,3,2,2)(1,3,2,3)
Which is a total of 15 which I should multiply by 3 to get a total of 30 different combinations. Now to find the average what should we divide 30 by? Can anyone point me into the right direction?
We can break into cases and calculate the probability of each event.
The probability that our first repeated number occurs on the second roll is $\frac{1}{3}$, seen by the fact that the first roll can be anything and the second roll must match the first.
The probability that our first repeated number occurs on the third roll is $\frac{2}{3}\times\frac{2}{3}$, seen by the fact that the first roll can be anything, the second roll must be something that doesn't match the first roll (2 options out of 3 equally likely), and then the third roll must match either of the first two rolls (2 options out of 3 equally likely).
The probability that our first repeated number occurs on the fourth roll is $\frac{2}{3}\times\frac{1}{3}\times 1$, seen by the fact that the first roll can be anything, the second roll must be something that doesn't match the first roll, the third roll must be something which doesn't match either of the first two rolls, and the fourth roll can be anything.
Finally, we notice that it is impossible for there not to have been a match by the fourth roll by pigeonhole principle.
Now, it is just a matter of computing the expected value by adding these results after multiplying each by their respective number of dice rolls required to achieve them.
The final total is:
$$\frac{1}{3}\times 2 + \frac{2}{3}\times\frac{2}{3}\times 3 + \frac{2}{3}\times\frac{1}{3}\times 4 = \frac{26}{9}\approx 2.8888\dots$$