$\newcommand\E{\mathbb E}$Suppose we toss a coin $n$ times, and let the r.v. $X$ denote the number of heads we see. Moreover, let $X_{i} = 1$ if the $i$-th toss is a heads, otherwise $0$.
$$\mathrm{Var}(X) = \E(X^{2}) - (\E(X))^{2} = \sum_{i=1}^{n} \Pr(X_{i} = 1)(1^{2}) - \left(\frac{n}{2}\right)^{2} = \frac{n}{2} - \frac{n^{2}}{4}$$
Thus, if $n=100$, this would mean the variance is $50 - 2500 = -2450$...
What am I missing here?