Help understanding the weak law of large numbers with respect to statistics
We have this sum: $$ \sum_{k=0}^n k\frac{n!}{k!\,(n-k)!}p^k(1-p)^{n-k} \tag 1 $$ First notice that when $k=0$, the term $k\dfrac{n!}{k!\,(n-k)!}p^k(1-p)^{n-k}$ is $0$, and next notice that when $k\ne0$ then $$ \frac k {k!} = \frac 1 {(k-1)!} $$ so that $$ k\frac{n!}{k!\,(n-k)!}p^k(1-p)^{n-k} = \frac{n!}{(k-1)!(n-k)!} p^k (1-p)^{n-k}. $$ The two expressions inside the parentheses in the denominator now add up to $n-1$ rather $\text{than } n.$ So we can write it like this: $$ \frac{n!}{(k-1)!(n-k)!} = n\cdot \frac{(n-1)!}{(k-1)!(n-k)!} = n\cdot \binom{n-1}{k-1}. $$ Then the sum $(1)$ becomes $$ \sum_{k=1}^n n\cdot \binom{n-1}{k-1} p^k (1-p)^{n-k}. $$ Since $n$ does not change as $k$ goes from $1$ to $n$, we can pull $n$ out, getting $$ n \sum_{k=1}^n \binom{n-1}{k-1} p^k (1-p)^{n-k}. $$ Now let $j=k-1$ and observe that as $k$ goes from $1$ to $n$ then $j$ goes from $0$ to $n-1$, and $k = j+1$, so we have $$ n \sum_{j=0}^{n-1} \binom{n-1} j p^{j+1} (1-p)^{(n-1)-j}. $$ Since $p$ does not change as $j$ goes from $0$ to $n-1$, we can pull $p$ out, getting $$ np \sum_{j=0}^{n-1} \binom{n-1} j p^j (1-p)^{(n-1)-j}. $$ Now let $m= n-1$, so we have $$ np \sum_{j=0}^m \binom m j p^j (1-p)^{m-j}. $$ This sum is $1$ since it's the sum of probabilities assigned by the $\mathrm{Binomial}(m,p)$ distribution. Hence we get $$ np\cdot 1. $$
The trick is the using the identity $k { n \choose k} = n {n-1 \choose k-1}$. $$\begin{align*} &\sum_{k=1}^n k { n \choose k } p^k (1-p)^{n-k}\\ &= \sum_{k=1}^n n { n-1 \choose k-1} p^k (1-p)^{n-k}\\ &=np \sum_{k=1}^n {n-1 \choose k-1} p^{k-1} (1-p)^{(n-1)-(k-1)}\\ &=np (p+(1-p))^n\\ &=np \end{align*}$$
Let $X_n=B(n,p)$ be a binomially distributed random variable. Also notice that $X_n=Y_1+Y_2+\cdots+ Y_n$ where $Y_i$ are i.i.d. Bernoulli with parameter $p$.
Now observe that \begin{align} \sum_{k=0}^n k\frac{n!}{k!\,(n-k)!}p^k(1-p)^{n-k}&= \operatorname{E}(X_n)\\ &= \operatorname{E}( Y_1+Y_2+\cdots Y_n)\\ &=\operatorname{E}( Y_1)+\operatorname{E}(Y_2)+\cdots +\operatorname{E}(Y_n)\\ &=np \end{align}