Online Mathematics Book

Parameters of Continuous Random Variable

Continuous random variables, alongside continuous probability distributions have several parameters that we'll need to know how to calculate and interpret.
In this section we learn about:

  • the mean
  • the median
  • the mode
  • the variance & standard deviation.
We learn how to calculate each of these with a formula as well as how to define each of these.

Mean Value \(\mu \) (Expected Value \(E\begin{pmatrix}X\end{pmatrix}\) )

Given a continuous random variable, \(X\), with probability density function (pdf) \(f(x)\), we calculate its mean value \(\mu \) (also known as expected value \(E\begin{pmatrix}X\end{pmatrix}\)) using the formula: \[\mu = \int_{-\infty}^{+\infty}x.f(x)dx\]

Example

A continuous random variable \(X\) has probability density function defined as: \[f(x) = \begin{cases} \frac{x}{4}, \quad 0 \leq x \leq 2 \\ 0, \quad \text{elsewhere} \end{cases}\] Calculate the mean.

Solution

We calculate the mean with the formula: \[\mu = \int_{-\infty}^{+\infty} x.f(x)dx\] Since the pdf is defined as: \[f(x) = \begin{cases} \frac{x}{4}, \quad 0 \leq x \leq 2 \\ 0, \quad \text{elsewhere} \end{cases}\] The formula becomes: \[\mu = \int_0^2 x.\frac{x}{4}dx\] That's: \[\begin{aligned} \mu &= \int_0^2 \frac{x^2}{4}dx \\ & = \frac{1}{4}\int_0^2 x^2dx \\ & = \frac{1}{4}\begin{bmatrix}\frac{x^3}{3}\end{bmatrix}_0^2 \\ & = \frac{1}{4} \times \frac{1}{3}\begin{bmatrix}x^3\end{bmatrix}_0^2 \\ & = \frac{1}{12}\begin{bmatrix}x^3\end{bmatrix}_0^2 \\ & = \frac{1}{12}\begin{bmatrix}2^3 - 0^3\end{bmatrix} \\ & = \frac{1}{12}\begin{bmatrix}8\end{bmatrix} \\ & = \frac{8}{12} \\ & = \frac{2}{3} \\ \mu & = 0.667 \end{aligned}\] This result tells us that if we were to repeat this experiment a large number of times (hundreds, thousands, ... ) then, on average, the value of \(X\) would be \(\mu = \frac{2}{3}\).

Tutorial

The time, in seconds, it takes to re-heat a cup of coffee can be modelled by the continuous random variable \(X\), with probability density function: \[f(x) = \begin{cases} \frac{3}{8}x^2, \quad 0 \leq x \leq 2 \\ 0, \quad \text{elsewhere} \end{cases} \] Calculate the mean amount of time it takes to re-heat a cup of coffee.









Median

The median value of a continuous random variable is the "middle value". That is the value \[\int_{-\infty}^mf(x)dx = \frac{1}{2}\] Graphically, it is the value of \(x\) that splits the area enclosed by the curve \(y=f(x)\) and the \(x\)-axis into two equal areas, both equal to \(0.5\).

Example

The time taken, \(X\) in minutes, for certain bacteria to split into \(2\) distinct bacteria, is believed to follow a continuous probability distribution, with probability density function defined as: \[f(x) = \begin{cases} \frac{3}{8}x^2, \quad 0 \leq x \leq 2 \\ 0, \quad \text{elsewhere} \end{cases}\] Assuming this model is correct, calculate the median time it takes for a bacteria to split in \(2\).

Solution

Remembering that the median is the value \(m\) such that: \[\int_{-\infty}^mf(x)dx = \frac{1}{2}\] and that the probability density function is defined as: \[f(x) = \begin{cases} \frac{3}{8}x^2, \quad 0 \leq x \leq 2 \\ 0, \quad \text{elsewhere} \end{cases}\] We find an expression for \(\int_{-\infty}^mf(x)dx\): \[\begin{aligned} \int_{-\infty}^mf(x)dx & = \int_{-\infty}^m\frac{3}{8}x^2dx \\ & = \int_0^m\frac{3}{8}x^2dx \\ & = \frac{3}{8}\int_0^mx^2dx \\ & = \frac{3}{8}\begin{bmatrix} \frac{x^3}{3}\end{bmatrix}_0^m \\ & = \frac{3}{8}\times \frac{1}{3}\begin{bmatrix} x^3\end{bmatrix}_0^m \\ & = \frac{1}{8}\begin{bmatrix} x^3\end{bmatrix}_0^m \\ & = \frac{1}{8}\begin{bmatrix} m^3-0^3\end{bmatrix} \\ \int_{-\infty}^mf(x)dx & = \frac{m^3}{8} \end{aligned}\] Since \(\int_{-\infty}^mf(x)dx = \frac{1}{2}\), we solve: \[\frac{m^3}{8} = \frac{1}{2}\] That's: \[ m^3= \frac{8}{2}\]

