Title: Default for 38.1 Continuous Probability Distributions
Course: HELM Workbooks 2023-2024

Continuous probability distributions

In order to get a good understanding of continuous probability distributions it is advisable to start by answering some fairly obvious questions such as: ''What is a continuous random variable?'',''Is there any carry over from the work we have already done on discrete random variables and distributions?'' We shall start with some basic concepts and definitions.

Continuous random variables

In day-to-day situations met by practising engineers, experiments such as measuring current in a piece of wire or measuring the dimensions of machined components play a part. However closely an engineer tries to control an experiment, there will always be small variations in the results obtained due to many factors: the influence of factors outside the control of the engineer. Such influences include changes in ambient temperature which may affect the accuracy of measuring devices used, and slight variation in the chemical composition of the materials used to produce the objects (wire, machined components in this case) under investigation. In the case of machined components, many of the small variations seen in measurements may be due to the influence of vibration, cutting tool wear in the machine producing the component, changes in raw material used and the process used to refine it, and even the measurement process itself!

Such variations (current and length for example) can be represented by a random variable and it is customary to define an interval, finite or infinite, within which variation can take place. Since such a variable (\(X\) say) can assume any value within an interval, we say that the variable is continuous rather than discrete. - its values form an entity we can think of as a continuum. The following definition summarizes the situation.

Definition

A random variable \(X\) is said to be continuous if it can assume any value in a given interval. This contrasts with the definition of a discrete random variable which can only assume discrete values.

Exercise

For a random variable \(X\) with the following probability distribution function

\( f(x) = \begin{cases} \dfrac{x}[value] & \text{if $0 \leq x \leq [value] $} \\ 0 & \text{elsewhere} \end{cases}, \)

calculate the mean and variance of \(X\).

\( \text{E}(X) = \)

\( \text{V}(X) = \)
Feedback: Solution To calculate the mean of \(X\) we do the following \[\begin{align*} \text{E}(X) &= \displaystyle{\int_0^{[value]}} x \times \dfrac{x}{[value] } \; dx \\ &= \int_0^{[value]} [value] \; dx \\& = \left.\dfrac{x^3}{3 \times [value]} \right|_0^{[value]}\\&=[value]. \end{align*}\] To calculate the variance of \(X\) we use the formula \( \text{V}(X)=\text{E}(X^2) - \text{E}(X)^2\). We have that \[\begin{align*}\text{E}(X^2) &= \displaystyle{\int_0^{[value]}} x^2 \times \dfrac{x}{[value] }\; dx \\&= \int_0^{[value]} [value] \; dx\\& = \left.\dfrac{x^4}{4\times[value]} \right|_0^{[value]} \\&= [value]. \end{align*}\] Thus, we have that \( \text{V}(X) = \text{E}(X^2) - \text{E}(X)^2 =[value] - ([value])^2 =\displaystyle{[value]}. \)

Exercise

The mileage (in 1000s of miles) for which a certain type of tyre will last is a random variable \(X\) with probability distribution function

