0% found this document useful (0 votes)
13 views102 pages

Continuous Random Variables Explained

The document provides an overview of continuous random variables, including their definitions, properties, and probability distribution functions. It covers concepts such as expectations, variance, uniform distribution, and normal distribution, along with practical examples and practice questions. The content is aimed at students in the Faculty of Business and Economics at the University of Hong Kong.

Uploaded by

oscarchow123005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views102 pages

Continuous Random Variables Explained

The document provides an overview of continuous random variables, including their definitions, properties, and probability distribution functions. It covers concepts such as expectations, variance, uniform distribution, and normal distribution, along with practical examples and practice questions. The content is aimed at students in the Faculty of Business and Economics at the University of Hong Kong.

Uploaded by

oscarchow123005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Analysis of Economic Data

Topic 4
Continuous Random Variables
Xinyao Qiu

HKU Faculty of Business and Economics


The University of Hong Kong
Logistics
• Attendance
• Assignment II (due Oct 5, 23:59, Sunday)
• Course TA: additional consultation time
– Haojie Chen (haojie24@[Link])
– Location: KK1026
– Time: Oct 9th (Thu), 16:00-17:00
Oct 10th (Fri), 14:00-15:00
Regular: Wednesday 15:00-16:00 & 17:00-18:00
Plan of This Lecture
• Continuous Random Variables
• Expectations and Variance
• Uniform Distribution
• Normal Distribution
– Normal Distribution Approximation for Binomial
Distribution
• Exponential Distribution
• Jointly Distributed Continuous Random
Variables
Continuous Random Variables
Continuous Random Variables
• A continuous random variable is a variable that
can assume any value in an interval
– thickness of an item
– time required to complete a task
– temperature of a solution
– height, in inches
Probability Distribution Function for Continuous r.v.
• Recall: The probability distribution (mass) function,
𝑝(𝑥), of a discrete random variable 𝑋 represents the
probability that 𝑋 takes the value 𝑥, as a function of
𝑥. That is
𝑝 𝑥 = 𝑃 𝑋 = 𝑥 ,∀ 𝑥
– Support of X: the set of all possible x values
• For continuous random variables: we can assign
probabilities only to a range of values.
– The probability that 𝑋 is precisely equal to 𝑥 is zero. i.e.
𝑃 𝑋 =𝑥 =0∀𝑥
• Question: how to get the “probability distribution
function” for continuous random variable?
Cumulative Distribution Function
• Let 𝑋 be a continuous random variable with a
cumulative distribution function 𝐹(𝑥), and let 𝑎 and 𝑏
be two possible values of 𝑋, with 𝑎 < 𝑏. The
probability that 𝑋 lies between 𝑎 and 𝑏 follows:
𝑃 𝑎 <𝑋 <𝑏 =𝐹 𝑏 −𝐹 𝑎

– For continuous random variable, it doesn’t matter whether


we write “less than” or “less than or equal to”
– Because the probability that 𝑋 is precisely equal to 𝑏 is zero.
Probability Density Function
• The probability density function (PDF) for a
continuous random variable, 𝑓(𝑥), is defined as
𝑑
𝑓 𝑥 = 𝐹(𝑥)
𝑑𝑥
– such that
"
• 𝑃 𝑎 ≤ 𝑋 ≤ 𝑏 = ∫! 𝑓 𝑥 𝑑𝑥
"
– can also write as 𝑃 𝑎 < 𝑋 < 𝑏 = ∫! 𝑓 𝑥 𝑑𝑥
• ∫# 𝑓 𝑥 𝑑𝑥 = 1
"

𝑃 𝑎 ≤ 𝑋 ≤ 𝑏 = * 𝑓 𝑥 𝑑𝑥
!

𝐶𝐷𝐹. Bell-shaped PDF above


implies a S-Shaped CDF.
Properties of Probability Density Function
Let 𝑋 be a continuous random variable, and let 𝑥 be any
number lying in the range of values for the random
variable. The probability density function (PDF), 𝑓(𝑥), of
the random variable is a function with the following
properties:

1. 𝑓 𝑥 ≥ 0 for all 𝑥
2. The area under 𝑓 𝑥 over all values of the random
variable, 𝑋 within its range, is equal to 1
Properties of Probability Density Function (cont’d)

3. Suppose that this density function is graphed. Let 𝑎 and


