Chapter 3 - Continuous Random Variable
Chapter 3 - Continuous Random Variable
We have covered discrete random variables and their probability distributions in Chapter 2. In
this chapter, we are going to look at continuous random variables.
A continuous random variable is a variable that can assume any value in one or more intervals.
The possible values that a continuous random variable can assume are infinite and uncountable.
For example, the variable that represents the time taken by a worker to commute from home to
work is a continuous random variable. Suppose 5 minutes is the minimum time and 130
minutes is the maximum time taken by all workers to commute from home to work. Let x be a
continuous random variable that denotes the time taken to commute from home to work by a
randomly selected worker. Then x can assume any value in the interval 5 to 130 minutes. This
interval contains an infinite number of values that are uncountable.
This chapter will first look at continuous probability distributions in general. A continuous
random variable can possess one of many probability distributions. In this chapter, we will
discuss the uniform, normal, gamma and beta distributions.
Examples of continuous random variables: the life of battery, heights of people, time taken
to complete a test, weight of babies, prices of houses etc.
Note that although money can be counted, all variables involving money usually are considered
to be continuous random variables. This is because a variable involving money often has a very
large number of outcomes.
Note that the probability that a continuous random variable Y assumes a single value is always
zero. That is P(Y = a) = 0. Consequently, its probability distribution cannot be given in tabular
form. For illustration, let us discuss a random variable whose values are the heights of all people
over 21 years of age. Between any two values, say 163.5 and 164.5 centimeters, or even 163.99
and 164.01 centimeters, there are an infinite number of heights, one of which is 164
centimeters. The probability of selecting a person at random who is exactly 164 centimeters
tall and not one of the infinitely large set of heights so close to 164 centimeters that you cannot
humanly measure the difference is remote, and thus we assign a probability of 0 to the event.
This is not the case, however, if we talk about the probability of selecting a person who is at
least 163 centimeters but not more than 165 centimeters tall. Now we are dealing with an
interval rather than a point value of our random variable.
1
SCHOOL OF MATHEMATICAL SCIENCES
We shall concern ourselves with computing probabilities for various intervals of continuous
random variables such as P ( a X b ) , P (W c ) , and so forth. Note that when X is
continuous,
P (a X b) = P (a X b) + P ( X = b) = P (a X b)
That is, it does not matter whether we include an endpoint of the interval or not. This is not
true, though, when X is discrete.
Because areas will be used to represent probabilities and probabilities are positive numerical
values, the density function must lie entirely above the x axis.
A probability density function is constructed so that the area under its curve bounded by the x
axis is equal to 1 when computed over the range of X for which f ( x ) is defined. Should this
range of X be a finite interval, it is always possible to extend the interval to include the entire
set of real numbers by defining f ( x ) to be zero at all points in the extended portions of the
interval. In the following Figure, the probability that X assumes a value between a and b is
equal to the shaded area under the density function between the ordinates at x = a and x = b,
and from integral calculus is given by
b
P ( a X b ) = f ( x )dx
a
2
SCHOOL OF MATHEMATICAL SCIENCES
Example 1.1:
𝑐𝑥 2 , 0 ≤ 𝑥 < 2
Given that 𝑓(𝑥) = {
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
i) Find the value of c for which f (x) will be valid density function.
ii) Find P(1 ≤ X ≤ 2).
Solution
Example 1.2:
Consider a random variable X with density function
𝑐𝑥 3 (1 − 𝑥), 0 ≤ 𝑥 ≤1
𝑓(𝑥) = {
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Find P(X > 0.60).
3
SCHOOL OF MATHEMATICAL SCIENCES
Solution
Example 1.3:
The total number of hours, measured in units of 100 hours, that a family runs a vacuum cleaner
over a period of one year is a continuous random variable X that has the density function
x, 0 x 1,
f ( x ) = 2 − x,1 x 2,
0, elsewhere
Find the probability that over a period of one year, a family runs their vacuum cleaner for
(a) less than 120 hours
(b) between 50 and 100 hours
Solution
4
SCHOOL OF MATHEMATICAL SCIENCES
Definition 1.2
The cumulative distribution function F ( x ) of a continuous random variable X with density
function f ( x ) is
x
F ( x) = P ( X x) = f ( t )dt , for − x
−
As an immediate consequence of Definition 1.2, one can write the two results
dF ( x )
P ( a X b ) = F ( b ) − F ( a ) and f ( x ) = ,
dx
if the derivative exists.
Example 1.4:
Let X be a continuous random variable with probability density function given by
3𝑥 2 , 0≤𝑥≤1
𝑓(𝑥) = {
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Find F(x).
Solution
Example 1.5:
The length of time to failure (in hundreds of hours) for a transistor is a random variable Y with
distribution function given by
0 𝑖𝑓 𝑦 < 0
𝐹(𝑦) = { −𝑦 2
1−𝑒 𝑖𝑓 𝑦 ≥ 0
5
SCHOOL OF MATHEMATICAL SCIENCES
a) Find f (y).
b) Find the probability that the transistor operates for at least 200 hours.
c) Find P(Y > 1 | Y ≤ 2).
Solution
6
SCHOOL OF MATHEMATICAL SCIENCES
Example 1.6
Find F ( x ) for Example 1.3, and recalculate Example 1.3 (a) and (b) using F ( x ) .
Solution
7
SCHOOL OF MATHEMATICAL SCIENCES
Example 2.1:
Find mean for Example 1.1.
Solution
Example 2.2:
Let X have density function f(x) = 2𝑒 −2𝑥 , 0 ≤ x < ∞. Calculate the expected value of X.
Solution
8
SCHOOL OF MATHEMATICAL SCIENCES
Example 2.3:
By referring to Example 1.3, calculate the expected number of hours that a family runs a
vacuum cleaner over a period of one year.
Solution
Theorem 2.1
Let g(Y) be a function of Y; then the expected value of g(Y) is given by
∞
𝐸[𝑔(𝑌)] = ∫ 𝑔(𝑦)𝑓(𝑦) 𝑑𝑦,
−∞
provided that the integral exists.
Example 2.4:
Let X be a random variable with density function
x2
, −1 x 2
f ( x) = 3
0, elsewhere
Find the expected value of g ( X ) = 4 X + 3 .
Solution
Theorem 2.2: Let c be a constant and let g(Y), g1(Y), g2(Y), …, gk(Y) be functions of a
continuous random variable Y. Then the following results hold:
1. 𝐸[𝑐] = 𝑐.
2. 𝐸[𝑐𝑔(𝑌)] = 𝑐𝐸[𝑔(𝑌)].
3. 𝐸[𝑔1 (𝑌) + 𝑔2 (𝑌) + ⋯ + 𝑔𝑘 (𝑌)] = 𝐸[𝑔1 (𝑌)] + 𝐸[𝑔2 (𝑌)] + ⋯ + 𝐸[𝑔𝑘 (𝑌)].
9
SCHOOL OF MATHEMATICAL SCIENCES
Definition 2.2
Let X be a continuous random variable with probability density function f(x) and mean µ. The
variance of X is
∞
Var(𝑋) = 𝜎𝑋2 = 𝐸[(𝑋 − 𝜇)2 ] = ∫ (𝑋 − 𝜇)2 𝑓(𝑥)𝑑𝑥
−∞
or
∞
Var(𝑋) = 𝜎𝑋2 = 𝐸[𝑋 2 ] − 𝜇 2 = ∫−∞ 𝑥 2 𝑓(𝑥) 𝑑𝑥 − 𝜇 2
Example 2.5:
Consider a continuous random variable X with probability density function given by
2
𝑓(𝑥) = {4𝑥(1 − 𝑥 ) for 0 ≤ 𝑥 ≤ 1
0 otherwise
Calculate the standard deviation of X.
Solution
10
SCHOOL OF MATHEMATICAL SCIENCES
Example 2.6:
By referring to Example 1.3, calculate the standard deviation for the number of hours that a
family runs a vacuum cleaner over a period of one year.
Solution
Definition 3.1
If a < b, the density function of the continuous random variable Y on the interval (a, b) is
1
𝑓(𝑦) = {𝑏 − 𝑎 , 𝑎 ≤𝑦≤𝑏
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
1
Note: the density function forms a rectangle with base (b – a) and constant height .
𝑏−𝑎
➢ The uniform distribution is also known as rectangular distribution.
11
SCHOOL OF MATHEMATICAL SCIENCES
Probabilities are simple to calculate for the uniform distribution because of the simple nature
of the density function. However, note that the application of this distribution assumes that the
probability of falling in an interval of fixed length within [a, b] is constant.
Theorem 4.1: if a < b and Y is a random variable uniformly distributed on the interval (a,
b), then
𝑎+𝑏 2
(𝑏 − 𝑎)2
𝜇 = 𝐸[𝑌] = 𝑎𝑛𝑑 𝜎 = Var(𝑌) =
2 12
Example 3.1
Suppose the random variable Y is uniformly distributed on the interval [-2, 5].
a) Find the density function fy (y) and cumulative distribution function FY (y).
b) Find the mean and variance of Y.
c) Find the probability that Y is negative, P(Y < 0)
d) Find the probability that Y is equal to one, P(Y = 1).
Solution
12
SCHOOL OF MATHEMATICAL SCIENCES
Example 3.2
Suppose that a large conference room at a certain company can be reserved for no more than 4
hours. Both long and short conferences occur quite often. In fact, it can be assumed that the
length X of a conference has a uniform distribution on the interval [0, 4].
(a) What is the probability density function?
(b) What is the probability that any given conference lasts at least 3 hours?
(c) Calculate the mean and standard deviation for the length of time the conference room
is reserved.
Solution
4. Normal Distribution
The most important continuous probability distribution in the entire field of statistics is the
normal distribution, which is also referred to as the Gaussian distribution. The normal
distribution approximately describes many phenomena that occur in nature, industry, and
research. For example, physical measurements in areas such as meteorological experiments,
rainfall studies, and measurements of manufactured parts are often more than adequately
explained with a normal distribution. In addition, errors in scientific measurements are
extremely well approximated by a normal distribution.
The normal distribution also finds enormous application as a limiting distribution. Under
certain conditions, the normal distribution provides a good continuous approximation to the
binomial and hypergeometric distributions. Furthermore, it turns out that the limiting
distribution of sample averages is normal. This provides a broad base for statistical inference
that proves very valuable to the data analyst interested in estimation and hypothesis testing.
Theory in the important areas such as analysis of variance and quality control is based on
assumptions that make use of the normal distribution.
13
LO7-2 Describe
the characteristics
Characteristics of a Normal of a normal
probability
Probability Distribution distribution.
It is bell-shaped and has a single peak at the center of the
distribution.
It is symmetrical about the mean.
It is asymptotic: The curve gets closer and closer to the X-axis but
never actually touches it. To put it another way, the tails of the curve
extend indefinitely in both directions.
The location of a normal distribution is determined by the mean, .
The dispersion or spread of the distribution is determined by the
standard deviation, σ.
The arithmetic mean, median, and mode are equal.
As a probability distribution, the total area under the curve is defined
to be 1.00.
Because the distribution is symmetrical about the mean, half the area
under the normal curve is to the right of the mean, and the other half
to the left of it.
7-3
LO7-2
7-4
LO7-2
and
V ar(Y ) = V ar(a + bX) = b2 V ar(X) = b2 σ 2 ,
i.e. Y = a + bX has distribution Y ∼ N (a + bµ, b2 σ 2 ).
The standard normal
X −µ
Z=
σ
(this transformation is called ‘standardising’).
Then Z ∼ N (0, 1) is a standard normal random variable with
mean 0 and variance 1.
Calculating with Normal distributions
Example 4.1
Find the following probabilities for the standard normal distribution, Z ~ N (0, 1).
a) P (-2.98 < Z < 0.99)
b) P (-1.75 < Z < -1.04)
c) P (Z > -0.23)
d) P (Z > 2)
e) P (0 ≤ Z ≤ 1.73)
f) P (|Z| < 0.73)
1
SCHOOL OF MATHEMATICAL SCIENCES
Example 4.2
ABC produces many types of soft drinks, including Cola. The amount of soda in each can of
Cola has a normal distribution with a mean of 12 ounces and a standard deviation of 0.015
ounce.
a) What is the probability that a randomly selected can of Cola contains 11.97 to 11.99
ounces of soda?
b) What percentage of the Cola cans contain 12.02 to 12.07 ounces of soda?
Example 4.3
The average age of a mathematics faculty member is 56.2 years. Assume that age is normally
distributed with variance of 25.
a) Calculate the probability that a mathematics faculty member is less than 60.
b) Calculate the probability that a mathematics faculty member is between 48 and 59.
2
Example
Example
The diameter of bolts measured in mm are modelled by X which
has a normal distribution with mean 20 and variance 4.
1 What is the probability that the bolts diameter is smaller than
22mm?
2 What is the probability that the bolts diameter is larger than
19mm?
3 For a bolt to fit in the associated nut the diameter has to lie
between 18mm and 21mm, what proportion of bolts meet this
specification?
Example
Example 4.4
The average grade for an exam is 74, and the standard deviation is 7. If 12% of the class is
given As, and the grades are curved to follow a normal distribution, what is the lowest possible
A and the highest possible B?
1
LO7-3
It turns out that the exponential distribution is a special case of the gamma distribution. Both
find a large number of applications. The exponential and gamma distributions play an
important role in queuing theory and reliability problems. Time between arrivals at service
facilities and time to failure of component parts and electrical systems are often nicely
modelled by the exponential distribution. The relationship between the gamma and the
exponential allows the gamma to be used in similar types of problems.
The gamma distribution derives its name from the well-known gamma function, studied in
many areas of mathematics. Before we proceed to the gamma distribution, let us review this
function and some of its important properties.
Definition 5.1
The gamma function is defined by
( ) = x −1e − x dx , for 0
0
Definition 5.2
The continuous random variable Y has a gamma distribution, with parameters α > 0 and β >0,
if its density function is given by
𝑦 𝛼−1 𝑒 −𝑦/𝛽
𝑓(𝑦) = { 𝛽 𝛼 Γ(𝛼) , 0 ≤ 𝑦 < ∞
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
∞
where Γ(𝛼) = ∫0 𝑦 𝛼−1 𝑒 −𝑦 𝑑𝑦.
The following shows the graphs of several gamma distributions for certain specified values of
the parameters and . The special gamma distribution for which = 1 is called the
exponential distribution.
1
SCHOOL OF MATHEMATICAL SCIENCES
Definition 5.3
The continuous random variable X has an exponential distribution, with parameter β, if its
density function is given by
1 −𝑥⁄𝛽
−𝜆𝑥 𝑒 , 𝑥>0
𝑓(𝑥) = 𝜆𝑒 = {𝛽
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
where β > 0.
Theorem 5.1
The mean and variance of the gamma distribution are
= and 2 = 2
Theorem 5.2
The mean and variance of the exponential distribution are
= and 2 = 2
2
Example
Let X be the length of time until the next bus arrives so we have
X ∼ Exp(1/20).
1 Z ∞
1 −x −20
P(X > 20) = e 20 dx = e 20 = 0.368
20 20
2
Z 20
1 −x −5 −20
P(5 < X < 20) = e 20 dx = e 20 − e 20 = 0.411
5 20
Example
Example
Suppose the length of times between failures of generators at a
dam have an exponential distribution. The average time, as
measured by the median, is 624 minutes.
What is the average times as measured by the mean?
What percentage of times are greater than 1000 minutes ?
SCHOOL OF MATHEMATICAL SCIENCES
Example 5.1
Based on extensive testing, it is determined that the time Y in years before a major repair is
required for a certain washing machine is characterized by the exponential distribution with
mean 4 years. The machine is considered a bargain if it is unlikely to require a major repair
before the sixth year. Evaluate whether the machine is considered a bargain.
Example 5.2
Suppose that a system contains a certain type of component whose time, in years, to failure is
given by T. The random variable T is modelled nicely by the exponential distribution with mean
time to failure = 5 . If 5 of these components are installed in different systems, what is the
probability that at least 2 are still functioning at the end of 8 years?
1
SCHOOL OF MATHEMATICAL SCIENCES
Example 5.3
In a biomedical study with rats, a dose-response investigation is used to determine the effect
of the dose of a toxicant on their survival time. The toxicant is one that is frequently discharged
into the atmosphere from jet fuel. For a certain dose of the toxicant, the study determines that
the survival time, in weeks, has a gamma distribution with = 5 and = 10 . What is the
probability that a rat survives no longer than 60 weeks?
Example 5.4
It is known, from previous data, that the length of time in months between customer complaints
about a certain product is a gamma distribution with = 2 and = 4 . Changes were made to
tighten quality control requirements. Following these changes, 20 months passed before the
first complaints. Does if appear as if the quality control tightening was effective?
2
SCHOOL OF MATHEMATICAL SCIENCES
When the time between events follow the exponential distribution, the exponential distribution
describes the time until the occurrence of an event (or the time between events). However, the
time until a specified number of events occur is a random variable whose density function is
described by the gamma distribution. This specific number of events is the parameter in the
gamma density function. Note that for such cases, the time between events is described by an
exponential distribution.
Example 5.5
Suppose that the time between telephone calls arriving at a particular switchboard follow an
exponential distribution with a mean of 0.2 minutes. What is the probability that up to a minute
will elapse by the time 2 calls have come in to the switchboard?
Definition 6.1
A beta function is defined by
1
( ) ( )
B ( , ) = x −1 (1 − x )
−1
dx = , for , 0 ,
0
( + )
where ( ) is the gamma function.
Definition 6.2
The continuous random variable Y has a beta distribution with parameters α > 0 and β > 0 if
its density function is given by
𝑦 𝛼−1 (1 − 𝑦)𝛽−1
𝑓(𝑦) = { , 0 ≤ 𝑦 ≤ 1,
𝐵(𝛼, 𝛽)
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Note that the uniform distribution on (0, 1) is a beta distribution with parameters = 1 and
= 1.
3
SCHOOL OF MATHEMATICAL SCIENCES
Theorem 6.1
If Y is a beta-distributed random variable with parameters α > 0 and β > 0, then
𝛼 𝛼𝛽
𝜇 = 𝐸(𝑌) = 𝑎𝑛𝑑 𝜎 2 = 𝑉(𝑌) = 2
.
𝛼+𝛽 (𝛼 + 𝛽) (𝛼 + 𝛽 + 1)
Example 6.1
Suppose the random variable X follows a beta distribution with = 1 and = 3 .
(a) Determine the mean and variance of X.
1
(b) Find the probability that X .
3
Example 6.2
If the proportion of a brand of television set requiring service during the first year of operation
is a random variable having a beta distribution with = 3 and = 2 , what is the probability
that at least 80% of the new models of this brand sold this year will require service during their
first year of operation?
4
SCHOOL OF MATHEMATICAL SCIENCES
7. Chebyshev’s Theorem
Let Y be a random variable with finite mean µ and variance σ2. Then, for any k > 0,
1 1
𝑃(|𝑌 − 𝜇| ≤ 𝑘𝜎) ≥ 1 − 2
or 𝑃(|𝑌 − 𝜇| > 𝑘𝜎) ≤ 2 .
𝑘 𝑘
Example 7.1
A manufacturer of tires wants to advertise a mileage interval such that at least 90% of the tires
he sells has mileage in that interval. However, he only knows that the mean mileage was 25,000
miles, and the standard deviation was 4000 miles. He has no information on the probability
distribution for the tires’ mileage. What interval would you suggest?