If we roll a fair die $n \ge 1$ times and we say that for $i \ge 2$ the $ith$ roll is a copy if the result is the same as the $(i−1)th$ roll. If we take for example the sequence $11433$ and the second and fifth rolls are copies. Let $C_n$ denote the number of copies.
I have to compute $E[C_n]$ and $E[C^2_n]$, where $E$ stands for the expectation.
Any help would be grateful because I do not know where to start.
Write $C_n$ as $X_2 + X_3 +\cdots+X_n$ where $$X_i=\begin{cases}1&\text{if roll $i$ is a copy}\\0&\text{otherwise}\end{cases}$$ (Roll $1$ can never be a copy.) So by linearity $$ E(C_n) = E(X_2 + X_3 + \cdots + X_n) = E(X_2) + E(X_3) + \cdots + E(X_n). $$ How to calculate $E(X_i)$? Since $X_i$ takes value either $1$ or $0$, $$ \begin{aligned} E(X_i) &= 1\cdot P(X_i=1) + 0\cdot P(X_i=0) \\&= P(X_i=1)\\ &=P(\text{roll $i$ is a copy}). \end{aligned} $$ Now roll $i$ is a copy exactly when roll $i$ agrees with whatever roll came before it, so this last probability is $\frac16$.