Let ${X_i}$ be a sequence of iid bernoulli random variables sucht that $P\{X_i = 1\} = p$ and $P\{X_i = 0\} = 1-p$ and let $S_n = \sum_{i=1}^n X_i$.
Calculate variance and mean of $\frac{S_n}{n}$
I'm pretty sure that the mean is $p$. But the variance come to me as $-p$ and that's not possible.
$\mathbb E[X] = 1\times p + 0\times(1-p) = p$.
$\mathbb E[X^2] = 1^2 + p + 0 = p.$
$\mathsf{Var}(X_i) = \mathbb E[X^2] - (\mathbb E[X])^2 = p - p^2 = -p$.
Part 1:
For any $i$, there are
$$\mathbb{E}[X_i]=1\times p +0\times (1-p)=p,$$
and
$$Var[X_i]=\mathbb{E}[X_i^2]-(\mathbb{E}[X_i])^2=[1^2\times p+0^2\times (1-p)]-p^2=p(1-p).$$
Since $0\le p\le 1$, we have $Var[X_i]=p(1-p)\ge 0.$
Part 2:
Since $S_n=\sum_{i=1}^nX_i$, there are
$$ \mathbb{E}\left[\frac{S_n}{n}\right]=\frac{1}{n}\mathbb{E}\left[S_n\right]=\frac{1}{n}\sum_{i=1}^n\mathbb{E}\left[X_i\right]=\frac{1}{n}\times n\times p=p, $$
and
$$ Var\left[\frac{S_n}{n}\right]=\frac{1}{n^2}Var\left[S_n\right]=\frac{1}{n^2}\sum_{i=1}^nVar\left[X_i\right]=\frac{1}{n^2}\times n\times p\times (1-p)=\frac{p(1-p)}{n}. $$