## Continuous Random Variables – Measures of Spread

The measures of spread of discrete random variables are the variance and the standard deviation. For continuous random variables they are the variance and the standard deviation as well as the interquartile range.

### Variance

The formula for the variance is:

$Var(x)=E[(X-\mu)^{2}]$

The variance gives us the long average range of values that we can expect to get around the mean.

There is also another formula for calculating the variance which is a little more computational for us. The variance equals the expected value of x squared minus the squared mean.

$Var(x)=E(X^{2})-\mu^{2}$

### Standard deviation

The standard deviation is also a measure of spread around the mean. The formula is the same as the one for the discrete random variable.

$\sigma=\sqrt{Var(x)}$

## Interquartile Range

The interquartile range measures the spread of the distribution by finding the lower and upper bounds of the middle fifty per cent. The closer the bounds are together the denser the function will be.

The range is calculated through the same formula as we used for the median. We just need to solve the equation of the integral of the function x of x over the range of negative infinity to the variable p for a given percentage q.

$\int\limits_{-\infty}^{p}{f(x)}dx=q$

For the interquartile range q=0.25 for the lower bound and q=0.75 for the upper bound.

## Practice question

Find the variance of the function below:

$f(x)=0.5x, 0 \leq x \leq 2$

$Var(x)=E(X^{2})-\mu^{2}$

Step 1 Find the mean through integrating xf(x)

$\mu=\int\limits_{0}^{2}{xf(x)}dx=q\newline =\int\limits_{0}^{2}{x \times 0.5x}\newline \mu = 0.5[\frac{x^{3}}{3}]^{2}_{0}=0.5 \times \frac{8}{3}=\frac{4}{3}=\mu$

Step 2 Find the expexted value of $x^{2}$

$E(x)=\int\limits_{0}^{2}{x^{2}f(x)}dx=q\newline =\int\limits_{0}^{2}{x^{2} \times 0.5x}\newline \mu = 0.5[\frac{x^{4}}{4}]^{2}_{0}=0.5 \times \frac{16}{4}=2$

Step 3 substitute our values into the variance equation

$Var(x)=2-(\frac{4}{3})^{2}=\frac{2}{9}$

To find the standard deviation we take the square root of the variance which gives us root two on three and our final answer.

$\sigma=\sqrt{Var(x)}=\sqrt{\frac{2}{9}}=\frac{\sqrt{2}}{3}$

When calculating the variance it is important to break it down into parts so you don’t muddle up your answer and also try to understand the differences between a small and large variance.