Continuous Random Variables and Probability .Distributions
Continuous Random Variables and Probability .Distributions
Probability Distributions
1 / 52
Learning Objectives
After careful study of this topic, you should be able to do the following:
1. Determine probabilities from probability density functions.
2. Determine probabilities from cumulative distribution functions, and cumulative
distribution functions from probability density functions, and the reverse.
3. Calculate means and variances for continuous random variables.
4. Understand the assumptions for continuous probability distributions.
5. Select an appropriate continuous probability distribution to calculate probabilities
for specific applications.
6. Calculate probabilities, means and variances for continuous probability
distributions.
7. Standardize normal random variables.
8. Use the table for the cumulative distribution function of a standard normal
distribution to calculate probabilities.
9. Approximate probabilities for Binomial and Poisson distributions.
2 / 52
Continuous Random Variables
Examples
3 / 52
Probability Density Function
Rb
3. P(a ≤ X ≤ b) = f (x)dx = area under f (x)dx from a to b
a
4 / 52
Example 4-1: Electric Current
Let the continuous random variable X denote the current
measured in a thin copper wire in milliamperes(mA).
Assume that the range of X is 4.9 ≤ x ≤ 5.1 and f (x) = 5.
What is the probability that a current is less than 5mA?
Answer:
R5
P(X <5) = f (x)dx =
4.9
R5
5dx = 0.5
4.9
P(4.95<X <5.1) =
5.1
R
f (x)dx = 0.75 Figure 1: P(X <5) illustrated
4.95
5 / 52
Cumulative Distribution Functions
6 / 52
Example 4-3: Electric Current
For the copper wire current measurement in Exercise 4-1, the
cumulative distribution function consists of three expressions.
7 / 52
Probability Density Function from the Cumulative
Distribution Function
dF (x)
Given F(x) , f(x) = as long as the derivative exists.
dx
8 / 52
Exercise 4-5: Reaction Time
I The time until a chemical reaction is complete (in
milliseconds, ms) is approximated by this cumulative
distribution function:
(
0, for x<0
F (x) = −0.01x
1-e , for 0≤ x
I What is the Probability (
density function?
dF (x) d 0
f (x) = = = =
dx dx 1-e−0.01x
(
0, for x<0
0.01e−0.01x , for 0≤ x
I What proportion of reactions is complete within 200 ms?
P(X <200) = F (200) = 1 − e−2 = 0.8647
9 / 52
Mean & Variance
10 / 52
Example 4-6: Electric Current
11 / 52
Mean of a Function of a Continuous Random Variable
12 / 52
Continuous Uniform Distribution
I This is the simplest continuous distribution and analogous
to its discrete counterpart.
I A continuous random variable X with probability density
function
f(x) = 1 / (b-a) for a ≤ x ≤ b
13 / 52
Mean & Variance
(a + b)
µ = E(X ) =
2
and
(b − a)2
σ 2 = V (X ) =
12
14 / 52
Example 4-9: Uniform Current
The random variable X has a continuous uniform distribution on
[4.9, 5.1]. The probability density function of X is f(x) = 5,
4.9 ≤ x ≤ 5.1. What is the probability that a measurement of
current is between 4.95 & 5.0 mA?
5.0
R
P(4.95<x<5.0) = f (x)dx = 5(0.05) = 0.25
4.95
The mean and variance formulas can be applied with a = 4.9
and b = 5.1. Therefore,
(0.2)2
µ = E(X ) = 5 mA and V (X ) = = 0.0033mA2
12
Figure 5 15 / 52
Cumulative
x
distribution function of Uniform distribution
R1 x −a
F (x) = du =
a (b − a) b−a
The Cumulative distribution function is
0,
x<a
F (x) = (x − a)/(b − a), a ≤ x<b
1 b≤x
17 / 52
Empirical Rule
For any normal random variable,
P(µ–σ<X <µ + σ) = 0.6827
P(µ–2σ<X <µ + 2σ) = 0.9545
P(µ–3σ<X <µ + 3σ) = 0.9973
19 / 52
Example 4-11: Standard Normal Distribution
Assume Z is a standard normal random variable.
Find P(Z ≤ 1.50). Answer: 0.93319
21 / 52
Example 4-14: Normally Distributed Current-1
Suppose that the current measurements in a strip of wire are
assumed to follow a normal distribution with µ = 10 and σ = 2
mA, what is the probability that the current measurement is
between 9 and 11 mA?
Answer:
9 − 10 x − 10 11 − 10
P(9<X <11) = P < <
2 2 2
= P(−0.5<z<0.5)
= P(z<0.5) − P(z< − 0.5)
= 0.69146 − 0.30854 = 0.38292
Using Excel
0.38292 NORMDIST(11,10,2,TRUE)-NORMDIST(9,10,2,TRUE)
22 / 52
Example 4-14: Normally Distributed Current-2
Determine the value for which the probability that a current
measurement is below 0.98.
Answer:
X − 10 x − 10
P(X <x) = P <
2 2
X − 10
= P Z< = 0.98
2
z = 2.055 is the closest value.
x = 2(2.055) + 10 = 14.11mA.
Using Excel
14.107 =NORMINV(0.98,10,2)
23 / 52
Normal Approximations
24 / 52
Normal Approximation to the Binomial Distribution
If X is a binomial random variable with parameters n and p,
X − np
Z =p
np(1 − p)
is approximately a standard normal random variable. To
approximate a binomial probability with a normal distribution, a
continuity correction is applied as follows: !
x + 0.5 − np
P(X ≤ x) = P(X ≤ x + 0.5) ≈ P Z ≤ p
np(1 − p)
and
!
x − 0.5 − np
P(X < x) = P(X ≤ X − 0.5) ≈ P Z ≤ p
np(1 − p)
The approximation is good for np > 5 and n(1 − p) > 5
25 / 52
Example 4-18: Applying the Approximation
In a digital communication channel, assume that the number of bits received
in error can be modeled by a binomial random variable. The probability that a
bit is received in error is 10−5 .If 16 million bits are transmitted, what is the
probability that 150 or fewer errors occur?
Using Excel
0.2263 =NORMDIST(150.5,160,SQRT(160*(1-0.00001)),TRUE)
-0.7% =(0.2293-0.228)/0.228=percent error in the approximation
26 / 52
Normal Approximation to Hypergeometric
27 / 52
Normal Approximation to the Poisson
28 / 52
Example 4-20: Normal Approximation to Poisson
Assume that the number of asbestos particles in a square meter of dust on a
surface follows a Poisson distribution with a mean of 1000. If a square meter
of dust is analyzed, what is the probability that 950 or fewer particles are
found?
P e−1000 1000x
950
P(X ≤ 950) = ... too hard manually!
x=0 x!
The probability can be approximated as
Using Excel
0.0578 =POISSON(950,1000,TRUE)
0.0588 =NORMDIST(950.5,1000,SQRT(1000),TRUE)
1.6% =(0.0588-0.0578)/0.0578 = percent error
29 / 52
Exponential Distribution Definition
30 / 52
Exponential distribution - Mean & Variance
31 / 52
Example 4-21: Computer Usage-1
In a large corporate computer network, user log-ons to the system can be
modeled as a Poisson process with a mean of 25 log-ons per hour. What is
the probability that there are no log-ons in the next 6 minutes (0.1 hour)?
Let X denote the time in hours from the start of the interval until the first
log-on.
R∞
P(X >0.1) = 25e−25x dx =
0.1
e−25(0.1) = 0.082
The cumulative distribution function
also can be used to obtain the same
results as follows
P(X > 0.1) = 1 − F (0.1) = 0.082
32 / 52
Example 4-21: Computer Usage-2
Continuing, what is the probability that the time until the next log-on is
between 2 and 3 minutes (0.033 & 0.05 hours)?
0.05
Z
P(0.033<X <0.05) = 25e−25x dx
0.033
= e−25x |0.05
0.033 = 0.152
An alternative solution is
Using Excel
0.148 =EXPONDIST(3/60,25,TRUE)-EXPONDIST(2/60,25,TRUE)
(difference due to round-off error)
33 / 52
Example 4-21: Computer Usage-3
34 / 52
Lack of Memory Property
An interesting property of an exponential random variable
concerns conditional probabilities.
For an exponential random variable X ,
P(X > t1 + t2 |X > t1 ) = P(X > t2 )
35 / 52
Example 4-22: Lack of Memory Property
Let X denote the time between detections of a particle with a Geiger counter.
Assume X has an exponential distribution with E(X ) = 1.4 minutes. What is
the probability that a particle is detected in the next 30 seconds?
No particle has been detected in the last 3 minutes. Will the probability
increase since it is ”due”?
P(3<X <3.5) F (3.5) − F (3) 0.035
P(X <3.5|X >3) = = = = 0.30
P(X >3) 1 − F (3) 0.117
No, the probability that a particle will be detected depends only on the
interval of time, not its detection history.
36 / 52
Gamma Function
37 / 52
Gamma Distribution
38 / 52
Mean & Variance of the Gamma
µ = E(X ) = r /λ
and
σ 2 = V (X ) = r /λ2
39 / 52
Example 4-24: Gamma Application-1
The time to prepare a micro-array slide for high-output genomics is a Poisson
process with a mean of 2 hours per slide. What is the probability that 10
slides require more than 25 hours?
Let X denote the time to prepare 10 slides. Because of the assumption of a
poisson process, X has a gamma distribution with λ =1/2, r = 10, and the
requested probability is P(X > 25).
Using the Poisson distribution, let the random variable N denote the number
of slides made in 10 hours. The time until 10 slides are made exceeds 25
hours if and only if the number of slides made in 25 hours is ≤ 9.
Using Excel
P(X >25) = P(X ≤ 9) 0.2014 =POISSON(9, 12.5, TRUE)
E(N) = 25(1/2) = 12.5 slides in 25 hours
9
X e−12.5 (12.5)k
P(N ≤ 9) = = 0.2014
k!
k =0
40 / 52
Example 4-24: Gamma Application-2
Using the gamma distribution, the same result is obtained.
Using Excel
P(X >25) = 1 − P(X ≤ 25) 0.2014 =1-GAMMADIST(25, 10, 2, TRUE
Z25
0.510 x 9 e−0.5x
=1− dx
Γ(10)
0
= 1 − 0.7986
= 0.2014
What is the mean and standard deviation of the time to prepare 10 slides?
r 10
E(X ) = = = 20 hours
λ 0.5
r 10
V (X ) = 2 = = 40 hours
λ 0.25
p √
SD(X ) = V (X ) = 40 = 6.32 hours
41 / 52
Example 4-24: Gamma Application-3
The slides will be completed by what length of time with 95%
probability? That is: P(X ≤ x) = 0.95
Using Excel
31.41 =GAMMAINV(0.95, 10, 2) 42 / 52
Weibull Distribution
The random variable X with probability density function
β x β−1 −(x/δ)β
f (x) = e , for x > 0
δ δ
is a Weibull random variable with
scale parameter δ > 0 and shape parameter β > 0.
cumulative distribution function is :
β
F (X ) = 1 − e−(x/δ)
The mean and variance is given by
1
µ = E(X ) = δ · Γ 1 + and
β
1 2
2 2 2 2
σ = V (X ) = δ Γ 1 + −δ Γ 1+
β β
43 / 52
Example 4-25: Bearing Wear
I What is the probability that a bearing will last at least 6,000 hours?
44 / 52
Lognormal Distribution
−
1 2ω 2
f (x) = √ e , −∞ < θ < ∞, ω > 0
xω 2π
The mean and variance of X are
2 /2)
E(X ) = e(θ+ω and
2 2
V (X ) = e(2θ+ω ) (eω − 1)
45 / 52
Example 4-26: Semiconductor Laser-1
The lifetime of a semiconductor laser has a lognormal
distribution with θ = 10 and ω = 1.5 hours.
What is the probability that the lifetime exceeds 10,000 hours?
2 2
E(X ) = eθ+ω /2
= e10+1.5 /2
Γ(α + β) α−1
f (x) = x (1 − x)β−1 , for X in [0, 1]
Γ(α) · Γ(β)
48 / 52
Example 4-27: Beta Computation-1
Consider the completion time of a large commercial real estate development.
The proportion of the maximum allowed time to complete a task is a beta
random variable with α = 2.5 and β = 1. What is the probability that the
proportion of the maximum time exceeds 0.7?
Let X denote the proportion.
Z1
Γ(α + β) α−1
P(X > 0.7) = x (1 − x)β−1 dx
Γ(α) · Γ(β)
0.7
Z1
Γ(3.5)
= x 1.5 dx
Γ(2.5) · Γ(1)
0.7
√
2.5(1.5)(0.5) π x 2.5 1
= √ · |0.7
1.5(0.5) π 2.5
= 1 − (0.7)2.5 = 0.59
Using Excel
0.590 1-BETADIST(0.7,2.5,1,0,1)
49 / 52
Mean & Variance of the Beta Distribution
50 / 52
Mode of the Beta Distribution
If α > 1 and β > 1, then the beta distribution is mound-shaped and
has an interior peak, called the mode of the distribution. Otherwise,
the mode occurs at an endpoint.
General formula:
α−1
Mode= , for [0, 1]
α+β−2
For the above Example 4.28 the mode is
α−1 2.5 − 1
Mode = =
α+β−2 2.5 + 1 − 2
1.5
=
1.5
=1
51 / 52
Important Terms & Concepts
I Beta distribution I Mean of a function of a
I Chi-squared distribution continuous random variable
I Continuity correction I Normal approximation to
binomial Poisson probabilities
I Continuous uniform distribution
I Normal distribution
I Cumulative probability
distribution for a continuous I Probability density function
random variable I Probability distribution of a
I Erlang distribution continuous random variable
I Exponential distribution I Standard deviation of a
I Gamma distribution continuous random variable
I Standardizing
I Lack of memory property of a
continuous random variable I Standard normal distribution
I Lognormal distribution I Variance of a continuous
I Mean for a continuous random random variable
variable I Weibull distribution
52 / 52