# Find the mean and variance for the first n natural numbers

Question:

Find the mean and variance for the first natural numbers

Solution:

The mean of first n natural numbers is calculated as follows.

Mean $=\frac{\text { Sum of all observations }}{\text { Number of observations }}$

$\therefore$ Mean $=\frac{\frac{n(n+1)}{2}}{n}=\frac{n+1}{2}$

Variance $\left(\sigma^{2}\right)=\frac{1}{n} \sum_{i=1}^{n}\left(x_{i}-\bar{x}\right)^{2}$

$=\frac{1}{\mathrm{n}} \sum_{\mathrm{i}=1}^{\mathrm{n}}\left[\mathrm{x}_{\mathrm{i}}-\left(\frac{\mathrm{n}+\mathrm{l}}{2}\right)\right]^{2}$

$=\frac{1}{n} \sum_{i=1}^{n} x_{i}^{2}-\frac{1}{n} \sum_{i=1}^{n} 2\left(\frac{n+1}{2}\right) x_{i}+\frac{1}{n} \sum_{i=1}^{n}\left(\frac{n+1}{2}\right)^{2}$

$=\frac{1}{n} \frac{n(n+1)(2 n+1)}{6}-\left(\frac{n+1}{n}\right)\left[\frac{n(n+1)}{2}\right]+\frac{(n+1)^{2}}{4 n} \times n$

$=\frac{(n+1)(2 n+1)}{6}-\frac{(n+1)^{2}}{2}+\frac{(n+1)^{2}}{4}$

$=\frac{(n+1)(2 n+1)}{6}-\frac{(n+1)^{2}}{4}$

$=(\mathrm{n}+1)\left[\frac{4 \mathrm{n}+2-3 \mathrm{n}-3}{12}\right]$

$=\frac{(n+1)(n-1)}{12}$

$=\frac{n^{2}-1}{12}$