# Consider the experiment of rolling a fair die independently until the same number/face occurs 2 successive times and let X be the trial on which the repeat occurs, e.g. if the rolls are 2,3,4,5,1,2,4,5,5, then X=9. a. find the probability function f(x)=P(X=x). b. compute EX

MathJax(?): Can't find handler for document MathJax(?): Can't find handler for document Consider the experiment of rolling a fair die independently until the same number/face occurs 2 successive times and let X be the trial on which the repeat occurs, e.g. if the rolls are 2,3,4,5,1,2,4,5,5, then .
a. find the probability function $f\left(x\right)=P\left(X=x\right)$
b. compute EX
You can still ask an expert for help

• Live experts 24/7
• Questions are typically answered in as fast as 30 minutes
• Personalized clear answers

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

ehedem26
Step 1
This is basically a geometric distribution. At each step, independent of whatever happened previously, you have a 1/6 chance of rolling the same as you did on the previous try. You keep going until you get a success, and you are counting the number of tries until a success. Let's call this random variable Y.
Step 2
Now here comes the only twist: You start not on the first try (on which it is impossible to duplicate a previous roll), but on the second. So X is one more than Y, hence ${f}_{X}\left(t\right)={f}_{Y}\left(t-1\right)$, and $E\left(X\right)=E\left(Y+1\right)$
###### Did you like this example?
Marilyn Cameron
Step 1
You could solve this directly, expressing your answer as a sum of the form $\sum _{n=2}^{\mathrm{\infty }}nP\left[X=n\right]$. And, with a bit of work, you could evaluate the sum explicitly (using the formula for the sum of a differentiated geometric series; see, e.g., the ideas here)).
The expected value is $\sum _{n=2}^{\mathrm{\infty }}n\left(5/6{\right)}^{n-2}\left(1/6\right)$. One can show this sum has value 7.
Step 2
Or, you could find the expected value by conditioning on the result of the second roll:
Let X be the number of rolls to obtain the same result twice in a row. Let Y be the event that the second roll is the same as the first. Then
$\begin{array}{rl}\mathbb{E}\left(X\right)& =\mathbb{E}\left(X\mid Y\right)P\left(Y\right)+\mathbb{E}\left(X\mid {Y}^{C}\right)P\left({Y}^{C}\right)\\ & =\mathbb{E}\left(X\mid Y\right)\cdot \frac{1}{6}+E\left(X\mid {Y}^{C}\right)\cdot \frac{5}{6}.\end{array}$.
Step 3
But $\mathbb{E}\left(X\mid Y\right)=2$ and $E\left(X\mid {Y}^{C}\right)=\mathbb{E}\left(X\right)+1$ (here, it's as if you started playing the game at the start again on the second roll). So
$\begin{array}{rl}\mathbb{E}\left(X\right)& =2\cdot \frac{1}{6}+\left(\mathbb{E}\left(X\right)+1\right)\cdot \frac{5}{6}.\end{array}$
Solving the above for E(X) gives $\mathbb{E}\left(X\right)=7.$