# Tossing a die till a number recurs.

1. Apr 14, 2013

### peripatein

Hi,
I would like to confirm my answer to the following question in Statistics. Hopefully one of you will be willing to provide some feedback.

1. The problem statement, all variables and given/known data
A die is tossed repeatedly, until a result (1-6) equal to one of the preceding results is obtained. For instance, (3,2,4,2) is a series of tosses halted at the fourth toss (as only after that toss has a number recurred). X denotes the number of tosses till 'success' is obtained. The question asks for the probability function of X.

2. Relevant equations

3. The attempt at a solution
I wasn't sure how to come up with a general formula for P(X), but I did manage to derive the following, which, hopefully, is correct:
P(X = 2) = 1/6
P(X = 3) = (5/6)(2/6) = 5/18
P(X = 4) = (5/6)(4/6)(3/6) = 5/18
P(X = 5) = (5/6)(4/6)(3/6)(4/6) = 5/27
P(X = 6) = (5/6)(4/6)(3/6)(2/6)(5/6) = 25/324
P(X = 7) = 5! / 6^5 = 5/324

Is it correct? How may I come up with a general formula for P(X)? I'd appreciate any comments and your assistance.

Last edited: Apr 14, 2013
2. Apr 14, 2013

### Ash L

I'm a novice here.

Wouldn't P(X = 2) = 1/6 * 1/6 = 1/36 ?
Since you have to toss 2 times and the result obtained in the second toss has to be the same as the first toss.

3. Apr 14, 2013

### LCKurtz

No, his numbers are correct. It doesn't matter what the first toss gives. Once it has been done, there is 1/6 probability of the second toss matching it

4. Apr 14, 2013

### peripatein

But you have a probability of 1 to obtain any number between 1-6, and then a probability of 1/6 to obtain the same number when you toss it the second time. That's my rationale in any case.

5. Apr 14, 2013

### peripatein

I didn't see your post, LCKurtz, when I wrote that. Sorry.
Are all the numbers in my answer correct, i.e. for all values of X? Moreover, is there a way to derive a general formula?

6. Apr 14, 2013

### LCKurtz

No problem, that happens all the time. I worked it a different way and got the same answers you have. Dunno about a general formula. Do you really need one?

7. Apr 14, 2013

### Ash L

Oh ok, I misread the question.

8. Apr 14, 2013

### peripatein

Possibly not, I simply presumed it might be feasible to derive one and work it out more elegantly by sheer substitution for X.

9. Apr 14, 2013

### Dick

It's easy enough to work out a recursive strategy. P(n) is the probability you haven't already stopped (so one minus the sum of the previous P(i)) times the probability of matching (n-1)/6.

10. Apr 14, 2013

### LCKurtz

Yes, they are correct. Your own pattern can be written as$$P(X=k)=\frac{5!(k-1)}{6^{k-1}(7-k)!}$$for $k=1..7$.