Lecture 5
Lecture 5
Statistics for
Engineers
Continuous Random Variables
Random
Variables (cont’d)
● Continuous Random Variables and Their
Probability Distributions
● Mean, Variance, and Standard Deviation of
Continuous Random Variables
Random Variables
A random variable is a function that assigns a numerical value
to each outcome of a random experiment (each outcome in a
sample space).
A factory
A factory
inspects
tests 5a products
randomly and
selected
countsbattery
the number
and measures
of defective
how long
items.
it If
operates
the random
before
variable
failure.𝑋
represents
If the random
the number
variableof defective
𝑋 represents
items
theinlifespan
the batch,
of apossible
battery (in
values
hours),
of 𝑋andarea0,battery
1, 2, 3, can
4, and
last5.
anywhere from 50 to 150 hours, then𝑅𝑅 == 0,1,2,3,4,5
50,150 .
Random Variables
Random Variables
Discrete Continuous
Random Variables
Discrete Continuous
A continuous random variable takes on an infinite number of values within a given range.
Since 𝐹 𝑥 = ∫ 𝑓 𝑢 𝑑𝑢 ,
Properties of the cdf:
𝑑
i. 𝐹 is a nondecreasing function 𝑓 𝑥 = 𝐹 𝑥
𝑑𝑥
if the derivative exists.
ii. 𝐹 is a continuous function
→ →
Continuous Random Variables
For continuous random variables, probabilities are determined using either the probability density
function (𝑓 𝑥 ) or the cumulative distribution function (𝐹 𝑥 ).
𝑓 𝑥 𝑓 𝑥
𝑥 𝑥
𝑎 𝑎 𝑏
= 𝑓 𝑥 𝑑𝑥
=𝐹 𝑎 =1−𝐹 𝑎
=𝐹 𝑏 −𝐹 𝑎
Mean of a Continuous Random Variable
𝐸 𝑋 =𝜇 = 𝑥𝑓 𝑥 𝑑𝑥
If 𝑋 is a continuous random variable, then the expected value of a function of 𝑋, say 𝑔 𝑋 , can be
obtained by
𝐸 𝑔 𝑋 =𝜇 = 𝑔 𝑥 𝑓 𝑥 𝑑𝑥
Variance and Standard Deviation of a
Continuous Random Variable
The variance, 𝑉𝑎𝑟 𝑋 or 𝜎 , of a continuous random variable 𝑋 is defined as
𝑉𝑎𝑟 𝑋 = 𝜎 = 𝐸 𝑋 − 𝜇 = 𝑥−𝜇 𝑓 𝑥 𝑑𝑥
𝑉𝑎𝑟 𝑋 = 𝜎 = 𝐸 𝑋 − 𝐸 𝑋 = 𝑥 𝑓 𝑥 𝑑𝑥 − 𝑥𝑓 𝑥 𝑑𝑥
𝐸 𝑎𝑋 + 𝑏𝑌 + 𝑐 = 𝜇 = 𝑎𝜇 + 𝑏𝜇 + 𝑐
𝑉𝑎𝑟 𝑎𝑋 + 𝑏𝑌 + 𝑐 = 𝜎 =𝑎 𝜎 +𝑏 𝜎
Example: An engineer is analyzing the power output of two independent
generators that supply electricity to an industrial facility. Let 𝑋 and 𝑌 be
the power outputs (in MW) of Generator 1 and Generator 2, respectively.
The facility's total net power supply is affected by:
• 3𝑋 (since Generator 1 is used in high-demand mode, supplying 3 times its base output),
• −2𝑌 (since Generator 2 runs in backup mode and sometimes reduces the total supply),
• a constant base power of 5 MW is always available from an auxiliary system.
Thus, the total power supplied to the facility is modeled as 𝑍 = 3𝑋 − 2𝑌 + 5.
𝑍 = 3𝑋 − 2𝑌 + 5 ⟹ 𝜇 = 3𝜇 − 2𝜇 + 5 = 3 3 − 2 4 + 5 = 9 − 8 + 5 = 6 MW
𝜎 = 3 𝜎 + −2 𝜎 = 5 = 9 2 + 4 3 = 30 MW2
Example: An engineer is analyzing the thickness (in mm) of a metal sheet
produced by an industrial rolling machine. The random variable 𝑋 represents
the thickness of a randomly selected sheet.
Due to manufacturing imperfections, the thickness varies between 2 mm and 5 mm, following
the probability distribution
𝑘 5 − 𝑥 if 2 ≤ 𝑥 ≤ 5
𝑓 𝑥 =
0 otherwise
where 𝑘 is a constant.
ii. 𝑓 𝑥 𝑑𝑥 = 1
Since 𝑓 𝑥 is defined as
𝑘 5−𝑥 if 2 ≤ 𝑥 ≤ 5
𝑓 𝑥 =
0 otherwise
𝑥 25 4 9𝑘
𝑓 𝑥 𝑑𝑥 = 0𝑑𝑥 + 𝑘 5 − 𝑥 𝑑𝑥 + 0𝑑𝑥 = 𝑘 5𝑥 − = 𝑘 25 − − 10 + = = 1.
2 2 2 2
So,
2
𝑘=
9
Continuous Random Variables
b) If
2
𝑘= ,
9
then
2
𝑓 𝑥 = 9 5−𝑥 if 2 ≤ 𝑥 ≤ 5
0 otherwise
The graph of 𝑓 𝑥 is 𝑓 𝑥
10⁄9
1
8⁄9
7⁄9
6⁄9
5⁄9
4⁄9
3⁄9
2⁄9
1⁄9
𝑥
0 1 2 3 4 5 6
Continuous Random Variables
Recall:
c) Recall that, 𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = 𝑃 𝑋 < 𝑥 = ∫ 𝑓 𝑢 𝑑𝑢 .
𝐹 𝑥
𝐹 𝑥 =∫ 𝑓 𝑢 𝑑𝑢 = ∫ 0𝑑𝑢 = 0 𝑓 𝑥
Case 2 (2 ≤ 𝑥 ≤ 5):
𝐹 𝑥 =∫ 𝑓 𝑢 𝑑𝑢 = ∫ 0𝑑𝑢 + ∫ 5 − 𝑢 𝑑𝑢 = − + −
The graph of 𝐹 𝑥 is 𝐹 𝑥
𝑥
0 1 2 3 4 5 6
Continuous Random Variables
d) 𝑃 "thickness is between 3 mm and 4 mm" = 𝑃 3 ≤ 𝑋 ≤ 4 can be found using either 𝑓 𝑥 or 𝐹 𝑥 .
5−𝑥 if 2 ≤ 𝑥 ≤ 5
Using 𝑓 𝑥 =
0 otherwise
2 2 𝑥 2 16 9 1
𝑃 3≤𝑋≤4 = 𝑓 𝑥 𝑑𝑥 = 5 − 𝑥 𝑑𝑥 = 5𝑥 − = 20 − − 15 + =
9 9 2 9 2 2 3
0 if 𝑥 < 2
Using 𝐹 𝑥 = − + − if 2 ≤ 𝑥 ≤ 5
1 if 𝑥 > 5
16 40 16 9 30 16 1
𝑃 3≤𝑋 ≤4 =𝐹 4 −𝐹 3 =− + − − − + − =
9 9 9 9 9 9 3
Continuous Random Variables
2 2 5𝑥 𝑥
e) 𝐸 𝑋 =𝜇 = 𝑥𝑓 𝑥 𝑑𝑥 = 0𝑑𝑥 + 𝑥 5 − 𝑥 𝑑𝑥 + 0𝑑𝑥 = − =3
9 9 2 3
2
f) 𝑉𝑎𝑟 𝑋 = 𝜎 = 𝑥−𝜇 𝑓 𝑥 𝑑𝑥 = 𝑥 − 3 𝑓 𝑥 𝑑𝑥 = 0𝑑𝑥 + 𝑥−3 5 − 𝑥 𝑑𝑥 + 0𝑑𝑥
9
2 𝑥 11𝑥 39𝑥 1
= − + − + 45𝑥 =
9 4 3 2 2
2 2 5𝑥 𝑥 19
or 𝐸 𝑋 = 𝑥 𝑓 𝑥 𝑑𝑥 = 0𝑑𝑥 + 𝑥 5 − 𝑥 𝑑𝑥 + 0𝑑𝑥 = − =
9 9 3 4 2
19 1
𝑉𝑎𝑟 𝑋 = 𝜎 = 𝐸 𝑋 − 𝐸 𝑋 = − 3 =
2 2
1
𝑆𝐷 𝑋 = 𝜎 = 𝜎 = ≅ 0.7071
2
Example: A software development company frequently outsources
projects to freelance developers through a competitive bidding process.
For each project, the company provides an estimated budget, denoted
as 𝑏.
Based on historical data, the company has determined that the density function of the winning
(lowest) bid is given by
2 𝑏
𝑓 𝑥 = 3𝑏 if ≤ 𝑥 ≤ 2𝑏
2
0 otherwise
a) Obtain the probability that the winning bid is less than the estimated budget.
b) Obtain the expected winning bid.
c) Obtain the standard deviation of the winning bid.
Continuous Random Variables
Let 𝑋 denote the winning bid. Then 𝑋 is a continuous random variable with range 𝑅 = , 2𝑏 , where 𝑏 is
the estimated budget, a constant.
b) 𝐸 𝑋 = 𝜇 = ∫ 𝑥𝑓 𝑥 𝑑𝑥 = ∫ 𝑥 𝑑𝑥 =
c) 𝐸 𝑋 =∫ 𝑥 𝑓 𝑥 𝑑𝑥 = ∫ 𝑥 𝑑𝑥 =
𝑉𝑎𝑟 𝑋 = 𝜎 = 𝐸 𝑋 − 𝐸 𝑋 = − =
𝑆𝐷 𝑋 = 𝜎 = 𝜎 = =
Example: An engineer studies the failure time (in hours) of a critical electronic
component used in an industrial machine. The failure time, represented by the
random variable 𝑋, has the following probability distribution
𝑓 𝑥 = 0.02𝑒
.
if 𝑥 ≥ 0
0 otherwise
a) What is the probability that the component fails between 50 and 150 hours?
b) What is the probability that the component lasts more than 100 hours?
c) What is the mean failure time?
d) What is the standard deviation of the failure time?
Continuous Random Variables
a) 𝑃 "component fails between 50 and 150 hours" is equivalent to 𝑃 50 ≤ 𝑋 ≤ 150 .
.
1 .
𝑃 50 ≤ 𝑋 ≤ 150 = 𝑓 𝑥 𝑑𝑥 = 0.02𝑒 𝑑𝑥 = 0.02 − 𝑒 =𝑒 −𝑒 ≅ 0.3181
0.02
.
𝑃 𝑋 > 100 = 𝑓 𝑥 𝑑𝑥 = 0.02𝑒 𝑑𝑥 = ⋯ = 𝑒 ≅ 0.1353
c) 𝐸 𝑋 = 𝜇 = ∫ 𝑥𝑓 𝑥 𝑑𝑥 = ∫ 0.02𝑥𝑒 .
𝑑𝑥 = ⋯ = 50 hours
d) 𝐸 𝑋 =∫ 𝑥 𝑓 𝑥 𝑑𝑥 = ∫ 0.02𝑥 𝑒 .
𝑑𝑥 = ⋯ = 5000
𝑉𝑎𝑟 𝑋 = 𝜎 = 𝐸 𝑋 − 𝐸 𝑋 = 5000 − 50 = 2500 hours2
𝑆𝐷 𝑋 = 𝜎 = 𝜎 = 2500 = 50 hours
Example: Let 𝑋 be a continuous random variable representing the total power
consumption, in units of 100 kWh, of a household air conditioner over a period
of one year. The density function (pdf) of 𝑋 is given by
𝑥 − 1 if 1 ≤ 𝑥 ≤ 2
𝑓 𝑥 = 3 − 𝑥 if 2 < 𝑥 ≤ 3
0 otherwise
a) Find the probability that the power consumption is between 150 and 250 kWh. 0.75
b) Find the mean of 𝑋. 2 0 if 𝑥 < 1
c) Find the standard deviation of 𝑋. 0.4082 𝑥 1
−𝑥+ if 1 ≤ 𝑥 ≤ 2
d) Obtain the cumulative distribution function of 𝑋. 𝐹 𝑥 = 𝑥2 2
7
− + 3𝑥 − if 2 < 𝑥 ≤ 3
2 2
1 if 𝑥 > 3
[email protected]
CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik