# Independent die roll

#### ITman95

##### New Member
Hi i have this problem, where a fair die is rolled until the same number occurs 2 successive times. Let X be the trial on which the repeat occurs, X=10 find f(x)=p(X=x)

For example, 1,2,3,4,5,6,1,5,3,3

I'm thinking the answer is as follows:
f(x)=P(X=x)=1/n for i=1,2,….,n
Ans: X=10=n=1/10

am i correct or absolutely incorrect heh ?

#### Dason

##### Ambassador to the humans
consider the sequence 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9

It hasn't had the same number 2 success times but goes much longer than what you have listed as the max (10)

#### ITman95

##### New Member
Dason, why do you speak in code ? heh im not following you

#### Dason

##### Ambassador to the humans
There is no code there. It was a simple example showing you that you "solution" couldn't be correct.

#### ITman95

##### New Member
The question states that the expiriment doesnt surpass 10 rolls and that the repeat happens on the 10th roll so how am i wrong ?

#### asterisk

##### New Member
P(x=1) = 0 (You can't roll the same number twice in one roll)
P(x=2) = 1/6
P(x=3) = 5/6 * 1/6
p(x=4) = (5/6)^2 * 1/6

#### ITman95

##### New Member
So
p(X=5)=(5/6)^3*1/6
p(X=6)=(5/6)^4*1/6

And so on ?

#### ITman95

##### New Member
So basically I employ formula:
P(x=m)=q^(m-1)*p ?

#### BGM

##### TS Contributor
Do you understand the rationale behind? How do asterisk come up with that answer?

If yes you should not in doubt.

#### ITman95

##### New Member
I dont understand what you mean "if yes you should not in doubt" but the number after the asterisk is the probability of rolling any number on a die, 1/6 since there are 6 numbers on a die.

My question is why are we using 5/6 ? this is the probability that any OTHER different number is rolled right

Last edited:

#### asterisk

##### New Member
1/6 is the probability of matching the previous roll. (stop rolling)
5/6 is the probability of not matching the previous roll. (continue rolling)

This is basically a negative binomial distribution, except on the first roll probability of stopping = 0 and the probability of continuing is 1.

$${k + r -1}\choose{k}$$$$* (1 - p)^r * p^k$$

where

r= number of failures = 1
k $$\in$$ {1,2,3 ... } = number of successes
p = probability of success = 5/6
(1 - p) = probability of failure = 1/6

By convention we usually call the stopping event (rolling the same number twice in a row) a failure. It may seem more natural to call this a success, but it just means the stopping event.

Because r=1 the first term simplifies to $${k + r -1}\choose{k}$$ = $${k}\choose{k}$$ = 1

So so for P(X = 10) we need

SSSSSSSSSF = $$1 * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{1}{6}$$

#### ITman95

##### New Member
I think you made a mistake wouldnt p(x=1)=1/6 and p(x=2)=(5/6)*(1/6) and p(x=3)=(5/6)^2 * (1/6) and so on so that its P(X = x) = (5/6)(x-1) × (1/6) or is this just in the case where if you are looking to roll a specific number for example a 5 instead of a repeat which is whats asked in the question ?

Last edited:

#### asterisk

##### New Member
I don't see how p(x=1) could equal 1/6.

How could you roll the same number twice on the first roll? Unless you are not counting the first roll... then it is just semantics.

#### ITman95

##### New Member
alright i was just confusing my self with another problem thats all. Thank you for your help asterisk.