so
\[ m^3= 4\] Finally we can state the median value, \(m\), of \(X\): \[m = \sqrt[3]{4} = 1.59\] The median value is \(1.59\), rounded to \(3\) significant figures.

This result is illustrated with the curve shown here.

The area enclosed by the curve and the \(x\)-axis, between \(x=0\) and \(x=\sqrt[3]{4}\) equals to \(0.5\).
Similarly, the area enclosed by the curve and the \(x\)-axis, between \(x=\sqrt[3]{4}\) and \(x=2\) equals to \(0.5\).

This median value tells us that, when carrying-out this experiment, there is a \(50\%\) chance that the continuous random variable be less than \(\sqrt[3]{4}\) (\(\approx 1.59 \)). There is, consequently, a \(50\%\) that it be greater that \(\sqrt[3]{4}\).

In this question's context this median value tells us that there is a \(50\%\) chance that the bacteria split into \(2\) bacteria in less than \(1.59\) minutes. Likewise, there is a \(50\%\) chance that the bacteria split into \(2\) bacteria in more than \(1.59\) minutes.

Mode

The mode of a continuous random variable corresponds to the \(x\) value(s) at which the probability density function reaches a local maximum, or a peak. It is the value most likely to lie within the same interval as the outcome.

Consequently, we'll often find the mode(s) of a continuous random variable by solving the equation: \[f'(x) = 0\] There can be several modes. It is common, when working with continuous random variables, to refer to each local maxima (each peak) as a mode, in which case we say that the continuous random variable is multimodal or plurimodal.

Important

A continuous random variable's mode is not the value of \(X\) most likely to occur, as was the case for discrete random variables.

Remember: for continuous random variables the likelihood of a specific value occurring is \(0\), \(P\begin{pmatrix}X = k \end{pmatrix} = 0\) and the mode is a specific value.

When working with continuous probability distributions the mode is the value most likely to lie within the same interval as the outcome.

Example

The weight (or mass) \(X\), in kg, of newborn babies can, roughly, be approximated by the continuous probability distribution defined as:

\[f(x) = \begin{cases} \frac{\pi}{4}sin\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix}, \quad 0\leq x \leq \pi \\ 0, \quad \text{elsewhere} \end{cases} \] Find the mode (modal value) of the newborn's weight.

Note: a more accurate model will be seen when we learn about normal distributions.

Solution

To find the mode we look for any local maximum on the non-zero portion of the probability density function's curve.

To do this we solve: \[f'(x) = 0\] Since the non-zero portion of \(f(x)\) is \(\frac{\pi}{4}sin\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix}\), for \(2\leq x \leq 4\) we differentiation: \[f(x) = \frac{\pi}{4}sin\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix}\] That's: \[f'(x) = \frac{\pi^2}{8}cos\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix}\] The solution(s) to \(f'(x)=0\) are the solutions to: \[\frac{\pi^2}{8}cos\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix} = 0\] We solve here: \[\begin{aligned} &\frac{\pi^2}{8}cos\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix} = 0 \\ & cos\begin{pmatrix}\frac{\pi (x-2)}{2} \end{pmatrix} = 0\\ & \frac{\pi (x-2)}{2} = \frac{\pi}{2} + k\pi, \quad k\in \mathbb{Z} \\ & x - 2 = 1 + 2k, \quad k\in \mathbb{Z} \\ & x = 3 + 2k, \quad k\in \mathbb{Z} \end{aligned}\] The only solution that lies within the interval \(2\leq x \leq 4\) is \(x=3\).

