# Variance

A measure of the average deviation from the average value

Given a sample of \(n\) values \(x_i\) with mean \(\mu\), the variance is defined as

For a random variable \(X\) with the distribution in question and having a mean of \(\mu\), the variance is equal to the expectation of the function

**1. of a sample**Given a sample of \(n\) values \(x_i\) with mean \(\mu\), the variance is defined as

\[
\frac{1}{n}\sum_{i=1}^{n}\left(x_i - \mu\right)^2
\]

where \(\sum\) is the summation sign.**2. of a distribution**For a random variable \(X\) with the distribution in question and having a mean of \(\mu\), the variance is equal to the expectation of the function

\[
f(X) = \left(X - \mu\right)^2
\]