𝑏 be two possible values of random variable 𝑋, with 𝑎 < 𝑏.
Then, the probability that 𝑋 lies between 𝑎 and 𝑏 is the
area under the probability density function between these
points
,
𝑃 𝑎 ≤ 𝑋 ≤ 𝑏 = ( 𝑓 𝑥 𝑑𝑥
+
• The cumulative distribution function, 𝐹 𝑥- , is the area
under 𝑓 𝑥 up to 𝑥-
."
𝐹 𝑥- = ( 𝑓 𝑥 𝑑𝑥
.!
– where 𝑥2 is the minimum value of the random variable 𝑋
• PDF can be approximated by a PMF with many
discrete values close together (integration in
calculus).
Expectations and Variance of
Continuous Random Variables
Mean
• The expected value (expectation, or mean), 𝐸[𝑋], of a
continuous random variable 𝑋 is defined as
𝐸 𝑋 = 𝜇! = 3 𝑥𝑓 𝑥 𝑑𝑥
"
– The probability of any specific value is zero for a continuous
random variable, the expected values for continuous
random variables are computed using integral calculus.
– It is defined through an approximation of a discrete random
variable
Mean (cont’d)
• The mean is the center of gravity of a pole (𝑎, 𝑏) with density
at x being f(x).
• In general, the mean of any function of 𝑋, g 8 , where X has
a PDF at 𝑓(𝑥), Then:
𝐸𝑔 𝑋 = 3 𝑔(𝑥)𝑓 𝑥 𝑑𝑥
"

• Recall, 𝐸 𝑔 𝑋 ≠ 𝑔(𝐸[𝑋]) unless g(𝑥) is linear


Variance
• The variance of 𝑋 is defined as the expectation of the
squared deviation, 𝑋 − 𝜇! " , of the random variable
from its mean
𝜎!" = 𝐸 𝑋 − 𝜇! " = 𝐸 𝑋 " − 𝜇!"
• The standard deviation of 𝑋, 𝜎! , is the positive square
root of the variance
Plan of This Lecture
• Continuous Random Variables
• Expectations and Variance
• Uniform Distribution
• Normal Distribution
– Normal Distribution Approximation for Binomial
Distribution
• Exponential Distribution
• Jointly Distributed Continuous Random
Variables
Uniform Distribution
Probability
Distributions

Ch. 4 Discrete Continuous Ch. 5


Probability Probability
Distributions Distributions

Binomial Uniform

Poisson Normal

Hypergeometric Exponential
Uniform Probability Distribution: an example

Consider a gasoline station that has a 1,000-gallon storage tank that is filled
each morning at the start of the busines day. Analysis of past history indicates
that it is not possible to predict the amount of gasoline sold on any particular
day, but the lower limit is 0 and the upper limit is 1,000 gallons (the size of
the tank). In addition, past history indicates that any demand in the interval
from 0 to 1,000 gallons is equally likely.

Question: what is the probability of sales between 250 and 750 gallons?

To start: observe that the random variable 𝑋 indicates the gasoline sales in
gallons for a particular day. It follows a uniform probability distribution

Then: what are the CDF and PDF for this particular setting?
Uniform Probability Distribution: an example

Start with PDF:


• Beyond the range of 𝑥 ∈ [0,1000], 𝑓 𝑥 = 0
• Within the range of 𝑥 ∈ [0,1000]
– “any demand in the interval from 0 to 1,000 gallons
is equally likely”
– What does this mean for 𝑓(𝑥)?
Uniform Probability Distribution: an example

Start with PDF:


• Beyond the range of 𝑥 ∈ [0,1000], 𝑓 𝑥 = 0
• Within the range of 𝑥 ∈ [0,1000]
– “any demand in the interval from 0 to 1,000 gallons
is equally likely”
– What does this mean for 𝑓(𝑥)?
#
•𝑓 𝑥 = = 0.001 𝑜𝑛 𝑡ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑜𝑓 𝑥 ∈ [0,1000]
#$$$
Uniform Probability Distribution: an example

𝑓(𝑥)

0.001

0 1000 𝑥
Uniform Probability Distribution: an example
What is the CDF here?
• Beyond the range of 𝑥 ∈ [0,1000], 𝑓 𝑥 = 0
• At 𝑥 = 0, 𝐹 𝑥 = 0; at 𝑥 = 1000, 𝐹 𝑥 = 1
"-
• In the range, 𝐹 𝑥! = ∫" 𝑓 𝑥 𝑑𝑥
,
– For instance, what is F 400 ?
$##
– 𝐹 400 = 𝑃(0 ≤ 𝑋 ≤ 400) = ∫# 0.001 𝑑𝑥 = 0.001×(400 −
0) = 0.4

• Replace 400 with a general 𝑥:


𝐹 𝑥 = 0.001×(𝑥 − 0) = 0.001𝑥
Uniform Probability Distribution: an example

What are 𝐹(750) and 𝐹 250 ?

𝐹(𝑥)
Uniform Probability Distribution: an example

• Question: what is the probability of sales between 250 and 750 gallons?
– 𝑃 250 < 𝑋 < 750 = 𝐹 750 − 𝐹 250 = 0.001 750 −
0.001 250 = 0.50
Uniform Probability Distribution

𝑓(𝑥)

1
𝑏−𝑎

𝑎 𝑏 𝑥
Practice Question
The continuous random variable X is uniformly
distributed over the interval [a, b]. The mean of
the probability distribution of X is:
!#$
A)
% b/b-a -a/b-a

B) 𝑛 − 𝑎𝑏
$&!
C)
%
!#$
D)
'
Practice Question
The continuous random variable X is uniformly
distributed over the interval [a, b]. The mean of
the probability distribution of X is:
!#$
A)
%
B) 𝑛 − 𝑎𝑏
$&!
C)
%
!#$
D)
'
Practice Question
The amount of time you have to wait at a particular stoplight is uniformly distributed between zero
and two minutes.
a) What is the probability that you have to wait more than 30 seconds for the stoplight?
30< x<120 1/120-0
1-30

