Finding the Expected value and Variance of the Binomial probability distribution Let $X \sim \text{Binomial}(n,p)$, that is, the probability mass function of $X$, $f(x)$, is such that
$$f(x) = 
\begin{cases}
{n \choose x} p^x (1-p)^{n-x} & \text{for } x=0,1,2,\ldots,n\\
0 & \text{otherwise} \\
\end{cases}$$
I have to find $\mathbb{E}(X)$ and $\mathbb{V}(X)$.
I am fully aware that $\mathbb{E}(x)=np$ but I am supposed to solve this using either a summation or an integral as would be done in any other question. Also,
I am aware that $\sum {n \choose k}a^k b^{n-k} = (a+b)^n$  but I'm not sure exactly how to use this since we have a factor of $x$ in our $\mathbb{E}(x)$ function.
 A: Note that
\begin{align*}
 \mathbb{E}[X] 
 &= \sum_{x=0}^{n}{x {n \choose x}p^{x}(1-p)^{n-x}} \\
 &=\sum_{x=1}^{n}{x {n \choose x}p^{x}(1-p)^{n-x}}
 & 0 \cdot f(0) = 0 \\
 &= \sum_{x=1}^{n}{x \frac{n!}{x!(n-x)!} p^{x}(1-p)^{n-x}} \\
 &= np \sum_{x=1}^{n}{\frac{(n-1)!}{(x-1)!(n-1-(x-1))!}p^{x-1}(1-p)^{n-x}} \\
 &= np \sum_{x=1}^{n}{{n-1 \choose x-1}p^{x-1}(1-p)^{n-x}} \\
 &= np \sum_{y=0}^{n-1}{{n-1 \choose y}p^{y}(1-p)^{(n-1)-y}}
 & y=x-1 \\
\end{align*}
Can you use the binomial theorem here? Can you use the same trick to compute $\mathbb{E}[X(X-1)]$? Note that, since $\mathbb{V}[X]=\mathbb{E}[X^2]-\mathbb{E}[X]^2$, you can determine $\mathbb{V}[X]$ from $\mathbb{E}[X(X-1)]$ and $\mathbb{E}[X]$.
A: Expanding my comment to an answer, to show an alternative approach.
Let $X_1, X_2, \ldots, X_n$ be i.i.d random variables, each with the distribution
$$P(X_k = 1) = p, \qquad P(X_k = 0) = 1-p$$
Define $X = X_1 + X_2 + \ldots + X_n$. Note that for $j \in \{0, 1, \ldots, n\}$, we have $X = j$ if and only if exactly $j$ of the $X_k$'s are equal to $1$. This event has probability
$$\begin{aligned}
P(X = j)& = P(\text{exactly $j$ of the $X_k$'s equal $1$ and the remaining $n-j$ equal $0$}) \\
&= {n \choose j}p^j (1-p)^{n-j}\\
\end{aligned}$$
which shows that $X$ has the same probability distribution as the one in the OP. We can now easily calculate $E[X]$ and $\operatorname{Var}[X]$ as follows.
First, note that for each $X_k$, we have
$$E[X_k] = 1P(X_k = 1) + 0P(X_k = 0) = 1p + 0(1-p) = p$$
and
$$E[{X_k}^2] = 1^2P(X_k = 1) + 0^2P(X_k = 0) = 1^2 p + 0^2(1-p) = p$$
and consequently,
$$\operatorname{Var}[X_k] = E[{X_j}^2] - E[X_j]^2 = p - p^2$$
Then, since the $X_k$'s are i.i.d., we have
$$E[X] = E[X_1] + E[X_2] + \cdots + E[X_n] = nE[X_1] = np$$
and
$$\operatorname{Var}[X] = \operatorname{Var}[X_1] + \operatorname{Var}[X_2] + \cdots + \operatorname{Var}[X_n] = n\operatorname{Var}[X_1] = n(p-p^2)$$