So the solution to the equation \(f'(x)=0\) is: \[x = 3\] This is the mode of the continuous random variable: \[\text{Mode} = 3\] This result tells us that \(3\) is the value most likely to lie within the range of the outcome of this experiment.
Given this example's context, a newborn's weight is more likely to lie within an interval containing \(3\)kg than any other.

Variance & Standard Deviation

Variance, \(Var\begin{pmatrix}X\end{pmatrix}\)

The variance of a continuous random variable is calculated using the formula: \[Var\begin{pmatrix}X\end{pmatrix} = E\begin{pmatrix}X^2\end{pmatrix} - \mu^2 \] Where: \[E\begin{pmatrix}X^2\end{pmatrix} = \int_{-\infty}^{+\infty}x^2.f(x)dx\] and \(\mu \) is the mean (a.k.a expected value) and was defined further-up.
The variance is the square of the standard deviation, defined next.

Standard Deviation \(\sigma \)

The standard deviation of a continuous random variable is equal to the square root of the variance, that's: \[\sigma = \sqrt{Var\begin{pmatrix}X\end{pmatrix}}\] Its value tells us how far, on average, we can expect the value of \(X\) to be from the mean \(\mu\).
Remember \(\sigma \) is an average! If we were to repeat the experiment a large enough number of times then the average distance between the values observed and the mean value would equal to the standard deviation.

Example

The time it takes to open an app, on a smartphone, varies from one device to another.
The time taken \(X\), in seconds, to open/launch the app "Monkey Heaven" has probability density function defined as: \[f(x) = \begin{cases} \frac{(x-3)^2}{9}, \quad 0 \leq x \leq 3 \\ 0, \quad \text{elsewhere} \end{cases}\]

  1. Find the mean value of \(X\)..
  2. Find the variance.standard deviation.
  3. Find the standard deviation.

Solution

  1. We calculate the mean using the definition: \[\mu = \int_{-\infty}^{+\infty}x.f(x)dx\] Since \(f(x)\) is defined as: \[f(x) = \begin{cases} \frac{(x-3)^2}{9}, \quad 0 \leq x \leq 3 \\ 0, \quad \text{elsewhere} \end{cases}\] This becomes: \[\mu = \int_0^3 x.\frac{(x-3)^2}{9} dx \] We now evaluate this integral to find the mean: \[\begin{aligned} \mu & = \int_0^3 x.\frac{(x-3)^2}{9} dx \\ & = \frac{1}{9}\int_0^3 x.(x-3)^2 dx \\ & = \frac{1}{9}\int_0^3 x.(x^2-6x+9) dx \\ & = \frac{1}{9}\int_0^3 (x^3-6x^2+9x) dx \\ & = \frac{1}{9}\begin{bmatrix} \frac{x^4}{4} - \frac{6}{3}x^3 + \frac{9}{2}x^2 \end{bmatrix}_0^3 \\ & = \frac{1}{9}\begin{bmatrix} \frac{x^4}{4} - 2x^3 + \frac{9}{2}x^2 \end{bmatrix}_0^3 \\ & = \frac{1}{9}\begin{bmatrix} \begin{pmatrix} \frac{3^4}{4} - 2\times 3^3 + \frac{9}{2}\times 3^2 \end{pmatrix} - 0\end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{81}{4} - 2\times 27 + \frac{9}{2}\times 9 \end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{81}{4} - 54 + \frac{81}{2} \end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{81}{4} - \frac{216}{4} + \frac{162}{4} \end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{27}{4}\end{bmatrix} \\ & = \frac{27}{9\times 4} \\ & = \frac{3}{4} \\ \mu & = 0.75 \end{aligned}\] The mean is \(\mu = 0.75\), this tells us that on average (after a large number of trials) we can expect the average time it takes (regardless of the device) to launch/open the app to be \(0.75\) seconds.

  2. To calculate the variance, we use the definition: \[Var\begin{pmatrix}X\end{pmatrix} = E\begin{pmatrix}X^2\end{pmatrix} - \mu^2\] We already know the value of \(\mu \).
    We now calculate \(E\begin{pmatrix}X^2\end{pmatrix}\): \[\begin{aligned} E\begin{pmatrix}X^2\end{pmatrix} &= \int_{-\infty}^{+\infty}x^2.f(x)dx \\ &= \int_{-\infty}^{+\infty} x^2.\frac{(x-3)^2}{9}dx \\ &= \int_0^3 x^2.\frac{(x-3)^2}{9}dx \\ &= \frac{1}{9}\int_0^3 x^2.(x-3)^2dx \\ &= \frac{1}{9}\int_0^3 x^2.(x^2-6x+9)dx \\ &= \frac{1}{9}\int_0^3 (x^4-6x^3+9x^2)dx \\ &= \frac{1}{9}\begin{bmatrix} \frac{x^5}{5}-\frac{6}{4}x^4+\frac{9}{3}x^3 \end{bmatrix}_0^3 \\ & = \frac{1}{9}\begin{bmatrix} \frac{x^5}{5}-\frac{3}{2}x^4+3x^3 \end{bmatrix}_0^3 \\ & = \frac{1}{9}\begin{bmatrix} \begin{pmatrix} \frac{3^5}{5}-\frac{3}{2}\times 3^4+3\times 3^3 \end{pmatrix} - 0\end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \begin{pmatrix} \frac{243}{5}-\frac{243}{2}+81 \end{pmatrix} - 0\end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{486}{10} - \frac{1215}{10} + \frac{810}{10}\end{bmatrix} \\ & = \frac{1}{9}\begin{bmatrix} \frac{81}{10} \end{bmatrix} \\ & = \frac{81}{9\times 10} \\ & = \frac{9}{10} \\ E\begin{pmatrix}X^2\end{pmatrix} & = 0.9 \end{aligned}\] We can now go back to the definition of variance and calculate: \[\begin{aligned} Var\begin{pmatrix}X \end{pmatrix} &= E\begin{pmatrix}X^2\end{pmatrix} - \mu^2 \\ & = 0.9 - 0.75^2 \\ Var\begin{pmatrix}X \end{pmatrix} & = 0.3375 \end{aligned}\]

  3. We now calculate the standard deviation using the definition: \[\sigma = \sqrt{Var\begin{pmatrix} X\end{pmatrix}}\] Since \(Var\begin{pmatrix}X \end{pmatrix} = 0.3375\) we find: \[\sigma = \sqrt{0.3375} = 0.581\] The standard deviation is \(\sigma = 0.581\).
    This tells that, on average amongst all the different cell phones, we can expect the time taken for the app to launch to be \(0.581\) seconds more, or less, than the mean value \(\mu = 0.75\) seconds.

Exercise 1

A continuous random variable \(X\) has probability density function defined as: \[f(x) = \begin{cases} \frac{x^2}{9}, \quad 0\leq x \leq 3 \\ 0, \quad \text{elsewhere} \end{cases}\] Calculate the continuous random variable's:

  1. mean
  2. median
  3. mode
    1. Variance
    2. Standard Deviation

Answers Without Working

    1. The mean: \(\mu = 2.25\)
    2. The median: \(m = \sqrt[3]{\frac{27}{2}} = \frac{3}{\sqrt[3]{2}} \approx 2.38\)
    3. The mode is \(3\).
      1. The Variance is: \(Var\begin{pmatrix}X \end{pmatrix}=0.3375\)
      2. The Standard Deviation is: \(\sigma = 0.581\).

Exercise 2

A continuous random variable \(X\) has probability density function defined as: \[f(x) = \begin{cases} \frac{sin(x)}{2}, \quad 0\leq x \leq \pi \\ 0, \quad \text{elsewhere} \end{cases}\] Calculate the continuous random variable's:

  1. mean
  2. median
  3. mode
    1. variance
    2. standard deviation

Answers Without Working

  1. The mean: \(\mu = \frac{\pi}{2}\)
  2. The median: \(m = \frac{\pi}{2}\)
  3. The mode is \(\frac{\pi}{2}\).
    1. The Variance is: \(Var\begin{pmatrix}X \end{pmatrix}= \frac{\pi^2}{4} - 2 = 0.467\)
    2. The Standard Deviation is: \(\sigma = 0.684\).

Exercise 3

A continuous random variable \(X\) has probability density function defined as: \[f(x) = \begin{cases} \frac{2}{3}x - \frac{2}{3}, \quad 1\leq x \leq 2 \\ -\frac{x}{3} + \frac{4}{3}, \quad 2\leq x \leq 4 \\ 0, \quad \text{elsewhere} \end{cases}\] Calculate the continuous random variables:

  1. mean
  2. median
  3. mode
    1. variance
    2. standard deviation

Answers Without Working

    1. The mean: \(\mu = 2.25\)
    2. The median: \(m = \sqrt[3]{\frac{27}{2}} = \frac{3}{\sqrt[3]{2}} \approx 2.38\)
    3. The mode is \(3\).
      1. The Variance is: \(Var\begin{pmatrix}X \end{pmatrix}=0.3375\)
      2. The Standard Deviation is: \(\sigma = 0.581\).