Roll a pair of 6-sided dice. $S=$ total score. What is the expected number of pair-rolls to get the same value of $S$ consecutively? Roll a pair of unbiased 6-sided dice.
Let $S=$ total score. So the possible values of $S$ are 2, 3, 4, ..., 12.
Let $X$ = number of pair-rolls up to and including the first time we get the same value of $S$ consecutively.
For example, if the values of $S$ are {9, 7, 12, 3, 8, 5, 5} then $X=7$.

Question: What is the value of $E(X)$?

What makes this question difficult for me is that the values of $S$ have different probabilities, so I cannot directly use a geometric distribution. And I have not been able to find a useful recurrence relation.
I made a simulation on excel with 1000 trials, and $E(X)$ seems to be approximately $10$.
(Context: No special context; I've been looking at various questions involving dice n MSE, and I came up with this question.)
 A: There's a quite a nice way of calculating this based on the technique in David Williams Probability with Martingales
Firstly, for every $i\in [2..12]$ let $p_i$ be the probability that $S = i$ so $p_2 = \frac 1 {36}, p_3 = \frac 2 {36} \dots p_{12} = \frac 1{36}$.
Now let $s_i = \frac{p_i^2}{p_i+1}$.
Now get yourself 10 friends and let's go to a casino.
My casino is great, we only have one game "dice roulette".  But there's no house edge.  To play you choose a number $2 \leq i \leq 12$, and place a stake of value $s$. I'll throw 2 dice, if you get it wrong I'll take your stake, if you get it right I'll pay you $s\times\frac{1 - p_i}{p_i}$ plus your original stake.  (so if you place £1 on 2 and win you'll have £36 in total).  This means the game is completely fair.  No matter what bet you place on average you'll always have exactly the same amount you started with.
Now you and your 10 friends pick one number each. Every bet each of you stakes $s_i$ on the number $i$.  So exactly one of you will win each time.
Whoever wins will let the winning amount ride and bets another $s_i$ on top of it.  If someone wins twice in a row you all stop gambling and collect your winnings.
So let's suppose player $i$ wins after $n$ rounds.  Every player ($j$) except the winner has lost a total of $n\times s_j$. The eventual winner has gambled $n\times s_i$ but has won $\frac {s_i}{p_i} + \frac{s_i}{p_i^2} = 1$ So as a group your total profit is $1 - (n\times\sum_{i=2}^{12} s_i)$.
But this is a completely fair game.  There's no gambling strategy that can make or loose money.  Which means $\mathbb E\left(1 - n\sum_{i=2}^{12} s_i\right) = 1 - \mathbb E(n)\sum_{i=2}^{12} s_i = 0$
That gives you $\mathbb E(n)= \frac 1{\sum_{i=2}^{12} s_i} \approx 9.992$.
So you're right, it's very close to 10.
