topic badge

8.015 Expected value, variance and standard deviation

Lesson

Expected value for continuous probability distributions

Recall that the basic expected value formula is the probability of an event multiplied by the number of trials for a particular probability experiment. That is $P\left(X\right)\times x$P(X)×x where $X$X is the event and $x$xis the number of trials. The expected value of a random variable gives the mean of the distribution.

The notation used for the expected value of a random variable $X$X is $\mu=E\left(X\right)$μ=E(X)

For discrete probability distributions the formula for expected value is $E\left(X\right)=\Sigma\ xP\left(x\right)$E(X)=Σ xP(x)

In the case of a continuous random variable, the expected value is defined analogously in terms of an integral. If the random variable $X$X has probability density function $f$f that is defined on a domain $\left(a,b\right)$(a,b), we define

$E\left(X\right)=\int_a^b\ xf\left(x\right)\ \mathrm{d}x$E(X)=ba xf(x) dx

Worked examples

Example 1

A certain event can occur at any time $T$T within $10$10 minutes of the starting time of an experiment. The time at which the event occurs is assumed to have a uniform probability distribution.

Think: Intuition suggests that the values of the random variable will be centred around the $5$5-minute mark. We can confirm this using the definition of expected value for a continuous random variable.

Do: As we have been told this is a uniform probability distribution, the random variable $T$T has PDF:

$f\left(T\right)=\frac{1}{10}$f(T)=110

Therefore:

Thus, the expected value is $5$5 as we predicted.

Example 2

A random variable $X$X has PDF given by $f\left(X\right)=\frac{1}{5}-\frac{X}{50}$f(X)=15X50 where $X$X is in the interval $$. What is the mean or expected value of $X$X?

Solution: By the definition $E\left(X\right)=\int_0^{10}\ x\left(\frac{1}{5}-\frac{x}{50}\right)\mathrm{d}x$E(X)=100 x(15x50)dx. So:

Calculating variance ($\sigma^2$σ2) and standard deviation ($\sigma$σ) in a continuous probability distribution

Recall that variance is technically the average of the squared differences of each data value from the mean. Variance gives us a general idea of how spread the data values in a distribution are.

Because the expected value, $E\left(X\right)$E(X), is equivalent to the mean of the random variable we can express the formula for variance in terms of $E\left(X\right)$E(X). For example for discrete probability distributions the variance is:

$Var\left(X\right)=E\left(\left(X-\mu\right)^2\right)=\Sigma\left(x-\mu\right)^2P\left(x\right)$Var(X)=E((Xμ)2)=Σ(xμ)2P(x)

As you can expect for continuous probability distributions the formula for variance changes to:

$Var\left(X\right)=E((x-\mu)^2)=\int_a^b\ \left(x-\mu\right)^2\ f\left(x\right)dx$Var(X)=E((xμ)2)=ba (xμ)2 f(x)dx

For ease of calculating, we can rewrite this as: $Var\left(X\right)=E\left(X^2\right)-\mu^2$Var(X)=E(X2)μ2 or $E\left(X^2\right)-E\left(X\right)^2$E(X2)E(X)2

Remember also that standard deviation is the square root of the variance: $\sigma=\sqrt{Var}$σ=Var

We can summarise the difference between discrete and continuous probability distributions in relation to variance and expected value below:

  Discrete Probability Distribution Continuous Probability Distributions
Expected Value $E\left(X\right)=\Sigma xP\left(x\right)$E(X)=ΣxP(x) $E\left(X\right)=\int_a^b\ xf\left(x\right)\ \mathrm{d}x$E(X)=ba xf(x) dx
Variance $Var\left(X\right)=E\left(\left(X-\mu\right)^2\right)=\Sigma\left(x-\mu\right)^2P\left(x\right)$Var(X)=E((Xμ)2)=Σ(xμ)2P(x) $Var\left(X\right)=E\left(\left(x-\mu\right)^2\right)=\int_a^b\ \left(x-\mu\right)^2\ f\left(x\right)dx$Var(X)=E((xμ)2)=ba (xμ)2 f(x)dx

Practice questions

Question 1

Consider the probability density function $p$p where $p\left(x\right)=\frac{1}{20}$p(x)=120 when $25\le x\le45$25x45 and $p\left(x\right)=0$p(x)=0 otherwise.

  1. Use integration to determine the expected value of $p\left(x\right)$p(x).

  2. Use integration to determine the variance of $p\left(x\right)$p(x).

    Round your answer to two decimal places if necessary

Question 2

Consider the probability density function $p$p, where $p\left(x\right)=kx^2$p(x)=kx2 when $2\le x\le5$2x5 and $p\left(x\right)=0$p(x)=0 otherwise.

  1. Use integration to determine the value of $k$k.

    Round your answer to four decimal places if necessary.

  2. Use integration to determine the expected value of a random variable $X$X if it is distributed according to $p\left(x\right)$p(x).

    Round to four decimal places if necessary.

  3. By performing an integration similar to the one in part (b), we can find that $E\left(X^2\right)=\frac{1031}{65}$E(X2)=103165.

    Hence, calculate the variance, $V\left(X\right)$V(X), of $p\left(x\right)$p(x).

    Round to four decimal places if necessary.

Outcomes

MA12-8

solves problems using appropriate statistical processes

What is Mathspace

About Mathspace