6.3.1 Continuous Random Variables

In this topic we will learn how to:

  • understand the concept of a continuous random variable, and recall and use the properties of a probability density function
  • use a probability density function to solve problems involving probabilities, and to calculate the mean and variance of a distribution

A continuous random variable is a random variable that takes an infinite number of values, typically measurements. When this continuous random variable is modelled as a function, we call this a probability density function.
\textbf{\textcolor{gray}{Properties of a P.D.F (Probability Density Function)}}There are two main properties of a p.d.f that you should know. These are:

  • The total area under the graph is equal to 1
  • The graph of a p.d.f exists only above the x-axis i.e the graph of a p.d.f can never be negative

The notation of defining a p.d.f is as follows:
f(x) = \begin{cases} x^{2} & 0 < x < 2, \\ 0 & \text{otherwise}\end{cases} This reads as ‘f of x is equal to x-squared, when x is between 0 and 2, otherwise f of x is equal to 0’.
Here’s the diagram of that p.d.f,

Rendered by QuickLaTeX.com

\textbf{\textcolor{gray}{Calculating Probabilities}}To calculate the probabilities using a p.d.f we use integration. Here is the formula:
P(a < X < b) = \int_{a}^{b}f(x) dxWhere a is the lower limit and b is the upper limit.

\textbf{\textcolor{gray}{Mean and Variance}}We can calculate both mean and variance using a p.d.f. The formula for calculating mean is:
E(X) = \int_{all x}xf(x) dxNote: “all x” means all values that the p.d.f takes. This means from the lower limit of the p.d.f to the upper limit of the p.d.f.

The formula for calculating variance is:
Var(X) = \int_{all x}x^{2}f(x) dx - [E(X)]^{2}We can also calculate median and other percentiles. The formula for calculating the median is:
\int_{a}^{m}f(x) dx = \frac{1}{2}Where a is the lower limit of the p.d.f, and m is the median.

The formula for calculating the nth percentile is:

\int_{a}^{p}f(x) dx = \frac{n}{100}Where a is the lower limit of the p.d.f, n is the percentile, and p is the value at the percentile.

Let’s look at some past paper questions involving continuous random variables.


1. A random variable X has the probability density function given by

f(x) =\begin{cases}k(3x - x^{2}) & 0 < x < 3, \\0 & \text{otherwise} \end{cases}


(9709/73/O/N/19 number 6)


(a) Show that k = \frac{2}{9}

To do that we’re going to use one of the properties of a p.d.f. The total area under the graph is equal to 1. We’re going to integrate from the lower limit to the upper limit and equate to 1. This will allow us to solve for k,
\int_{0}^{3}k(3x - x^{2}) dx = 1k\int_{0}^{3}(3x - x^{2}) dx = 1k\left[\frac{3}{2}x^{2} - \frac{x^{3}}{3}\right]{0}^{3} = 1 k\left[\left(\frac{3}{2}\left(3\right)^{2} - \frac{(3)^{3}}{3}\right)-0\right] = 1k\left(\frac{27}{2} - \frac{27}{3}\right) = 1\frac{9}{2}k = 1k = \frac{2}{9}Therefore, we have proved that,
k = \frac{2}{9} (b) Find P(1 \le X \le 2).
P(\textcolor{#2192FF}{1} \le X \le \textcolor{#2192FF}{2}) To solve this question, we integrate f(x) with \textcolor{#2192FF}{1} as the lower limit and \textcolor{#2192FF}{2} as the upper limit. Don’t forget to substitute k with \frac{2}{9},
P(\textcolor{#2192FF}{1} \le X \le \textcolor{#2192FF}{2}) = \frac{2}{9}\int_{\textcolor{#2192FF}{1}}^{\textcolor{#2192FF}{2}}(3x - x^{2})dxP(1 \le X \le 2) = \frac{2}{9}\left[\frac{3x^{2}}{2} - \frac{x^{3}}{3}\right]{1}^{2}P(1 \le X \le 2) = \frac{2}{9}\left[\left(\frac{3(2)^{2}}{2} - \frac{(2)^{3}}{3}\right) - \left(\frac{3(1)^{2}}{2}- \frac{1^{3}}{3}\right)\right]P(1 \le X \le 2) = \frac{13}{27} Therefore, the final answer is, P(1 \le X \le 2) = \frac{13}{27} (c) Find Var(X).

The formula for Var(X) is,
Var(X) = \int_{all x}x^{2}f(x) dx - [E(X)]^{2}The first step is find E(X). Since our graph is symmetrical about \frac{3}{2}, our E(X) is \frac{3}{2}. However, for learning purposes, I’ll show the working that you would do if it wasn’t symmetrical. The formula for E(X) is,
E(X) = \int_{all x}xf(x) dxNow let’s solve for the mean,
\frac{2}{9}\int_{0}^{3}x(3x - x^{2})dx\frac{2}{9}\int_{0}^{3}(3x^{2} - x^{3})dx\frac{2}{9}\left[x^{3} - \frac{x^{4}}{4}\right]{0}^{3}\frac{2}{9}\left[\left((3)^{3} - \frac{(3)^{4}}{4}\right) - 0\right]\frac{3}{2} Therefore, the mean is, E(X) = \frac{3}{2} Now, back to the formula for variance, Var(X) = \textcolor{#2192FF}{\int_{all x}x^{2}f(x) dx} - [E(X)]^{2}Let’s solve for the first part,
\frac{2}{9}\int_{0}^{3}x^{2}(3x - x^{2})dx\frac{2}{9}\int_{0}^{3}(3x^{3} - x^{4})dx\frac{2}{9}\left[\frac{3x^{4}}{4} - \frac{x^{5}}{5}\right]_{0}^{3}\frac{2}{9}\left[\left(\frac{3(3)^{4}}{4} - \frac{(3)^{5}}{5}\right) - 0\right]\frac{27}{10}Therefore,
Var(X) = \frac{27}{10} - \left(\frac{3}{2}\right)^{2}Var(X) = \frac{9}{20}Therefore, the final answer,
Var(X) = \frac{9}{20}