Вы находитесь на странице: 1из 40

DAO1704X/DSC1007X

Week 4
Continuous Probability Distributions
Agenda
• Continuous Random Variables
• Probability Density Function and
Cumulative Distribution Function
• Exponential Distribution
• Normal Distribution
Continuous Random Variables

A continuous random variable can take any value in


some interval.

Examples : Temperature, Weight, Time


Continuous Random Variables

A continuous random variable can take any value in


some interval.

Examples : Temperature, Weight, Time


Infinite number of possible values for the continuous r.v.
How can we describe a continuous probability distribution?

For a continuous r.v., questions are


phrased in terms of a range of values.

Example: Customer Waiting Time


We might talk about the event that a customer waits between 5.0 and
10.0 minutes, and not about the event that a customer waits exactly
5.25 minutes!
Probability Density Function

The probability distribution of a continuous r.v. X is


described by its probability density function (pdf),
typically denoted by f ( x ) .

f (x)

-5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0

x
5.0
Probability Density Function
The probability density function (pdf) of a r.v. X has the
following characteristics:
– Area under the pdf curve is equal to 1
– Probability that X lies between values a and b is equal to the
area under the curve between a and b

f (x) area = P(a ≤ X ≤ b)

-5.0 -4.0 -3.0 -2.0


a
-1.0 0.0
b 1.0 2.0 3.0 4.0 5.0
x
Probability Density Function

Q1 : Given the pdf f(x), how do we compute the area


under the curve between a and b?

In general, we will have to evaluate the integral


𝑏𝑏
� 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥
𝑎𝑎

f (x) area = P(a ≤ X ≤ b)

-5.0 -4.0 -3.0 -2.0


a-1.0 0.0
b 1.0 2.0 3.0 4.0 5.0
x
Probability Density Function

Q2 : Given the pdf f(x), how do we compute the


mean and variance of X ?


Mean = 𝝁𝝁 = ∫−∞ 𝑥𝑥 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥

Variance = 𝝈𝝈𝟐𝟐 = ∫−∞ (𝑥𝑥 − 𝝁𝝁)2 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥

f (x)

-5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0
x
Discrete vs Continuous
Discrete Continuous

Probability x1 p1
distribution x2 p2 pdf f(x)
with the range of the
xn pn possible values of 𝑥𝑥

𝑛𝑛 ∞
� 𝑝𝑝𝑖𝑖 = 1 � 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥 = 1
𝑖𝑖=1 −∞

𝑛𝑛 ∞
Mean µ � 𝑥𝑥𝑖𝑖 𝑝𝑝𝑖𝑖 � 𝑥𝑥 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥
𝑖𝑖=1 −∞

𝑛𝑛 ∞
Variance σ2
� (𝑥𝑥𝑖𝑖 − 𝝁𝝁)2 𝑝𝑝𝑖𝑖 � (𝑥𝑥 − 𝝁𝝁)2 𝑓𝑓(𝑥𝑥 )𝑑𝑑𝑥𝑥
𝑖𝑖=1 −∞
Cumulative Distribution Function

For a given t, the cumulative distribution function


(cdf) F(t) of a continuous r.v. X is defined by
𝑡𝑡
𝐹𝐹 (𝑡𝑡) = 𝑃𝑃(𝑿𝑿 ≤ 𝑡𝑡) = � 𝑓𝑓 (𝑠𝑠)𝑑𝑑𝑑𝑑
−∞

F(t) is the probability that X does not exceed t.

f (t) By definition :
P(X ≤ t) • 0 ≤ F(t) ≤ 1
• F(t) is a non-decreasing
function of t

-4.0 -3.0 -2.0 -1.0 0.0 1.0

t 2.0 3.0 4.0


Cumulative Distribution Function

For a given t, the cumulative distribution function


(cdf) F(t) of a continuous r.v. X is defined by
𝑡𝑡
𝐹𝐹 (𝑡𝑡) = 𝑃𝑃(𝑿𝑿 ≤ 𝑡𝑡) = � 𝑓𝑓 (𝑠𝑠)𝑑𝑑𝑑𝑑
−∞

It is also easy to see that :


• P(X > t) = 1 – F(t)
• P(c ≤ X ≤ d) = F(d) – F(c)

Note: P(X ≤ t) = P(X < t)


Remark
• There is no “point probability” for any continuous
r.v. 𝑋𝑋. That is, Pr(𝑋𝑋 = 𝑎𝑎) = 0, 𝑎𝑎 can be any value.

• The height of the density function can be defined as


the “likelihood”. The way to interpret likelihood is
similar to probability.

• Both pdf and cdf provide the same information


about the continuous r.v. In math, you can see the
cdf is just the integration result of the pdf.
Question
• Assume the following continuous probability
distribution. What is the largest likelihood of this
distribution?

