12 1continuous

# Continuous random variables

.

Continuous random variables are associated with experiments that involve measurements like weight, length, volume, temperature and time.

.

In theory, there is no limit to the accuracy of a continuous random variable.
.

• For example, if a scale shows steps of 1kg
• then a result of 83kg, is actually somewhere between 82.5kg and 83.5kg.
• If a scale shows steps of 0.5kg,
• then a result of 83kg is actually somewhere between 82.75kg and 83.25kg
• No matter how fine the scale is, we can never be sure the weight is exactly 83kg.

.

Hence, the probability of a continuous random variable (X) being exactly equal to any particular value is zero.
.

… … $Pr ( X = x ) = 0$ … for all possible values of x

.

The hisogram below shows the weight of a large number of randomly chosen people.

… … $Pr ( W \approx 83) =Pr (82.5 \leqslant W \leqslant 83.5)$
.

… … … … $=\dfrac{\text{area shaded from 82.5 to 83.5}}{\text{total area}}$
.

If the histogram is scaled so that its total area is one, then

… … $Pr ( W \approx 83) =Pr (82.5 \leqslant W \leqslant 83.5)$
.

… … … … $=\text{area shaded from 82.5 to 83.5}$

.

## Probability Density Functions

As the size of the sample becomes larger and the class interval smaller, the histogram can be modelled by a smooth curve.

.

The function f whose graph models this smooth curve is called the probability density function.
.

Remember the function is scaled so that the total area under the graph is equal to 1.

.

In the example above, if the curve is modelled by f(w), we can calculate the probability using:

… … $Pr(82.5 \leqslant W \leqslant 83.5) = \displaystyle{\int\limits_{82.5}^{83.5} \, f(w) \; dw}$

.

Since the graph represents the probability distribution of a continuous variable, the graph:

• can not be below the x-axis ($y \geqslant 0$ for all possible x) and
• must have a total area equal to 1

.

In general, for any probability density function, $f(x)$,

• $Pr(a \leqslant x \leqslant b)$ is represented by the shaded region of the graph,
• That is the area between the curve, the x-axis and the lines $x = a$ and $x = b$.
• This probability can be found by calculus.

… … $Pr(a \leqslant X \leqslant b) = \displaystyle{\int\limits_{a}^{b} \, f(x)\; dx}$
.

## Properties of a probability density function

.

1 .. $f(x) \geqslant 0 \qquad \text{for all } \; x \in R$
.

2 .. $\displaystyle{ \int\limits_{-\infty}^\infty \, f(x) \; dx} =1$
.

3 .. $Pr(a \leqslant x \leqslant b) = \displaystyle{ \int\limits_{a}^{b} \, f(x) \; dx}$

.

As stated earlier, X can not take an exact value. Since

… …$Pr(X = a) = \displaystyle{ \int\limits_{a}^{a} \, f(x) \; dx} = 0$

Therefore:

… … $Pr (a \leqslant X \leqslant b) = Pr(a < X < b)$

.

## Hybrid Functions

Some probability density functions will be defined as a hybrid function with a rule covering a specified domain and 0 elsewhere.

.

### Example 1

The random variable X has density function:

… … $f(x)= \begin{cases} 1.5(1-x^2) & 0 \leqslant x \leqslant 1 \\ 0 & \text{elsewhere} \end {cases}$

a) .. Sketch the graph of $f(x)$.

b) .. Show that $f(x)$ is a probability density function.

Solution:

a) .. Sketch the graph of $f(x)$.

… … … The graph of $f(x)$ is part of a parabola over the domain $\big[0,\; 1\big]$.

… … … The endpoints of the curve are $\big(0, \; 1.5\big)$ and $\big(1,\; 0\big)$.

… … … Everywhere else the function is zero.

.

Note The places where $f(x) = 0$ must be shown on the graph.
… …(See the blue lines on the x-axis)

.

b) .. Show that $f(x)$ is a probability density function.

… … … From the graph we can see that the function is positive or zero for its entire domain.

… … … This meets the first property of probability density functions,
… … … that $f(x) \geqslant 0$ for all $x \in R$.
.

… … … To prove the second property, show that the area under the graph of f(x) is equal to 1.
.

… … … $\displaystyle{ \int\limits_{0}^1 \;1.5(1-x^2) \; dx }$
.

… … … … … $=1.5\left[x-\dfrac{x^3}{3}\right]_{0}^{1}$
.

… … … … … $=1.5\big(1-\dfrac{1}{3}\big)$
.

… … … … … $=1$

… … … $f(x)$ satisfies both properties so it is a probability density function.

.

### Example 2

The random variable X has a function:

… … $f(x)=\begin{cases} cx && 0 \leqslant {x} \leqslant 2 \\ 0&&\text{ elsewhere} \end {cases}$

… … … where c is a constant.
.

Find the value of c that makes $f(x)$ a probability density function.
.

Solution:

… … For the function to be a probability density function:
… … the area under the graph of $f(x)$ must equal 1.

.

… … $\displaystyle{ \int\limits_{0}^2 \; cx \; dx} =1$
.

… … $\left[\dfrac{cx^2}{2}\right]_{0}^{2} = 1$
.

… … $2c = 1$
.

… … $c = \dfrac{1}{2}$

.