STAS 221 Lecture 4
STAS 221 Lecture 4
Computer Engineering
Spring 2018-2019
Lecture 4
STAS 221 2
This Week
• Probability density
• Families of continuous distributions
– Uniform distribution
– Exponential distribution
STAS 221 3
Continuous Random Variables
• A continuous random variable may assume
any real value in an interval:
– (a,b), (a,+∞), (-∞,+∞), etc.
• Examples:
– Time
– Temperature
– Length
– Weight
STAS 221 4
Point Events Have 0 Probabilities
• Since there are infinitely many outcomes
associated with a continuous random variable,
the probability of a specific outcome is 0.
𝑃 𝑋=𝑥 =0
• In this case, probabilities of intervals of
outcomes are of interest
E.g, 𝑃(𝑐 < 𝑋 ≤ 𝑑)
• 𝑃 𝑋 < 𝑥 = 𝑃(𝑋 ≤ 𝑥)
STAS 221 5
CDF of Continuous R.Vs
• 𝐹𝑋 (𝑥) has the same meaning as in the discrete
case
𝐹𝑋 𝑥 = 𝑃 𝑋 ≤ 𝑥 = 𝑃 𝑋 < 𝑥
• But unlike the discrete cdfs, continuous cdfs
do not have jumps, since P(X = x) = 0.
• cdfs of continuous r.v.s are continuous
functions
STAS 221 6
Probability Density Function, pdf
• Given the cdf 𝐹𝑋 𝑥 as a continuous and non-
decreasing function, the pdf is defined as:
𝑑𝐹
𝑓𝑋 𝑥 = 𝐹𝑋′ 𝑥 =
𝑑𝑥
The distribution is called continuous if it has a
density
𝐹𝑋 𝑥 is an antiderivative of the density
𝑏
𝑓 𝑥 𝑑𝑥 = 𝐹𝑋 𝑏 − 𝐹𝑋 𝑎 = 𝑃(𝑎
𝑎 𝑋
< 𝑋 < 𝑏)
𝑏 ∞
𝑓 𝑥 𝑑𝑥 = 𝐹𝑋 𝑏 and −∞ 𝑓𝑋 𝑥
−∞ 𝑋
𝑑𝑥 = 1
STAS 221 7
Example 4.1
• Lifetime (in years) of some electronic
component is a r.v with the following pdf:
0, 𝑥<1
𝑓𝑋 𝑥 = 𝑘
, 𝑥≥1
𝑥3
• What is k?
• Find the cdf.
• What is the probability for the lifetime to
exceed 5 years?
STAS 221 8
Answer
∞ ∞
𝑘
𝑓𝑋 𝑥 𝑑𝑥 = 1, hence 3
𝑑𝑥 = 1
𝑥
1 1
∞ 𝑘 𝑘𝑥 −2 ∞ 𝑘∞−2 𝑘 𝑘
LHS, 1 3 𝑑𝑥 = = + =
𝑥 −2 1 −2 2 2
𝑘
Hence, = 1, 𝑘 = 2.
2
𝑥
2 −2 𝑥
1
𝐹𝑋 𝑥 = 𝑑𝑥 = −𝑥 =1− 2
𝑥 3 1 𝑥
1
1
𝑃 𝑋 >5 =1−𝐹 5 =
25
STAS 221 9
Joint and Marginal Densities
• The joint cdf for two rvs is defined as:
𝐹𝑋,𝑌 𝑥, 𝑦 = 𝑃(𝑋 ≤ 𝑥 ∩ 𝑌 ≤ 𝑦)
• The joint density function is then given as
߲2
𝑓𝑋,𝑌 𝑥, 𝑦 = 𝐹 𝑥, 𝑦
߲𝑥߲𝑦 𝑋,𝑌
• Marginal distributions can be computed from the joint
pdf as:
𝑓𝑋 𝑥 = 𝑦
𝑓𝑋,𝑌 𝑥, 𝑦 𝑑𝑦
• Two continuous rvs are independent if the joint pdf is a
product of marginal pdfs:
𝑓𝑋,𝑌 𝑥, 𝑦 = 𝑓𝑋 𝑥 𝑓𝑌 𝑦
STAS 221 10
Expectation and Variance
• Expectation
𝐸 𝑋 =𝜇= 𝑥𝑓𝑋 𝑥 𝑑𝑥
• Variance
𝑉𝑎𝑟 𝑋 = 𝑥 − 𝜇 2 𝑓𝑋 𝑥 𝑑𝑥
• Example 4.2
𝑓𝑋 𝑥 = 2𝑥 −3 for 𝑥 ≥ 1
Compute expectation and variance
STAS 221 11
Some important Continuous
Distributions
• Uniform
• Exponential
– related to Poisson, continuous case of Geometric
distribution
• Gamma
• Normal
STAS 221 12
Uniform Distribution
• Parameters: interval [a,b]
• Constant density
1
𝑓𝑋 𝑥 = , 𝑎≤𝑥≤𝑏
𝑏−𝑎
• Expectation
𝑎+𝑏
𝐸 𝑋 =
2
• Variance
𝑏−𝑎 2
𝑉𝑎𝑟 𝑋 =
12
STAS 221 13
The Uniform Property
• The probability of an interval within [a, b] is
only determined by its width, not by its
location.
STAS 221 14
Standard Uniform Distribution
• [a, b] = [0, 1] is called Standard Uniform
distribution
𝑋−𝑎
• If X is a Uniform(a, b) rv then 𝑌 = is the
𝑏−𝑎
Standard Uniform rv.
𝑓𝑋 𝑥
1
0 𝑥
1
STAS 221 15
Exponential Distribution
• Used to model time: waiting time, inter-arrival
time, failure time, etc.
• Can be considered as the continuous version
of the geometric distribution which counts the
number of trials before success.
• Related to Poisson distribution
λ parameter has the same meaning in both
distributions
λ = avg. # of events in a time unit
STAS 221 16
Exponential Distribution vs. Poisson
Distribution
• Rare events
STAS 221 17
Exponential cdf
• Can be derived from the Poisson pmf
𝑥
−𝜆 𝜆
𝑓𝑋 𝑥 = 𝑒
𝑥!
• “The waiting time for the next event is greater
than t time units” is the same as saying “0
events occur in t time units”. If X is a rv that
shows the number of events in t time units (X
is a Poisson rv with λt)
𝜆𝑡 0
𝑓𝑋 0 = 𝑒 −𝜆𝑡 = 𝑒 −𝜆𝑡
0!
STAS 221 18
Exponential cdf
• Exponential cdf 𝐹𝑇 𝑡 shows the total
probability that waiting time is less than t.
If 𝑓𝑋 0 shows the probability of 0 events in t time
units, then:
𝐹𝑇 𝑡 = 1 − 𝑓𝑋 0 = 1 − 𝑒 −𝜆𝑡
STAS 221 19
Exponential pdf
• Is the derivative of the cdf 𝐹𝑇 𝑡
𝑓𝑇 𝑡 = 𝐹𝑇′ 𝑡 = 𝜆𝑒 −𝜆𝑡 , 𝑡 > 0
STAS 221 20
Exponential Distribution Summary
• Parameter: λ – the number of event per time
unit
• Density
𝑓𝑋 𝑥 = 𝜆𝑒 −𝜆𝑥 , 𝑥 > 0
• Expectation
1
𝐸 𝑋 =
𝜆
• Variance
1
𝑉𝑎𝑟 𝑋 =
𝜆2
STAS 221 21
Memoryless Property
• What is the chance that an electronic
component A survives x hours?
X = time to failure = Exponential(𝜆)
𝑃 𝑋 > 𝑥 = 1 − 𝐹𝑋 𝑥 = 𝑒 −𝜆𝑥
• Another component B did not fail for t hours.
What is the probability that it will survive
another x hours?
𝑃 𝑋 > 𝑡 + 𝑥|𝑋 > 𝑡 = ?
STAS 221 22
Memoryless Property
𝑃(𝑋>𝑡+𝑥 ∩ 𝑋>𝑡)
• 𝑃 𝑋 >𝑡+𝑥 𝑋 >𝑡 =
𝑃(𝑋>𝑡)
𝑃(𝑋>𝑡+𝑥) 𝑒 −𝜆(𝑡+𝑥)
= = = 𝑒 −𝜆𝑥
𝑃(𝑋>𝑡) 𝑒 −𝜆𝑡
STAS 221 23
Summary
• Chapter 4: Families of Continuous
Distributions
– Uniform distribution
– Exponential distribution
STAS 221 24
Next Lecture – Chapter 4
• Families of continuous distributions
– Gamma distribution
– Normal distribution
– Central Limit Theorem
STAS 221 25