a c b
Continuous Probability Distribution:
Exponential Distribution
Exponential Distribution
Often arises as the distribution of amount of time until an event occurs.
Useful for waiting time problems.

A random variable X is said to be an exponential r.v. with rate


parameter λ ( > 0) if it has the pdf

f(x) = λ e−λx for x > 0


Exponential Distribution

It can be shown that It can be shown that


1 X has the cdf
Mean E(X) =
𝝀𝝀
1 𝐹𝐹 (𝒙𝒙) = 1 − 𝑒𝑒 −𝝀𝝀𝒙𝒙
Variance Var (X) =
𝝀𝝀2
Poisson and Exponential

There is a close relationship between the two distributions.

N is Poisson r.v. with parameter λ (>0):


𝑒𝑒 −𝝀𝝀 𝝀𝝀𝑖𝑖
𝑃𝑃(𝐍𝐍 = 𝑖𝑖 ) = for 𝑖𝑖 = 0, 1, 2, . . .
𝑖𝑖!

X is exponential r.v. with parameter λ ( > 0) :


f(x) = λ e−λx for x > 0
Poisson and Exponential

Parameter Poisson Exponential


Mean
EXPON.DIST in Excel
X is exponential r.v. with parameter λ ( > 0)

PDF f(x) = λ e−λx for x> 0

CDF 𝐹𝐹 (𝒙𝒙) = 1 − 𝑒𝑒 −𝝀𝝀𝒙𝒙

Excel Function : EXPON.DIST (x, λ, cumulative)

cumulative = 0 ⇒ f(x)
1 ⇒ F(x)
Exponential Distribution
X is exponential r.v. with parameter λ ( > 0)

PDF f(x) = λ e−λx for x > 0

CDF 𝐹𝐹 (𝒙𝒙) = 1 − 𝑒𝑒 −𝝀𝝀𝒙𝒙

Example:
Suppose the usage duration of a particular ATM is an exponential r.v.
with a mean of 3 minutes. If someone arrives at the ATM immediately
ahead of you, find the probability that you have to wait (a) more
than 2 minutes, and (b) between 2 and 3 minutes

X = usage duration (in mins) of ATM is exponential r.v. with parameter λ = 1/3.

(a)

(b)
Continuous Probability Distribution:
Normal Distribution
Normal Distribution
The density function is the familiar bell-shaped curve

f(t)
1 (𝒕𝒕−𝜇𝜇 )2

𝑓𝑓 (𝒕𝒕) = 𝑒𝑒 2𝜎𝜎 2
√2𝜋𝜋𝜎𝜎 2

t
µ

Note: f(t) is symmetric around the mean


f(t) is highest at its mean
Normal Distribution

PDFs of 4 Normally distributed r.v’s


Normal Distribution
Many phenomena can be described by the Normal
distribution:

• Height of a group of people


• Stock returns over short periods of time
• Width of steel plate from a production process

But ... some phenomena are not Normally distributed:


• Stock returns over longer periods of time
• Income distributions
NORM.DIST in Excel
X is normal r.v. with mean 𝜇𝜇 and variance 𝜎𝜎 2 ( > 0)
1 −1
PDF f(x) = exp (𝑥𝑥 − 𝜇𝜇)2 for 𝒙𝒙 ∈ 𝑹𝑹
2𝜋𝜋𝜎𝜎 2 2𝜎𝜎 2

CDF 𝐹𝐹 (𝒙𝒙): No simpe formula, must use integration

Excel Function : NORM.DIST (x, 𝜇𝜇, 𝜎𝜎 2 , cumulative)

cumulative = 0 ⇒ f(x)
1 ⇒ F(x)
Question
• Assume 𝑋𝑋~𝑁𝑁 5,4 .

• What is the probability that 𝑋𝑋 > 7?

• What is the probability that 3 < 𝑋𝑋 < 6?

Consider that a special normal distribution with mean 0 and


variance 1. Denote this distribution as 𝒁𝒁~𝑵𝑵(𝟎𝟎, 𝟏𝟏).

• What is the probability that 𝑍𝑍 > 1?

• What is the probability that −1 < 𝑍𝑍 < 0.5?


Relationship between 𝑋𝑋 and 𝑍𝑍
• In fact, 𝑋𝑋 = 2𝑍𝑍 + 5. That is the reason why we can use
standard normal distribution to do the probability
calculations in the past.

• Transform back!

Pr 𝑋𝑋 > 7 = Pr(2𝑍𝑍 + 5 > 7) = Pr(𝑍𝑍 > 1)

Pr(3 < 𝑋𝑋 < 6) = Pr(3 < 2𝑍𝑍 + 5 < 6)


