I'm trying to understand how linearty of expectation works and I've come accross this example on an article on brilliant.org.
Right after they state the theorem on the linearity of expectation. There is an example, and I don't really understand it at all.
I understand why there is a 1/6th probability that the next roll is a 6, and a 5/6th probability that the next roll will produce a number other than 6. But how did they arrive at the following
$X_n$ is the random variable that represents the number of rolls required to get $n$ consecutive sixes.
In order to get $n$ consecutive sixes, there must first be $n-1$ consecutive sixes. Then, the $n^{th}$ consecutive six will occur on the next roll with $1/6$ probability, or the process will start over on the next roll with $5/6$ probability.
$$\text{E}[X_n]=\text{E}\left[\dfrac{1}{6}\left(X_{n-1}+1\right)+\dfrac{5}{6}\left(X_{n-1}+1+X_n\right)\right]=\text{E}\left[X_{n-1}+1+\dfrac{5}{6}X_n\right]$$