This was the proof that user T_M kindly submitted to me about why the expected number of times a result comes up when you are, say, rolling a die is equal to $P(\text{result}) \times\text{Number of trials}=np$.
\begin{align} \mathbb{E}(X) &= \sum_{k=0}^n \binom{n}{k}p^k(1-p)^{n-k} k \\ &= n p\sum_{k=1}^n \frac{(n-1)!}{(k-1)!(n-k)!}p^{k-1}(1-p)^{n-k} \\ &= n p\sum_{j=0}^{n-1} \binom{n-1}{j}p^{j}(1-p)^{n-1 -j} \\ &= n p\bigl(p + (1-p)\bigr)^{n-1} \\ &= np. \end{align}
And here is what I responded with in the comments:
Thanks for responding. I don't quite understand your answer. So when you used $j$ instead of $k$ in your proof, presumably $j=k-1$, right? Also, could you please justify going from the second line to the third line (I don't know why the top number on the sigma symbol changes from $n$ to $n-1$.)
Additionally, I am a little confused by the justification for going from the third line to the fourth line. I'm not sure I understand how to simplify $\binom{n-1}{j}$.
Yes, from the second to third line, the user shifts indices by setting $j = k - 1$. They change the summation variable to make it clear. This is a common technique when evaluating summations.
The top of the summation changes because, as you pointed out, we are setting $j = k - 1$. When $k = n$, we require $j = n - 1$. Note that the bottom index changes in a similar manner.
Essentially, we are just "shifting" our indices.
If you are familiar with integration, you can think of this as being analogous to a $u$-substitution (the bounds of integration change when you perform a $u$-substitution as well).