b) What is the probability that you have to wait between 15 and 45 seconds for the stoplight?

1/4

c) Eighty percent of the time, the stoplight will change before you have to wait X seconds, what is
the value of X? 80%
96

d) Sixty percent of the time, the stoplight will change before you have to wait X seconds, what is
the value of X?

72
Practice Question
The amount of time you have to wait at a particular stoplight is uniformly distributed between zero
and two minutes.
a) What is the probability that you have to wait more than 30 seconds for the stoplight?
!
Let’s define X as the time of waiting. Then, f x = !"# if x ∈ 0,120
!
So 𝑃 𝑋 ≥ 30 = 1 − 𝑃 𝑋 < 30 = 1 − 30× = 0.75
!"#

b) What is the probability that you have to wait between 15 and 45 seconds for the stoplight?
1
𝑃 15 ≤ 𝑋 ≤ 45 = 𝑃 𝑋 < 45 − 𝑃 𝑋 < 15 = (45 − 15)× = 0.25
120

c) Eighty percent of the time, the stoplight will change before you have to wait X seconds, what is
the value of X?

d) Sixty percent of the time, the stoplight will change before you have to wait X seconds, what is the
value of X?
Practice Question
The amount of time you have to wait at a particular stoplight is uniformly distributed between zero
and two minutes.
a) What is the probability that you have to wait more than 30 seconds for the stoplight?
!
Let’s define X as the time of waiting. Then, f x = !"# if x ∈ 0,120
!
So 𝑃 𝑋 ≥ 30 = 1 − 𝑃 𝑋 < 30 = 1 − 30× !"# = 0.75

b) What is the probability that you have to wait between 15 and 45 seconds for the stoplight?
1
𝑃 15 ≤ 𝑋 ≤ 45 = 𝑃 𝑋 < 45 − 𝑃 𝑋 < 15 = (45 − 15)× = 0.25
120

c) Eighty percent of the time, the stoplight will change before you have to wait X seconds, what is
the value of X?
$
𝑃 𝑋 ≤ 𝑥 = 0.8 = , so 𝑥 = 0.8×120 = 96, the stoplight changes before 96 seconds with 80%
!"#
chance.

d) Sixty percent of the time, the stoplight will change before you have to wait X seconds, what is the
value of X?
$
𝑃 𝑋 ≤ 𝑥 = 0.6 = !"#, so 𝑥 = 0.6×120 = 72 seconds
Probability
Distributions

Ch. 4 Discrete Continuous Ch. 5


Probability Probability
Distributions Distributions

Binomial Uniform

Poisson Normal

Hypergeometric Exponential
Normal Distribution
The Normal Distribution
Most often used continuous
probability distribution for
economics and business applications
• bell shaped
• symmetric
• a single peak: peak corresponds
to the mean, median, and mode
of the distribution.

Normal Distribution is also called Gaussian Distribution.


A normal distribution has two parameters: 𝜇 and 𝜎 -
Suppose that the random variable 𝑋 follows a normal
distribution 𝑿~𝑵(𝝁, 𝝈𝟐 ), then:
• The mean of the random variable is 𝜇
𝐸 𝑋 =𝜇
• The variance of the random variable is 𝜎 -
𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 − 𝜇 - = 𝜎 -
The Normal Distribution
The pdf for a normally distributed random
variable 𝑋 is
! ( ! ! µ )!

"
" ( !) = # !" !
!#" !

where
• 𝜇 and 𝜎 A are any numbers such that −∞ < 𝜇 < ∞ and 0 <
𝜎A < ∞
• 𝑒 = the mathematical constant approximated by 2.71828. It is
the base for natural logarithms, called Euler’s number
• 𝜋 = the mathematical constant approximated by 3.14159
Suppose that the random variable 𝑋 follows a normal
distribution with parameters 𝜇 and 𝜎 < , 𝑿~𝑵(𝝁, 𝝈𝟐 ),
then the CDF is
𝐹 𝑥! = 𝑃(𝑋 ≤ 𝑥! )

• No analytical form for cdf, but easily computable.


• How about 𝐹 ∞ ?
–𝐹 ∞ =1
• How about 𝑃 𝑎 < 𝑋 < 𝑏 ?
$
– 𝑃 𝑎 <𝑋 <𝑏 =𝐹 𝑏 −𝐹 𝑎 = ∫# 𝑓 𝑥 𝑑𝑥
The Standard Normal Distribution
Any normal distribution (with any mean and variance
combination) can be transformed into the standardized
normal distribution (Z), with mean 0 and variance 1

! ! " ( !"#)

Need to transform X units into Z units by subtracting the mean of X and


dividing by its standard deviation

! "µ
"=
!
Practice Question
If X is distributed normally with mean of 100 and standard
deviation of 50, what is the Z score for X = 200?
What does it mean intuitively?
Practice Question
If X is distributed normally with mean of 100 and
standard deviation of 50, the Z value for X = 200 is