Pr(3 < 𝑋𝑋 < 6) = Pr(3 − 5 < 2𝑍𝑍 < 6 − 5)
3−5 6−5
Pr(3 < 𝑋𝑋 < 6) = Pr < 𝑍𝑍 <
2 2
Linear Functions of a Random Variable
Example
Suppose daily demand for croissants at a bakery shop is given by

Daily Demand Probability Let X = daily demand for croissants


60 0.05
64 0.15 We can easily compute
68 0.20
72 0.25
E (X) = 71.15
75 0.15 Var (X) = 29.5275
77 0.10
80 0.10

Suppose it costs $135 per day to run the croissant operation, and
that the cost of producing one croissant is $0.75.
Daily cost of croissant operations = 0.75 X + 135
Linear Functions of a Random Variable
Example

X Probability Y = .75X + 135


E (X) = 71.15
60 0.05 180.00
183.00 Var (X) = 29.5275
64 0.15
68 0.20 186.00

72 0.25 189.00 Y = 0.75 X + 135


191.25
75 0.15
E (Y) = ?
77 0.10 192.75

80 0.10 195.00 Var (Y) = ?

How are the means and variances related ?

E (Y) = 0.75 E (X) + 135


Var (Y) = 0.752 Var (X)
Linear Functions of a Random Variable

Note:
If Y = a X + b Formulas apply
to continuous
E (Y) = a E (X) + b
r.v.’s as well
Var (Y) = a2 Var (X)
Derivation
For Normal Distributions

A special relationship between N(0,1) and N(µ,𝜎𝜎 2 ).

If X ∼ N(µ,σ), then the r.v. Z defined by


𝑿𝑿 − 𝜇𝜇
𝒁𝒁 =
𝜎𝜎
obeys a standard Normal distribution.

In other words :

𝑿𝑿 − 𝜇𝜇
𝑿𝑿 ~ 𝑁𝑁(𝜇𝜇, 𝜎𝜎) ⇒ ~ 𝑁𝑁(0,1)
𝜎𝜎
Percentile Function
•The percentile function of a r.v. 𝑋𝑋 is defined as
follows:
For 𝑝𝑝th percentile of 𝑋𝑋, we can write it as 𝑥𝑥𝑝𝑝 such that
Pr 𝑋𝑋 ≤ 𝑥𝑥𝑝𝑝 = 𝑝𝑝/100,
Remember the range of 𝒑𝒑 is from 1 to 100.

•We can use a grid of possible values of 𝑝𝑝 and the


corresponding percentiles of 𝑋𝑋 to understand this
random variable.
Percentile Function

Suppose X is N(100,80).

If P(X ≤ n) =0.64

What is n?

n is the 64th percentile of 𝑋𝑋!


NORM.INV in Excel
For 𝑝𝑝th percentile of 𝑋𝑋, we can write it as 𝑥𝑥𝑝𝑝 such that

Pr 𝑋𝑋 ≤ 𝑥𝑥𝑝𝑝 = 𝑝𝑝/100,

Remember the range of 𝑝𝑝 is from 1 to 100.

Excel Function : NORM.INV (𝑝𝑝/100, 𝜇𝜇, 𝜎𝜎 2 )


Question
• Suppose that 𝜎𝜎 is some positive number and that
the Excel formula: NORM.INV(0.73,2,𝜎𝜎)=2.5

• Please find out the value of B=NORM.INV(0.27,2,𝜎𝜎)

-4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0

B=? A=2.5

P(X ≤ B)=0.27 P(X ≤ A)=0.73


Example Example
• The personnel department of Ztel, a large communications
company, is reconsidering its hiring policy. Each applicant for a job
must take a standard exam, and the hire or no-hire decision
depends at least in part on the result of the exam. The scores of
all applicants have been examined closely. They are approximately
normally distributed with mean 525 and standard deviation 55.

• The current hiring policy occurs in two phases. The first phase
separates all applicants into three categories:
• automatic accepts – test scores 600 or above
• automatic rejects – test scores 425 or below
• maybe – the rest

• All the maybes are passed on to a second phase where their


previous job experience, special talents, and other factors are
used as hiring criteria.
Question
• What is the percentage of applicants who are automatic
accepts or rejects?

• If ZTel wants to automatically accept 15% of applicants and


automatically reject 10% of them, how should the standards
be changed?
Take-home Message
• Continuous random variable can take a infinite number
of possible values. Thus, we need to use pdf or cdf to
describe the probability behavior.

• For continuous r.v., a probability statement must be defined


in a range of possible values.

• Exponential distribution is widely applied to model time,


say waiting time, service time and life time.

• Normal distribution has two parameters, mean and


variance. This distribution is very fundamental and has
many famous real-world applications.

Вам также может понравиться