Continuous Random Variables
Continuous Random Variables
Subject: Statistics
❖ Random variable
a variable (typically represented by x)
that has a single numerical value,
determined by chance, for each
outcome of a procedure
❖ Probability distribution
a description that gives the probability
for each value of the random variable;
often expressed in the format of a
graph, table, or formula
TWO TYPES OF RANDOM
VARIABLES
𝑃 𝑎 ≤ 𝑥 ≤ 𝑏 = න𝑓 𝑥 𝑑 𝑥
𝑎
That is, the probability that X takes on a value in the interval [a, b] is the area above
this interval and under the graph of the density function, as illustrated in Figure. The
graph of 𝑓(𝑥) is often referred to as the density curve.
Continuous Random Variables
Probability Density Function
For f(x) to be a legitimate pdf, it must satisfy the following two conditions:
1. 𝒇(𝒙) ≥ 𝟎 for all x
∞
2.−∞ 𝑓 𝑥 𝑑𝑥 = area under the entire graph of f(x)
=1
Continuous Random Variables
x
1
1 = x
0
0
=1− 0 =1
Example: Uniform distribution
p(x)
¼ ½ x
1
P(½ x ¼ )= ¼
Normal Distribution
Introduction: Normal distribution
800
600
400
200
0
140 148 156 164 172 180 188 More
Height (cm )
Bell Shaped
Symmetrical f(X)
Mean, Median and Mode
are Equal
Location is determined by σ
the mean, μ X
μ
Spread is determined by the
standard deviation, σ
Mean
= Median
The random variable has an
= Mode
infinite theoretical range:
+ to −
Introduction: Normal distribution
This is called
If we were to draw a smooth the normal
curve through the mid-points of curve.
the bars in the histogram of
these heights, it would have the
following shape:
x
μ–σ μ+σ
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Introduction: Normal distribution
If X has a normal distribution with mean μ, and variance σ2, we write
X ~ N[μ, σ2]
x
μ – 2σ μ + 2σ
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Three standard deviations from the
mean
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Introduction: Normal distribution
If X has a normal distribution with mean μ, and variance σ2, we write
X ~ N[μ, σ2]
x
μ – 3σ μ + 3σ
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
95% of data fits within 2σ of the μ
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
P(X ≥ 20);
P(–5 < X < 9);
P(X = 19 to the nearest whole number),
i.e. P(18.5 ≤ X < 19.5).
y
Probabilities correspond to
areas underneath the normal
x
curve.
There is no simple formula that can be used to find the
probabilities. Instead, the probabilities are found from
tables.
The standard normal distribution
x
-3 -2 -1 1 2 3
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
z 0 1 2 3 4 5 6 7 8 9
0.0 .5000 .5040 .5080 .5120 .5160 .5199 .5239 .5279 .5319 .5359
0.1 .5398 .5438 .5478 .5517 .5557 .5596 .5636 .5675 .5714 .5753
0.2 .5793 .5832 .5871 .5910 .5948 .5987 .6026 .6064 .6103 .6141
0.3 .6179 .6217 .6255 .6293 .6331 .6368 .6406 .6443 .6480 .6517
0.4 .6554 .6591 .6628 .6664 .6700 .6736 .6772 .6808 .6844 .6879
0.5 .6915 .6950 .6985 .7019 .7054 .7088 .7123 .7157 .7190 .7224
0.6 .7257 .7291 .7324 .7357 .7389 .7422 .7454 .7486 .7517 .7549
0.7 .7580 .7611 .7642 .7673 .7704 .7734 .7764 .7794 .7823 .7852
0.8 .7881 .7910 .7939 .7967 .7995 .8023 .8051 .8078 .8106 .8133
If X ~ N[ ,
2
]then X −
Z= ~ N[0,1].
N[ , 2 ] y N[0, 1]
y
Standardise
x
x -3 -2 -1 1 2 3
More general normal distributions
Example: If X ~ N[20, 16] , find
a) P(X < 23);
b) P(X > 14);
c) P(16 < X < 24.8).
x x
16 20 24.8 -1 0 1.2
Standardise
y y
124 − 100
= 1 .6
15
x x
100 124 0 1.6
So, we want P(X > 124) = P(Z > 1.6)
= 1 – P(Z ≤ 1.6) = 1 – 0.9452
= 0.0548
The Normal Distribution
Density Function
◼ The formula for the normal probability density function is
2
1 (X −μ)
1 −
2
f(X) = e
2π
Where e = the mathematical constant approximated by 2.71828
π = the mathematical constant approximated by 3.14159
μ = the population mean
σ = the population standard deviation
X = any value of the continuous variable
By varying the parameters μ and σ, we
obtain different normal distributions
A
B
C
Changing σ increases
or decreases the
σ spread.
μ X
The Standardized Normal
X −μ
Z=
σ
The Z distribution always has mean = 0 and
standard deviation = 1
The Standardized Normal Probability
Density Function
1 −(1/2)Z2
f(Z) = e
2π
1
Z
0
Values above the mean have positive Z-values.
Values below the mean have negative Z-
values.
Example
X − μ $200 − $100
Z= = = 2.0
σ $50
This says that X = $200 is two standard deviations (2 increments of $50
units) above the mean of $100.
Comparing X and Z units
a b X
Probability as
Area Under the Curve
The total area under the curve is 1.0, and the curve is
symmetric, so half is above the mean, half is below
f(X) P( − X μ) = 0.5
P(μ X ) = 0.5
0.5 0.5
μ X
P( − X ) = 1.0
The Standardized Normal Table
0.9772
Example:
P(Z < 2.00) = 0.9772
0 2.00 Z
The Standardized Normal Table
(continued
)
The column gives the value of
Z to the second decimal point
Z 0.00 0.01 0.02 …
X
18.0
18.6
Finding Normal Probabilities
(continued)
Let X represent the time it takes, in seconds to download an image
file from the internet.
Suppose X is normal with a mean of 18.0 seconds and a standard
deviation of 5.0 seconds. Find P(X < 18.6)
X − μ 18.6 − 18.0
Z= = = 0.12
σ 5.0
μ = 18 μ=0
σ=5 σ=1
18 18.6 X 0 0.12 Z
X
18.0
18.6
Finding Normal
Upper Tail Probabilities (continued
Now Find P(X > 18.6)… )
0.5478
1.000 1.0 - 0.5478
= 0.4522
Z Z
0 0
0.12 0.12
Finding a Normal Probability Between
Two Values
Suppose X is normal with mean 18.0 and standard deviation 5.0. Find
P(18 < X < 18.6)
Calculate Z-values:
X − μ 18 − 18
Z= = =0
σ 5
18 18.6 X
X − μ 18.6 − 18 0 0.12 Z
Z= = = 0.12
σ 5 P(18 < X < 18.6)
= P(0 < Z < 0.12)
Solution: Finding P(0 < Z < 0.12)
X
18.0
17.4
Probabilities in the Lower Tail
(continued
)
Example: A Z variable
of 1.96 has cumulative
probability 0.9750.
123
Step 2 (cont.)
Turn value into z score:
x−
z=
z-score = no. of σ-units above (positive z) or below
(negative z) distribution mean μ
Poisson distribution 𝑒 −𝜆 𝜆𝑘
𝑃 𝑋=𝑘 =
𝑘!
Probablily of 𝑘 randomly occurring events, given average number is 𝜆
component fails
5%
1 2 3 4
Are they Poisson? Answers:
NO, solar eclipses are not random events and this is a time
between random events, not the number in some fixed interval
If a Poisson process has constant average rate 𝜈, the mean after a time
𝑡 is 𝜆 = 𝜈𝑡.
What is the probability distribution for the time to the first event?
⇒ Exponential distribution
𝑓(𝑦) 𝜈=1
−𝜈𝑦
𝜈𝑒 , 𝑦>0
𝑓 𝑦 =ቊ
0, 𝑦<0
𝑦
Occurrence
𝑒 −𝜆 𝜆𝑘
𝑃 𝑘=0 = = 𝑒 −𝜆 = 𝑒 −𝜈𝑡 .
𝑘!
If 𝑓(𝑡) is the pdf for the first occurrence, then the probability of no
occurrences is
𝑡 = −𝑒 −3 + 1 ≈ 0.95
Exponential distribution
A certain type of component can be
purchased new or used. 50% of all new
components last more than five years,
but only 30% of used components last
more than five years. Is it possible that the
lifetimes of new components are
53%
exponentially distributed?
1. YES
2. NO
48%
1 2
Exponential distribution
The observed lifetimes imply that instead the failure rate must increase with time
NOT exponential
Mean and variance of exponential distribution
∞ ∞ ∞ −𝜈𝑦 ∞
∞
𝑒 1
𝜇 = න 𝑦 𝑓 𝑦 𝑑𝑦 = න 𝑦𝜈𝑒 −𝜈𝑦 𝑑𝑦 = −𝑦𝑒 −𝜈𝑦 0 +න 𝑒
−𝜈𝑦
𝑑𝑦 = − =
−∞ 0 0 𝜈 0
𝜈
∞ ∞
2 2 2 2
1
−𝜈𝑦
𝜎 = න 𝑦 𝑓 𝑦 𝑑𝑦 − 𝜇 = න 𝑦 𝜈𝑒 𝑑𝑦 − 2
−∞ 0 𝜈
∞
2 −𝜈𝑦 ∞ −𝜈𝑦
1 𝜇 1 1
= −𝑦 𝑒 0 + 2න 𝑦 𝑒 𝑑𝑦 − 2 = 0 + 2 − 2 = 2
0 𝜈 𝜈 𝜈 𝜈
𝜎 𝜎
𝜈=3
1
𝜇=
3
Example: Reliability
(a) What is the probability that a component is still working after 5000
hours?
(b) Find the mean and standard deviation of the time till failure.
Answer
Answer:
Mean = 1/𝜈 = 9491 hours.
Standard deviation = Variance
1
= = 1/𝜈 = 9491 hours
𝜈2
Is it exponential?
Question adapted
from Derek Bruff
- NO: continuous (if you allow fractional days), but draws happen
regularly on a schedule