! "µ !"" " #""


"= = = !$"
! %"

• This says that X = 200 is two standard deviations


(2 increments of 50 units) above the mean of 100.
Comparing X and Z Units

Note that the distribution is the same, only the scale has
changed. We can express the problem in original units (X) or in
standardized units (Z)
Finding Normal Probabilities
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

! ( !" < " < " ) = !"#


• Many applications in real life: heights and weights of human beings, stock
prices, etc.
• The distribution of sample mean will converge to a normal distribution when
the sample size gets large (will discuss more next Topic)
Normal Distribution: Skewness
• Normal Distribution is also called Gaussian
Distribution
• For 𝑋~𝑁(𝜇, 𝜎 ! ): 𝜇" = 𝜇 (easy), 𝜎"! = 𝜎 ! (proof
not required)
– So normal distribution is determined
completely by its mean and variance
• Skewness is zero (why?)

Carl F. Gauss (1777-1855), Gottingen


Standard Normal Distribution table
• The Standard Normal Distribution table in the
textbook shows values of the cumulative normal
distribution function
• For a given Z-value a, the table shows
(the area under the curve from negative infinity to a )

• We use Greek letter Φ (pronounced phi) to represent


the CDF of standard normal: Φ 𝑎 : 𝑎 = 𝑃(𝑍 ≤ 𝑎)
Normal Probability Plot
Normal distribution is the most-used, we often need to
check whether the data in hand are (approximately)
normally distributed.

• Normal probability plots (or QQ-plots, Q for quantile)


provide an easy way to achieve this goal.
• Later lectures will provide a more rigorous test.
Normal Probability Plot: QQ Plot
x-axis (Theoretical Quantiles):
the quantiles you would expect if
the data truly came from the
standard normal distribution.

y-axis (Sample Quantiles):


The actual quantiles calculated from
your dataset.

If the data are indeed from a normal


distribution, then the plot will be a
straight line.
The Standard Normal Table
• Appendix Table 1 gives the cumulative probability
for a standard normal distribution.
• For a given z-score, the table tells you:
Φ 𝑧 = 𝑃(𝑍 ≤ 𝑧)

Example:
! ( " < !"## ) = "$%%!
The Standard Normal Table
• For negative Z-values, use the fact that the distribution
is symmetric to find the needed probability:

Example:
! ( " < !!"## ) = $ ! #"%&&!
'''''''''''''''''''' = #"#!!(
Practice Question
A client has an investment portfolio, whose value
follows a normal distribution with a mean of
$1,000,000 and a standard deviation of $30,000.
• He has asked you to determine the probability
that the value of his portfolio is between
$970,000 and $1,060,000
Practice Question
• A client has an investment portfolio 𝑋~𝑁 𝜇B , 𝜎BA , where 𝜇B =
$1,000,000 and 𝜎BA = $30,000. What is 𝑃(970,000 < 𝑋 <
1,060,000)?

CD#,###EF,###,###
• Z score of 970,000 is = −1
G#,###
F,#H#,###EF,###,###
• Z score of 1,060,000 is =2
G#,###

• So, 𝑃 970,000 < 𝑋 < 1,060,000 = 𝑃 −1 < 𝑍 < 2 =


𝑃 𝑍 < 2 − 𝑃 𝑍 < −1 = 0.9772 − 1 − 0.8413 = 0.8185

• 𝑃 𝑍 < −1 = 𝑃 𝑍 > 1 given symmetry


Normal Distribution for Approximation
of Binomial Distribution
Probability
Distributions

Ch. 4 Discrete Continuous Ch. 5


Probability Probability
Distributions Distributions

Binomial Uniform

Poisson Normal

Hypergeometric Exponential
• Normal distribution can be used to approximate
the discrete binomial and proportion random
variables for large sample sizes.
• The below visual evidence that the binomial can
be approximated by a normal distribution with
the same mean and variance is also established in
work done by mathematical statisticians.
Normal Distribution Approximation
for Binomial Distribution
Normal distribution 𝑵(𝒏𝒑𝑩 , 𝒏𝒑𝑩 (𝟏 − 𝒑𝑩 ))
provides a good approximation for the binomial
distribution 𝑩𝒊𝒏𝒐𝒎𝒊𝒂𝒍 𝒏, 𝒑𝑩 when 𝑛𝑝) (1 −
𝑝) ) > 5
– 𝑋~𝐵𝑖𝑛𝑜𝑚𝑖𝑎𝑙 𝑛, 𝑝1
• Mean: 𝜇! = 𝐸 𝑋 = 𝑛𝑝9
• Variance: 𝜎!: = 𝐸 𝑋 − 𝜇! : = 𝑛𝑝9 (1 − 𝑝9 )
– The De Moivre-Laplace theorem
– A more rigorous justification will be provided in
Topic 5 (when 𝑛 → ∞)
Binomial with 𝑝# = 0.5 and
𝑛 = 100, and
Normal with 𝜇 = 50 and σ = 5

Binomial with 𝑝# = 0.2 and


𝑛 = 25, and
Normal with 𝜇 = 5 and σ = 2
History of De Moivre-Laplace Theorem

Abraham de Moivre (1667-1754), French Pierre-Simon Laplace (1749-1827), French

The phenomenon of De Moivre-Laplace theorem was first observed by de Moivre in a


private manuscript circulated in 1733, and published in 1738 with the title “The Doctrine of
Chances”. Later Laplace formally proved the theorem in 1810.
Normal Approximation for Binomial
• Because normal distributions are easier to handle, this
approximation can simplify the analysis of some
problems
– E.g. 𝑋 is the number of customers after 𝑛 people browsed a store’s
website, and based on past experiences, the probability of visiting the
store after browsing is 𝑝, the manager wants to predict the probability
of the number of customers falling in an interval, a, b .
• From normal approximation
:;<= A;<= B;<=
𝑃 𝑎 < 𝑋 < 𝑏 = 𝑃( < < )
<=(?;=) <=(?;=) <=(?;=)
𝑏 − 𝑛𝑝 𝑎 − 𝑛𝑝
≈Φ − Φ( )
𝑛𝑝 1 − 𝑝 𝑛𝑝 1 − 𝑝
– where Φ is the cdf of standard normal: Φ 𝑥 = 𝑃(𝑍 ≤ 𝑥)
Continuity Correction
• Because we are using a continuous distribution to
approximate discrete one, we often conduct a
“continuity correction”,
• For continuous r.v., 𝑃 𝑋 = 𝑥 = 0; but for discrete r.v.,
𝑃 𝑋 = 𝑥 could have non-zero mass

• The correction is 𝑃 𝑋 ≤ 𝑥 ≈ 𝑃(𝑋 ≤ 𝑥 + 0.5)


– Because discrete values are like bars with width 1, and
continuous curves are smooth with no width.
– In the discrete case, the value 𝑋 = 𝑥 really represents the
entire interval (𝑥 − 0.5, 𝑥 + 0.5]
An Example on Continuity Correction
• 𝑃 𝑎 ≤𝑋 ≤𝑏 =𝑃 𝑋 ≤𝑏 −𝑃 𝑋 <𝑎
≈ 𝑃 𝑋 ≤ 𝑏 + 0.5 − 𝑃 𝑋 ≤ 𝑎 − 0.5
• Rule: correct at the ends when the ends are
included (i.e. the ≤ and ≥ signs are used)
– If it is 𝑃 𝑎 < 𝑋 < 𝑏 , no need correction.
• Continuing the example above:
IJ!.KLMN PL!.KLMN
• 𝑃 𝑎≤𝑋≤𝑏 ≈Φ − Φ( )
MN OLN MN OLN
Practice Question
You make the initial telephone contact with customers who have
responded to an advertisement on your company’s webpage in
an effort to assess whether a follow-up visit to their homes is
likely to be worthwhile. Your experience suggests that 40% of the
initial contacts lead to follow-up visits.
• Assume the number of follow-up home visits generated after
initial contacts follows binomial distribution.
• If you have 100 webpage contacts, what is the probability that
between 45 and 50 follow-up visits will result?
Practice Question
• First, define 𝑋~𝐵𝑖𝑛𝑜𝑚𝑖𝑎𝑙 100,0.4
• Then find the Normal approximation.
• Start with finding the two parameters for Normal:
𝑁(𝑛𝑝Q , 𝑛𝑝Q (1 − 𝑝Q ))
– 𝜇! = 𝑛𝑝- = 40, 𝜎!" = 𝑛𝑝 1 − 𝑝 = 24
RKLR!L!.K K!LR!J!.K
• 𝑃 45 ≤ 𝑋 ≤ 50 = 𝑃 ≤𝑍≤
<R <R
with continuity correction
R.K O!.K O!.K
• 𝑃 45 ≤ 𝑋 ≤ 50 ≈ 𝑃 <𝑍< =Φ −
<R <R <R
R.K
Φ ≈ 0.9846 − 0.8212 ≈ 0.1634
<R
Normal Approximation for Binomial
• Daily sales are typically given as integer values and
thus their distribution is discrete. However, if the
data set has large number of possible outcomes, the
normal distribution provides a very good
approximation for the discrete distribution.
Summary of Approximation for Binomial(n,p)

Exponential Distribution
Exponential Distribution
Probability
Distributions

Ch. 4 Discrete Continuous Ch. 5


Probability Probability
Distributions Distributions

Binomial Uniform

Poisson Normal

Hypergeometric Exponential
The Exponential Distribution
• The exponential distribution has been found to
be particularly useful for waiting-line
problems.
– Time between trucks arriving at an unloading dock
– Time between transactions at an ATM machine
– Time between phone calls to the main operator
You work for an Apple store You work for an Apple store
and manage the genius bar. and manage the genius bar.
Based on your experience, Based on your experience, the
customers w/o appointments time between customers w/o
arrive at your genius bar at appointments arriving at your
an average rate of 2 every genius bar averages 30
hour. minutes.
• 𝑋: walk-in visits in one • 𝑇: service time
hour • 𝑇~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙(𝜆)
• 𝑋~𝑃𝑜𝑖𝑠𝑠𝑜𝑛(𝜆) • Service rate 𝜆 = 2 per
• 𝜆 = 2 walk-in visits per hour
hour What’s the probability that
What’s the probability that the service time of a walk-in
you will have more than two visit will take longer than 3
walk-in visits in one hour? hours?
• 𝑃 𝑋>2 • 𝑃 𝑇>3

Poisson distribution provides the Exponential distribution provides the


probability of 𝑋 successes or arrivals probability that a success or arrival will
during a time limit occur during an interval of time 𝑡
The Exponential Distribution
The exponential random variable 𝑇(𝑡 > 0) follows an
exponential probability distribution, 𝑻~𝑬𝒙𝒑𝒐𝒏𝒆𝒏𝒕𝒊𝒂𝒍(𝝀), if it
has no need pdf
• PDF: 𝑓 𝑡|𝜆 = 𝜆𝑒 EIJ 𝑓𝑜𝑟 𝑡 > 0
• CDF: F 𝑡|𝜆 = 1 − 𝑒 EIJ 𝑓𝑜𝑟 𝑡 > 0
• The probability that the time between arrivals is 𝑡K or less:
𝑃 𝑇 ≤ 𝑡K = 1 − 𝑒 EIJ#
• The probability that the time between arrivals is between 𝑡L
and 𝑡K :
𝑃 𝑡L ≤ 𝑇 ≤ 𝑡K = 1 − 𝑒 EIJ# − 1 − 𝑒 EIJ$ = 𝑒 EIJ$ − 𝑒 EIJ#

where
• 𝜆 is the mean number of independent arrivals per time unit
• 𝑡 is the number of time units until the next arrival
• 𝑒 = the mathematical constant approximated by 2.71828. It is the base for
natural logarithms, called Euler’s number
The Exponential Distribution
• It is restricted to random variables with positive
values, and its distribution is not symmetric
– The upper tail is thinner than that of the normal
distribution.

𝑻~𝑬𝒙𝒑𝒐𝒏𝒆𝒏𝒕𝒊𝒂𝒍(𝟎. 𝟐)

The probability that an


arrival occurs between
time 10 and 20
Properties of the Exponential Distribution
• Exponential F 𝑡|𝜆 most common use:
– model waiting time before the first arrival.
– waiting time between any two successive Poisson hits
– can also be used to model survival time, i.e. probability
that a patient can survive for time t.

• Use the survivor function for survival time:


– S t ≔ P T > t = 1 − F 𝑡|𝜆 = 𝑒 ;FG
Exponential and Poisson Distributions
• The exponential distribution is closely related to the Poisson
distribution.
• Given an interval of time [0,T] (e.g., an hour), waiting time X until
next occurrence can be modeled by X~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙 𝜆 . If N is
the expected number of occurrences in this interval [0,T], then
– X~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙 𝜆 ⇒ 𝑁~𝑃𝑜𝑖𝑠𝑠𝑜𝑛 𝜆
F F
– 𝜇B = and 𝜎BA = .
I I%
– An exponential distribution is determined completely by its mean.
F
– 𝜇B = is the expected waiting time, and 𝜇M = 𝜆 from last Topic is
I
the expected number of occurrences.
– Exponential and Poisson have the same assumptions.
Exponential VS Poisson
Question How much time between a given How many events occur in a time
number of events interval?

RV Time -- continuous Number of events - discrete

Parameter 𝜆 = rate of occurrence 𝜆 = expected number of occurrences


& in the time interval
Units: '()*
Units: count
(e.g., 2 events per hour)
(e.g., 2 events in one hour)
Practice Question
Service times for customers at a library information desk
can be modeled by an exponential distribution with a
mean service time of 5 minutes. What is the probability
that a customer service time will take longer than 10
minutes?

[hint: what is the time interval?]


• 𝑇: the service time in minutes such that
𝑇~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙(𝜆)
?
• Service rate 𝜆 = = 0.2 per minute
H
• 𝑃 𝑇 > 10 = 1 − 𝑃 𝑇 < 10 = 1 − 𝐹 10 = 𝑒 ;-
– where 𝐹 10 = 1 − 𝑒 J$.:×#$ = 1 − 𝑒 J:
Practice Question
Service times for customers at a library information desk
can be modeled by an exponential distribution with a
mean service time of 5 minutes. What is the probability
that a customer service time will take longer than 10
minutes?

[hint: what is the time interval?]


• 𝑇: the service time in minutes such that
𝑇~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙(𝜆)
?
• Service rate 𝜆 = = 0.2 per minute
H
• 𝑃 𝑇 > 10 = 1 − 𝑃 𝑇 < 10 = 1 − 𝐹 10 = 𝑒 ;-
– where 𝐹 10 = 1 − 𝑒 J$.:×#$ = 1 − 𝑒 J:
Practice Question
Service times for customers at a library information desk
can be modeled by an exponential distribution with a
mean service time of 5 minutes. What is the probability
that a customer service time will take longer than 10
minutes?

[hint: what is the time interval?]


• 𝑇: the service time in 5 minutes such that
𝑇~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙(𝜆)
• Service rate 𝜆 = 1 per 5 minutes
• 𝑃 𝑇 > 10/5 = 1 − 𝑃 𝑇 < 10/5 = 1 − 𝐹 2 = 𝑒 ;-
– where 𝐹 2 = 1 − 𝑒 J#×: = 1 − 𝑒 J:
Practice Question
The expected number of security cameras on a highway is 1/3 for every kilometer you drive.
1. Find the probability that we see exactly 2 security cameras in the next kilometer.
2. Find the probability that we see at least 1 security camera in the next kilometer.
3. Find the probability that we see exactly 2 security cameras in the next 12 km.
4. Find the probability that we see at least 1 security camera in the next 12 km.
5. Find the probability that we will see one security camera after driving 5 km.
6. Find the probability that we will have to drive at least 10 km before seeing the next security
camera.
Practice Question
The expected number of security cameras on a highway is 1/3 for every kilometer you drive.
1. Find the probability that we see exactly 2 security cameras in the next km.
2. Find the probability that we see at least 1 security camera in the next km.
3. Find the probability that we see exactly 2 security cameras in the next 12 km.
4. Find the probability that we see at least 1 security camera in the next 12 km.
5. Find the probability that we will see one security camera after driving 5 km.
6. Find the probability that we will have to drive at least 10 km before seeing the next security
camera.

Answers for 1 and 2:


!
Let 𝑋 be the number of security cameras we see in the next km. Translating: 𝑋~𝑃𝑜𝑖𝑠𝑠𝑜𝑛 "
.
! # $!/"
"
#
So P 𝑋 = 2 = $!
≈ 0.04
! & $!/"
"
#
P 𝑋 ≥ 1 = 1 − 𝑃(𝑋 = 0) = 1 − = 0.28
&!
Practice Question
The expected number of security cameras on a highway is 1/3 for every kilometer you drive.
1. Find the probability that we see exactly 2 security cameras in the next kilometer.
2. Find the probability that we see at least 1 security camera in the next kilometer.
3. Find the probability that we see exactly 2 security cameras in the next 12 km.
4. Find the probability that we see at least 1 security camera in the next 12 km.
5. Find the probability that we will see one security camera after driving 5 km.
6. Find the probability that we will have to drive at least 10 km before seeing the next security
camera.

Answers for 3 and 4:

Let 𝑊 be the number of security cameras we see in the next 12km. Since 12 = 12×1, we have
𝑊~𝑃𝑜𝑖𝑠𝑠𝑜𝑛 4 , where 4 = 12×1/3 (so 12 is our scaling factor 𝑘)
' ## $'
So P 𝑊 = 2 = $!
≈ 0.15
' &# '
P 𝑊 ≥ 1 = 1 − 𝑃(𝑊 = 0) = 1 − &!
= 0.98
Practice Question
The expected number of security cameras on a highway is 1/3 for every kilometer you drive.
1. Find the probability that we see exactly 2 security cameras in the next kilometer.
2. Find the probability that we see at least 1 security camera in the next kilometer.
3. Find the probability that we see exactly 2 security cameras in the next 12 km.
4. Find the probability that we see at least 1 security camera in the next 12 km.
5. Find the probability that we will see the next security camera after driving 5 km.
6. Find the probability that we will have to drive at least 10 km before seeing the next security
camera.

Answers for 5 and 6:

Let 𝑌 be the distance traveled before the next security camera is seen. Since the expected number
of arrivals is 1/3, the average expected distance (interval) between two security cameras would
!
follow an Exponential distribution with mean 3,i.e, 𝜇( = ) = 3. So 𝑌~𝐸𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙 1/3 .
!
*(")(-)
So P 𝑌 ≤ 5 = 1 − 𝑒 = 0.81
!
* !&
P Y > 10 = 1 − P 𝑌 ≤ 10 = 1 − (1 − 𝑒 " ) = 0.036
Jointly Distributed Continuous
Random Variables
Jointly Distributed Continuous Random Variables

• Let " ! # $" " # $%$%$%# " ! be continuous random variables

• Their joint cumulative distribution function,


" ( #! # $#" # $%$%$%# #! )
defines the probability that simultaneously ! ! !" #$"" %&'( "! "
! ! !" #$"" %&'( "! " and so on; that is

" ( #! # $#" # $%$%$%# #! ) = $ ( % ! < #! I % " < #" I !!! % ! < #! )


Marginal distribution and Independence
• The cumulative distribution functions
" ( #! ) # " ( #" ) #$$$# " ( #! )
of the individual random variables are called their
marginal distribution functions

• The random variables are independent if and only if

" ( #! # #" #$$$# #! ) = " ( #! ) " ( #" ) !!! " ( #! )


Covariance
• Let X and Y be continuous random variables, with means 𝜇$
and 𝜇%

• The expected value of ! # ! µ ! "!$ ! µ " " is called the covariance


between X and Y

#$% ( C ! ' ) = E !$( C # µ ! ) (' # µ " ) "%


• An alternative but equivalent expression is

#$% ( C ! ' ) = E" C' # ! µ ! µ "

• If the random variables X and Y are independent, then the covariance


between them is 0. However, the converse is not true.
Correlation
• Let X and Y be jointly distributed random variables.
• The correlation between X and Y is

#$% ( ! ! " )
! = #$CC ( ! ! " ) =
" !""
Sums, Means, and Variance
Differences, Means, and Variance
Linear Combinations of Random Variables
• A linear combination of two random variables, X and Y,
(where a and b are constants) is

! = "# + $%
• The mean of W is

µ! = $ [! ] = $ [ %" + &# ] = % µ " + &µ#


Linear Combinations of Random Variables
• The variance of W is

! !! = $ !! "! + % !! #! + !$%C'( ( " " # )


• Or using the correlation,

! !! = $ !! "! + % !! #! + !$%" ( " " # ) ! " ! #

• If both X and Y are joint normally distributed random variables


then the linear combination, W, is also normally distributed
Practice Question
– X = minutes to complete task 1; µ ! = !"# ! ! = $
– Y = minutes to complete task 2; µ ! = !"# ! ! = $
• What are the mean and standard deviation for the time to complete both
tasks? Assuming they are independent.
Practice Question
– X = minutes to complete task 1; µ ! = !"# ! ! = $
– Y = minutes to complete task 2; µ ! = !"# ! ! = $
• What are the mean and standard deviation for the time to complete both
tasks?

! = " +#
µ! = µ " + µ# = !" + #" = $"
• Since X and Y are independent, !"# ( $ ! % ) = "! so

! = ! + ! + !$%C ( " " # ) = ( # ) + ( $ ) = $%


! ! ! ! !
! " #
• The standard deviation is

! ! = !" = "#$%$
Financial Investment Portfolios
• A financial portfolio can be viewed as a linear
combination of separate financial instruments

! !"#$#"%&#'(#)( " ! !"#$#"%&#'(#)( "


! *+%,"'(#' " # $ ! -%#./(0" # $ ! -%#./(1 "
# $ = # $#"%)#2&#(P42,+ $ % # $ + # $#"%)#2&#(P42,+ $ % # $
& $#"%)#2&# ' # $ & "+%,"' ' # $ & "+%,"' '
& &'(R%#./(0 ' & &'(R%#./(1 '
! !"#$#"%&#'(#)( "
# $ ! -%#./(! "
((( + # $#"%)#2&#(P42,+ $ % # $
# &'(R%#./(! $ & "+%,"' '
& '
Portfolio Analysis Question
• Consider two stocks, A and B
– The price of Stock A is normally distributed with mean 12 and standard deviation 4
– The price of Stock B is normally distributed with mean 20 and standard deviation 16
– The stock prices have a positive correlation, ! !" = !"#
• Suppose you own 10 shares of Stock A and 30 shares of Stock B. What is the
probability that your portfolio value is less than $500?
Portfolio Analysis Question
• Consider two stocks, A and B
– The price of Stock A is normally distributed with mean 12 and standard deviation 4
– The price of Stock B is normally distributed with mean 20 and standard deviation 16
– The stock prices have a positive correlation, ! !" = !"#
• Suppose you own 10 shares of Stock A and 30 shares of Stock B. What is the
probability that your portfolio value is less than $500?

𝜇+ = 10𝜇, + 30𝜇- = 10 12 + 30 20 = 720


! !! = "#! ! "! + $#! ! #! + ( ! )("# )( $# ) ABCC ( "% # ) ! "! #
= "#! ( & ) + $#! ("' ) + ( ! )("# )( $# )(()# )( & )("' )
! !

= !)"% !##

!"" ! #$"
!= = !"%&& ! ( " < !!"## ) = !"$$!!
!"'%$"
– So the probability is 0.33 that your portfolio value is less than $500.
Portfolio Analysis Question
• Consider two stocks, A and B
– The price of Stock A is normally distributed with mean 12 and standard deviation 4
– The price of Stock B is normally distributed with mean 20 and standard deviation 16
– The stock prices have a negative correlation, ! !" = !"# −0.50
• Suppose you own 10 shares of Stock A and 30 shares of Stock B. What is the
probability that your portfolio value is less than $500?

𝜇+ = 10𝜇, + 30𝜇- = 10 12 + 30 20 = 720


! !! = "#! ! "! + $#! ! #! + ( ! )("# )( $# ) ABCC ( "% # ) ! "! #
= "#! ( & ) + $#! ("' ) + ( ! )("# )( $# )(()# )( & )("' )
! !

−0.50
= !)"% !## 212,800
−0.48 0.316
!"" ! #$" −0.48 ! ( " < !!"## ) = !"$$!!
!= = !"%&&
461.30 !"'%$"
– So the probability is 0.316 that your portfolio value is less than $500.
Portfolio Analysis
• Ignore market risk.
• If two financial assets have returns that are
negatively correlated, then the resulting
portfolio will have a smaller variance and
hence a lower risk.
– Hedging
What is Hedging?
[Link] (1:59)

You might also like