Let's consider the following experience : we throw two dices till same number on two dices appears. I want to calculate expected sum of all dices appeared.
My work so far
I wanted to do it (and also I found it very intuitive) to do it by wold's decomposition theorem. The sum then will be presented by formula $E[S_n]=E[T]E[X_1]$, where $T$ is the stopping time.
How to calculate $E[T]$ ?
$P(Y=1)=\frac16$
$P(Y=2)=\frac56 \cdot \frac16$
$P(Y=n)=(\frac{5}{6})^{n-1} \cdot \frac16$
So :
$$E[Y]=\sum_{i=1}^\infty i \cdot P(Y=i)=1 \cdot \frac16 +2 \cdot \frac56 \cdot \frac16+...$$
And it's type of series $\sum_{i=1}^{\infty} i(1-p)^{i-1}p$ where $p \in [0,1]$ and this sum equals to $\frac1p$. So my sum above equals to 6 and that's exactly $E[T]$
why it would be good to use wold's theorem? Because it's very easy to calculate either $E[X_1]$ or $E[T]$ (calculated above). However, I don't know how should I define set $T=\inf\{...\}$ that will show that equality $E[S_n]=E[T]E[X_1]$ holds. I'm not sure how to strictly justify it.
One way is to just manually take all sums. The first part is where all of them are equal sums, the second is where one of them is $1$ and other is between $2$ and $6$, so on..
The last part is for the rolls to continue with $\frac{5}{6}$ probability.
It can surely be optimized but given it is just two dice, this works.
$E(X) = \displaystyle \frac{1}{36} (2 + 4 + 6 + 8 + 10 + 12) + \frac{2}{36}(3 + 4 + 5 + 6 + 7) + \frac{2}{36}(5 + 6 + 7 + 8) + \frac{2}{36}(7 + 8 + 9) + \frac{2}{36} (9 + 10) + \frac{2}{36}(11) + \frac{5}{6}E(X).$
$E(X) = \displaystyle \frac{42}{36} + \frac{50}{36} + \frac{52}{36} + \frac{48}{36} + \frac{38}{36} + \frac{22}{36} + \frac{5}{6}E(X)$
$E(X) = \displaystyle \frac{252}{6} = 42$.