The random variable $X$ has the binomial distribution $\mathrm{B}(n, p)$.
a. Write down an expression for $\mathrm{P}(X=r)$ and hence show that the probability generating function of $X$ is $(q+p t)^{n}$, where $q=1-p$. [3]
b. Use the probability generating function of $X$ to prove that $\mathrm{E}(X)=n p$ and $\operatorname{Var}(X)=n p(1-p)$. [5]