\( f(x) = \left\{\begin{array}{ll} \dfrac{1}{[value]} e^{-x/[value]}, & \text{for all $ x > 0$}, \\ 0, & \text{for all $ x \leq 0$}. \end{array}\right. \)

Find the probability, to 3 decimal places, that the tyre will last:

1. At most 10 000 miles:
2. Between 16 000 and 24 000 miles:
3. At least 30 000 miles:
Feedback: Solution We have that \(\text{P}(a< X <b) = \int_a^b f(x) \; dx \). Thus: 1. \(\text{P}(X\leq10) = \displaystyle{\int_0^{10}} \dfrac{1}{[value]} e^{-x/[value]} \; dx = \left.-e^{-x/[value]}\right|_0^{10}=[value].\) 2. \(\text{P}(16 \leq X \leq 24)= \displaystyle{\int_{16}^{24}} \dfrac{1}{[value]} e^{-x/[value]} \; dx = -\left. e^{-x/[value]}\right|_{16}^{24}=[value].\) 3. \(\text{P}(30 \leq X)= \displaystyle{\int_{30}^{\infty}} \dfrac{1}{[value]} e^{-x/[value]} \; dx = \left. -e^{-x/[value]}\right|_{30}^{\infty}=[value].\)

Exercise

A target is made of three concentric circles of radii \(r_1 = \displaystyle[value]\), \(r_2 = [value]\) and \(r_3=[value]\) metres. Shots within the inner circle count \([value]\) points, within the middle band \([value]\) points and within the outer band \([value]\) points. (Shots outside the target count zero.) The distance of a shot from the centre of the target is a random variable \(R\) with density function \(f(r) = \dfrac{[value]}{ \pi ([value]+r^2)}\) , \(r > 0\). Calculate the expected value of the score after five shots.

Expected value of the score after five shots:
Feedback: Solution First we need to calculate the following probabilities: \(\begin{aligned} P( \text{shot within inner circle}) & = P(0<r<[value]) = \displaystyle{\int_0^{[value]}} [value] \; dx \\ &= \dfrac{2}{\pi} tan^{-1} (\dfrac{r}{[value]}) |_0^{[value]} = [value] \end{aligned}\) \(\begin{aligned} P( \text{shot within middle band}) & = P([value]<r<[value]) = \displaystyle{\int_{[value]}^{[value]}} [value] \; dx \\ & = \dfrac{2}{\pi} tan^{-1} (\dfrac{r}{[value]}) |_{[value]}^{[value]} = [value] \end{aligned}\) \(\begin{aligned} P( \text{shot within outer band}) & = P([value]<r<[value]) = \displaystyle{\int_{[value]}^{[value]}} [value] \; dx\\ & = \dfrac{2}{\pi} tan^{-1} (\dfrac{r}{[value]}) |_{[value]}^{[value]\sqrt(3)} = [value] \end{aligned}\) \(P( \text{miss target})= \displaystyle{1 - [value] - [value] - [value] =[value]}.\) Next, we define a random variable S according to the score obtained (our radnom space is \(\{[value], [value], [value], 0 \}\)), i.e. \(P(S=[value])=P( \text{shot within inner circle})=\displaystyle{[value]}\) \(P(S=[value])=P( \text{shot within middle band})=\displaystyle{[value]}\) \(P(S=[value])=P( \text{shot within outer band})=\displaystyle{[value]}\) \(P(S=0)=P( \text{miss target})=\displaystyle{[value]}.\) Finally, we calculate the expected value of the score after five shots: \(\begin{aligned} E[S+S+S+S+S] & = E[5S] = 5E[S] \\ & = \displaystyle 5 \left( [value]\cdot[value] +[value]\cdot [value] + [value]\cdot[value] +0\cdot[value] \right) \\ &= 5\cdot[value] = [value]. \end{aligned}\)

Exercise

A continuous random variable \(T\) has the following probability density function:

\[ f_T(t) = \left\{\begin{array}{ll} 0, & \text{if $t < 0$}, \\ [value]([value]-t/k), & \text{if $0 \leq t \leq k$}, \\ 0, & \text{if $t > k$}. \end{array}\right. \]

Find the following as whole numbers or as fractions:

1. The constant \(k\) =
2. \(\text{E}(T)\) =
3. \(\text{E}(T^2)\) =
4. \(\text{V}(T)\) =
Feedback: Solution 1. We know that the following must be true for the pdf of our random variable \(T\): \( \displaystyle{\int_{-\infty}^{\infty}} f_T(t) \; dt = 1.\) Thus, \[\begin{align*}\displaystyle{\int_{-\infty}^{\infty} f_T(t) \; dt} & = \displaystyle{\int_0^k [value]([value]-t/k) \; dt} \\ &= \left. [value]t \right|_0^k - \left.\dfrac{[value]t^2}{2k}\right|_0^k\\ & = [value]k - [value]k \\& = [value]k,\end{align*}\] which implies that \(k=\displaystyle{[value]}.\) 2. Using the value for \(k\), the expectation is calculated by: \[\begin{align*}\text{E}(T) & = \displaystyle{\int_{-\infty}^{\infty}} t f_T(t) \; dt\\ & = \int_0^{[value]} [value]([value]t-[value]t^2) \; dt\\ &= [value] \left.\dfrac{t^2}{2}\right|_0^{[value]} - \left.[value]\dfrac{t^3}{3}\right|_0^{[value]}\\& = [value] - [value]\\& = [value].\end{align*}\] 3. Using the value for \(k\), \(\text{E}(T^2)\) is: \[\begin{align*} \text{E}(T^2) &= \displaystyle{\int_{-\infty}^{\infty}} t^2 \cdot f_T(t) \; dt\\ &= \int_0^{[value]} [value]([value]t^2-[value]t^3) \; dt\\ &= \left.[value] \dfrac{t^3}{3}\right|_0^{[value]} - \left.[value]\dfrac{t^4}{4}\right|_0^{[value]}\\ &= [value] - [value]\\ &= [value].\end{align*}\] 4. Using the above values, the variance \(\text{V}(T)\) is evaluated using the formula: \[\begin{align*}\text{V}(T) &= \text{E}(T^2) - \text{E}(T)^2\\ &= \displaystyle{[value]- [value]}\\ &= [value].\end{align*}\]

Q: Exercise

Which of the following are probability density functions?

[Image: (i) is the line y=0 everywhere except at the line segment from (0,0) to (1,1). (ii) is the line y=0 everywhere except at]

\[\text{(iii)} \qquad f(x) = \left\{\begin{array}{ll} x^2 - 4x + \dfrac{10}{3}, & \text{for all $0 \leq x \leq 3$}\\ 0, & \text{elsewhere.} \end{array}\right. \]
- (i) is a probability density function. | False
- (ii) is a probability density function. | True
- (iii) is a probability density function. | False
Feedback: Solution (i) We can write this function as \[f(x) = \left\{\begin{array}{ll} x, & \text{for all $0 \leq x \leq 1$} \\ 0, & \text{elsewhere.} \end{array}\right. \] We have that \( f(x) \geq 0\) for all \(x\), but we have that \( \displaystyle{\int_{-\infty}^{\infty}} f(x) \; dx = \displaystyle{\int_0^1} x \; dx = \dfrac{1}{2}.\) Thus this function is not a valid probability density function because the integral’s value is not \(1\). (ii) We can write this function as \[ f(x) = \left\{\begin{array}{ll} 1 -\dfrac{x}{2}, & \text{for all $0 \leq x \leq 2$} \\ 0, & \text{elsewhere.} \end{array}\right. \] We have that \( f(x) \geq 0\) for all \(x\), and we have that \( \displaystyle{\int_{-\infty}^{\infty}} f(x) \; dx = \int_0^2 1 -\dfrac{x}{2} \; dx = 1.\) Thus, this function is a valid probability density function. (iii) We have that \( \displaystyle{\int_{-\infty}^{\infty}} f(x) \; dx = \int_0^3 x^2 - 4x + \dfrac{10}{3} \; dx = 1.\) But, we see that \(f(x)<0 \) for \(\dfrac{3}{2} \leq x \leq \dfrac{5}{2}.\) Hence, because \(f(x)\) takes on negative values, it is not a valid probability density function.

Exercise

Let \(X\) be a random variable and consider its pdf in the figure below.

[Image]

Calculate the probability that \(X\) takes on a value between \(\displaystyle[value]\) and \(\displaystyle[value]\).

\(P\left(\displaystyle{[value]} \leq X \leq \displaystyle{[value]}\right)\) =
Feedback: Solution First, we write down the pdf: \[f(x) = \left\{\begin{array}{ll}0, & \text{if $x \leq -2$}, \\ \dfrac{1}{2} + \dfrac{x}{4}, & \text{if $-2 \leq x \leq 0$},\\ \dfrac{1}{2} - \dfrac{x}{4}, & \text{if $0 \leq x \leq 2$},\\ 0, & \text{if $x \geq 2$}.\end{array}\right.\] Then, we see that \(\text{P}({[value]} \leq X \leq {[value]})=\int_{{[value]}}^{{[value]}} f(x) \; dx.\) Since \(f(x)\) is an even function, we have that \[\begin{align*} \text{P}({[value]} \leq X \leq {[value]})&=2\int_{0}^{[value]} f(x) \; dx\\ & = 2 \int_{0}^{{[value]}} \dfrac{1}{2} - \dfrac{x}{4} \; dx\\ & = 2\left(\left.\dfrac{x}{2}\right|_{0}^{{[value]}} - \left.\dfrac{x^2}{8}\right|_{0}^{{[value]}}\right) \\&= 2\left({[value]}-{[value]}\right)\\ & = {[value]}. \end{align*}\]

Exercise

A continuous random variable \(X\) has the following probability density function:

\( f_X(u) = \begin{cases} 0 & \text{if $u < 0$} \\ ku & \text{if $0 \leq u \leq [value] $} \\ 0 & \text{if $u >[value]$} \end{cases}. \)

1. Find \(k\) =
2. The distribution function is \(F_X(u) = \begin{cases} 0 & \text{if $u < 0$} \\ g(u) & \text{if $0 \leq u \leq [value] $} \\ 1 & \text{if $u >[value]$} \end{cases}.\)
\(g(u)\) =
3. \(E[X]\) =
4. \(V[X]\) =
5. \(E[e^X]\) =
6. \(V[e^X]\) =
7. The cumulative distribution function for \(e^X\) is \(F_{e^X}(u)= \begin{cases} 0 & \text{if $ u< 1 $} \\ h(u) & \text{if $1\leq u \leq e^[value]$} \\ 1 & \text{if $u> e^[value]$} \end{cases}.\)
\(h(u)\) =
8. The probability density function for \(e^X\) is \(f_{e^X}(u)= \begin{cases} 0 & \text{if $ u< 1 $} \\ l(u) & \text{if $1\leq u \leq e^[value]$} \\ 0 & \text{if $u> e^[value]$} \end{cases}.\)
\(l(u)\) =
Feedback: Solution 1. We see that \(1=\displaystyle{\int_{-\infty}^{\infty}} f_X(u) \; du = \int_0^[value] ku \; du=k\dfrac{u^2}{2}|_0^[value] = k \dfrac{[value]}{2}.\) Hence, \(k=\displaystyle{[value]}.\) 2. We see that for \(0 \leq u \leq [value] \) \(F_X(u)=\displaystyle{\int_0^u [value]} x \; dx = [value] \dfrac{x^2}{2}|_0^u=\dfrac{u^2}{[value]}. \) Hence, \(g(u)=\displaystyle{[value]}.\) 3. We have that \(E[X]=\displaystyle{\int_{-\infty}^{\infty}} [value] \; du = \int_0^[value] [value] \; du = [value] \dfrac{u^3}{3}|_0^{[value]} = [value].\) 4. We have that \(E[X^2]=\displaystyle{\int_{-\infty}^{\infty}} [value] \; du = \int_0^[value] [value] \; du = [value] \dfrac{u^4}{4}|_0^{[value]} = [value].\) Thus, \(V[X]=E[X^2]-E[X]^2=\displaystyle{[value]-[value]=[value]}.\) 5. We have that (using integration by parts) \(E[e^X]=\displaystyle{\int_0^[value]} [value] \; du = [value][ue^u|_0^[value] - \int_0^[value] e^u \; du ]= [value][[value]-([value]-1)]=[value].\) 6. We have that (using integration by parts) \(E[e^{2X}]=\displaystyle{\int_0^[value]} [value] \; du = [value][\dfrac{1}{2}ue^{2u}|_0^[value] - \int_0^[value] \dfrac{1}{2}e^{2u} \; du ]= [value][[value]-\dfrac{1}{2}([value]-1/2)]=[value].\) Thus, \(V[e^X]=E[e^{2X}]-E[e^X]^2=\displaystyle{[value]}.\) 7. We have that \(P(e^X<u)=P(X<\ln u) = \displaystyle{\int_0^{\ln u}} [value] x \; dx = \dfrac{x^2}{[value]}|_0^{\ln u}= \dfrac{\ln^2 u }{[value]},\) for \( 0 \leq \ln u \leq [value],\) i.e. \(1\leq u\leq e^[value].\) Thus, \(h(u)=\dfrac{\ln^2 u}{[value]}.\) 8. We simply have that \(l(u)=h'(u).\) Thus, \(l(u)=\displaystyle{[value]}.\)

Example

This example will help you to see how continuous random variables arise and will help you to distinguish between continuous and discrete random variables.

Consider a de-magnetised compass needle mounted at its centre so that it can spin freely. Its initial position is shown in Figure 1(a). It is spun clockwise and when it comes to rest the angle \(θ\), from the vertical, is measured. See Figure 1(b).

[Image: Initial position is north. The needle stops at a random position and its angle theta is measured clockwise.]

"angle \(θ\) measured after each spin".

Firstly, note that \(X\) is a random variable since it can take any value in the interval \(0\) to \(2\pi\) and we cannot be sure in advance which value it will take. However, after each spin and thinking in probability terms, there are certainly two distinct questions we can ask.

- What is the probability that \(X\) lies between two values \(a, b\), i.e. what is \(\text{P}(a < X < b)\)?
- What is the probability that \(X\) assumes a particular value, say \(c\). We are really asking what is the value of \(\text{P}(X = c)\)?

The first question is easy to answer provided we assume that the probability of the needle coming to rest in a given interval is given by the formula:

\(\text{Probability} = \dfrac{\text{Given interval in radians}}{\text{Total interval in radians}}=\dfrac{\text{Given interval in radians}}{2\pi}.\)

The following results are easily obtained and they clearly coincide with what we intuitively feel is correct:

(a) \(\text{P} (0 < X < \dfrac{\pi}{2}) = \dfrac{1}{4}\) since the interval \(\left(0, \dfrac{\pi}{2}\right)\) covers one quarter of a full circle.
(b) \(\text{P} (\dfrac{\pi}{2} < X < 2\pi) = \dfrac{3}{4}\); since the interval \(\left(\dfrac{\pi}{2}, 2\pi\right)\) covers three quarters of a full circle.

It is easy to see the generalization of this result for the interval \((a, b)\), in which both \(a, b\) lie in the interval \(\left(0, 2\pi\right)\) :

\(\text{P}(a < X< b)=\dfrac{b-a}{2\pi}.\)

The second question immediately presents problems! In order to answer a question of this kind would require a measuring device (e.g. a protractor) with infinite precision: no such device exists nor could one ever be constructed. Hence it can never be verified that the needle, after spinning, takes any particular value; all we can be reasonably sure of is that the needle lies between two particular values.

We conclude that in experiments of this kind we never determine the probability that the random variable assume a particular value but only calculate the probability that it lies within a given range of values. This kind of random variable is called a continuous random variable and it is characterised, not by probabilities of the type \(\text{P}(X = c)\) (as was the case with a discrete random variable), but by a function \(f(x)\) called the probability density function (pdf for short). In the case of the rotating needle this function takes the simple form given with corresponding plot:

[Image]

Figure: Plot of the pdf

where definition of the pdf is given by \[ f(x) = \begin{cases} \dfrac{1}{2\pi} & \text{for all $ 0\leq x < 2\pi$} \\ 0 & \text{elsewhere} \end{cases}. \]

The probability \(\text{P}(a < X < b)\) is the area under the function curve \(f(x)\) and so is given by the integral \[\displaystyle{\int_a^b f(x) \; dx}.\]

Suppose we wanted to find \(\text{P}(\dfrac{\pi}{6} < X < \dfrac{\pi}{4}).\) Then using the definition of the pdf for this case:

\(\text{P}(\dfrac{\pi}{6} < X < \dfrac{\pi}{4})= \displaystyle{\int_{\tiny{\dfrac{\pi}{6}}}^{\tiny{\dfrac{\pi}{4}}} \dfrac{1}{2\pi} \; dx} = \left. \dfrac{x}{2\pi} \right \vert_{\tiny{\dfrac{\pi}{6}}}^{ \tiny{\dfrac{\pi}{4}}} = \dfrac{1}{2\pi}\left(\dfrac{\pi}{4}-\dfrac{\pi}{6}\right)=\dfrac{1}{2\pi} \cdot \dfrac{\pi}{12}=\dfrac{1}{24}.\)

This is reasonable since the interval \(( \dfrac{\pi}{6}, \dfrac{\pi}{4})\) is one twenty-fourth of the interval \(0\) to \(2\pi\).

In general terms we have

\(\text{P}(a<X<b)= \displaystyle{\int_a^b f(t) \; dt} = F(b)-F(a) = \dfrac{b-a}{2\pi}\)

for the pdf under consideration here. Note also that

(a) \(f(x) \geq 0,\) for all real \(x\)

(b) \(\displaystyle{\int_{-\infty}^{\infty}} f(x) \; dx = \int_0^{2\pi} \dfrac{1}{2\pi} \; dx = 1,\) i.e. total probability is \(1\).

We are now in a position to give a formal definition of a continuous random variable in the following Key Point.

Key Point

\(X\) is said to be a continuous random variable if there exists a function \(f(x)\) associated with \(X\) called the probability density function with the properties

- \(f(x) \geq 0\) for all \(x\);
- \(\displaystyle{\int_{-\infty}^{\infty}} f(x) \; dx = 1 \);
- \(\text{P}(a < X < b) = \displaystyle{\int_{a}^{b}} f(x) \; dx = F(b) -F(a) \).

The first two bullet points in the above Key Point are the analogues of the results \(\text{P}(X = x_i) ≥ 0\) and \(\displaystyle{\sum_i P(X = x_i) =1 }\) for discrete random variables.

The Cumulative Distribution Function

Analogous to the formula for the cumulative distribution function:

        \(F(x) = \displaystyle{\sum_{x_i \leq x}} \text{P}(X = x_i) \)

used in the case of a discrete random variable \(X\) with associated probabilities \(\text{P}(X = x_i)\), we define a cumulative probability distribution function (cdf) \(F(x)\) by means of the integral (being a form of a sum):

        \(F(x) = \displaystyle{\int_{-\infty}^x} f(t) \; dt \)

The cdf represents the probability of observing a value less than or equal to \(x\).

Exercise

For the pdf in the diagram below

[Image]

obtain the cumulative distribution function:

\( F(x) = \begin{cases} 0 & \text{for all $ x \leq -2$} \\ g(x) & \text{for all $ -2< x \leq 0$} \\ h(x) & \text{for all $ 0 \leq x \leq 2$} \\ 1 & \text{for all $ x \geq 2$} \end{cases}. \)

\(g(x) = \)

\(h(x) = \)
Feedback: Solution For \( -2< x \leq 0\), we have that \[\begin{align*}F(x)&=\displaystyle{\int_{-2}^x} \dfrac{1}{2}+\dfrac{u}{4} \; du\\& = \left.\dfrac{u}{2}\right|_{-2}^x + \left.\dfrac{u^2}{8}\right|_{-2}^x\\& = [value].\end{align*}\] Hence, \(g(x) = \displaystyle{[value]}.\) For \( 0 \leq x < 2\), we have that \[\begin{align*}F(x) & = F(0) + \displaystyle{\int_0^x} \dfrac{1}{2}-\dfrac{u}{4} \; du \\& = \dfrac{1}{2} + \left.\dfrac{u}{2}\right|_{0}^x - \left.\dfrac{u^2}{8}\right|_{0}^x\\& =[value].\end{align*}\] Hence, \(h(x) = \displaystyle{[value]}.\)

Example

Traditional electric light bulbs are known to have a mean lifetime to failure of \(2000\) hours. It is also known that the distribution function \(p(t)\) of the time to failure takes the form

        \(p(t)=1-e^{-t/\mu}\)

where \(\mu\) is the mean time to failure. You will see if you study the topic of reliability in more detail that this is a realistic distribution function. The reliability function \(r(t)\), giving the probability that the light bulb is still working at time \(t\), is defined as

       \(r(t)=1-p(t)=e^{-t/\mu}.\)

Find the proportion of light bulbs that you would expect to fail before \(1500\) hours and the proportion you would expect to last longer than \(2500\) hours.

Solution

Let \(T\) be the random variable ‘time to failure’.

The proportion of bulbs expected to fail before \(1500\) hours is given as

\(P(T<1500)= 1 - e^{-1500/2000}=1-e^{1-3/4}=1-0.4724=0.5276.\)

The proportion of bulbs expected to last longer that \(2500\) hours is given as

\( \displaystyle{P(T>2500) = 1 - P(T \leq 2500) = e^{-2500/2000}=e^{-5/4}=0.2865.}\)

Using \(r(t)=1-p(t)\) we have \(r(2500)=0.2865.\)

Hence we expect just under \(53 \%\) of light bulbs to fail before \(1500\) hours service and just under \(29\%\) of light bulbs to give over 2500 hours service.

Mean and Variance of a Continuous Distribution

You will probably have realised by now that, essentially, the definitions of discrete and continuous random variables are virtually the same provided we use the analogues given in the following table:

Quantity | Discrete Variable | Continuous Variable
Probability | \(\text{P}(X=x)\) | \(f(x) \; dx\)
Allowed Values | \(\text{P}(X =x) \geq 0 \) | \(f(x) \geq 0\)
Summation | \(\displaystyle{\sum \text{P}(X=x)} \) | \(\displaystyle{\int} f(x) \; dx\)
Expectation | \(\text{E}(X)= \displaystyle{\sum x\text{P}(X=x)}\) | ?
Variance | \(\text{V}(X) = \displaystyle{\sum(x-\text{E}(X))^2\text{P}(X=x)}\) | ?

Completing the above table of analogues to write down the mean and variance of a continuous variable leads to the obvious definitions given in the following Key Point:

Key Point

Let \(X\) be a continuous random variable with associated pdf \(f(x)\). Then its expectation and variance denoted by \(E[X]\) (or \(\mu\)) and \(V[X]\) (or \(\sigma^2\) ) respectively are given by: \[\text{E}(X)=\displaystyle{\int}_{-\infty}^{\infty} x f(x) \; dx\] and \[\text{V}(X) =\displaystyle{\int}_{-\infty}^{\infty} (x-\text{E}(X))^2 f(x) \; dx = \int_{-\infty}^{\infty} x^2f(x) \; dx -\text{E}(X)^2. \]

As with discrete random variables the variance \(V[X]\) can be written in an alternative form, more amenable to calculation:\[\text{V}(X) = \text{E}(X^2)-\text{E}(X)^2\] where \[\text{E}(X^2)= \displaystyle{\int}_{-\infty}^{\infty} x^2f(x) \; dx.\]

Important Continous Distributions

There are a number of continuous distributions which have important applications in engineering and science. The areas of application and a little of the history (where appropriate) of the more important and useful distributions will be discussed in the later quizzes. Among the most important continuous probability distributions are the following.

1. The Uniform or Rectangular distribution, where the random variable \(X\) is restricted to a finite interval \([a, b]\) and \(f(x)\) has constant density often defined by a function of the form: \[ f(x) = \begin{cases} \dfrac{1}{b-a} & \text{for all $ a \leq  x \leq b$} \\ \\ 0 & \text{elsewhere} \end{cases}. \]
2. The Exponential distribution defined by a probability density function of the form: \[ f(t)= \lambda e ^{-\lambda t},\] \(\lambda\) is a given constant.
3. The Normal distribution (often called the Gaussian distribution) where the random variable \(X\) is defined by a probability density function of the form: \[f(x) = \dfrac{1}{\sigma \sqrt{2\pi}} e^{-(x-\mu)^2/2\sigma^2},\] \(\sigma, \mu\) are given constants.
4. The Weibull distribution where the random variable \(X\) is defined by a probability density function of the form: \[f(x)=\alpha \beta (\alpha x)^{\beta-1}e^{-(\alpha x)^{\beta}},\] \(\alpha, \beta\) are given constants.

Exercise

A continuous random variable \(X\) has the following probability density function and cumulative distribution function:

\[ f_X(x) = \left\{\begin{array}{ll} 0, & \text{if $x < 0$}, \\ kx, & \text{if $0 \leq x \leq [value] $}, \\ 0, & \text{if $x >[value]$}. \end{array}\right.  \]

\[ F_X(x) = \left\{\begin{array}{ll} 0, & \text{if $x < 0$}, \\ g(x), & \text{if $0 \leq x \leq [value] $}, \\ 1, & \text{if $x >[value]$}. \end{array}\right.  \]

1. Find the constant \(k\) as a whole number or a fraction.
\(k\) =
2. Using the value for \(k\), give an expression \(g(x)\) in the cumulative distribution function.
\(g(x) = \)
3. Using the value for \(k\), calculate the expectation for \(X\). Give your answer as a whole number or a fraction.
\(\text{E}(X)\) =
4. Using the value for \(k\), calculate the variance for \(X\). Give your answer as a whole number or a fraction.
\(\text{V}(X)\) =
Feedback: Solution 1. First note that for \(f_x(x) \geq 0\) on the interval \(0\leq x \leq [value]\) we must have that \(k \geq 0\). Also, for \(f_x(x)\) to be a valid probability density function, we require that it must integrate to 1 over the whole real line. Therefore, \[\begin{align*} \displaystyle{\int_{-\infty}^{\infty} f_X(x) \; dx} & = \displaystyle{\int_0^[value] kx \; dx}\\&=\displaystyle{\left. k\dfrac{u^2}{2}\right|_0^[value]}\\& = \displaystyle{k \dfrac{[value]}{2}}. \end{align*}\] This means that \(1 = \displaystyle{[value]k}\), and so \(k = \displaystyle{[value]}\). 2. We see that for \(0 \leq u \leq [value] \): \[\begin{align*} F_X(x) &= \displaystyle{\int_0^x [value] u \; du}\\& = \displaystyle{[value] \left.\dfrac{u^2}{2}\right|_0^x}\\& = \displaystyle{\dfrac{x^2}{[value]}}. \end{align*}\] Hence, \(g(x)=\displaystyle{[value]}.\) 3. The expectation for \(X\) is: \[\begin{align*}\text{E}(X)&=\displaystyle{\int_{-\infty}^{\infty} x f_X(x) \; dx}\\& = \displaystyle{\int_0^[value] [value] x^2 \; dx}\\& = \displaystyle{[value] \left.\dfrac{x^3}{3}\right|_0^{[value]}}\\ & = [value].\end{align*}\] 4. To evaluate the variance of \(X\), we must first determine the value of \(\text{E}(X^2)\): \[\begin{align*}\text{E}(X^2) & = \displaystyle{\int_{-\infty}^{\infty} x^2 f_X(x) \; dx}\\& = \displaystyle{\int_0^[value] [value]x^3 \; dx}\\& = \displaystyle{[value] \left.\dfrac{u^4}{4}\right|_0^{[value]}}\\& = [value].\end{align*}\] Thus, \(\text{V}(X)=\text{E}(X^2) - \text{E}(X)^2 = \displaystyle{[value]-\left([value]\right)^2}=\displaystyle{[value]}.\)