ECON10005:
Quantitative Methods 1
Week 4, Lecture 2
Discrete probability distributions
Chapter 6
1
Learning outcomes
1. Define a discrete random variable and its probability distribution
2. Solve problems using expected value and variance
3. Define and apply the uniform discrete model
4. Find binomial probabilities using tables, formulas, or Excel
5. Apply rules for transformations of random variables
2
Recall from last lecture: Bernoulli experiments
• A random experiment that has only two outcomes is called a Bernoulli
experiment.
• To create a random variable, we arbitrarily call one outcome a “success”
(denoted X = 1) and the other a “failure” (denoted X = 0).
• The probability of success is denoted: 𝜋.
• The probability of failure is ∶ 1 − 𝜋
• so the probabilities sum to 1
𝑃 0 + 𝑃 1 = 1 − 𝜋 + 𝜋 = 1.
• The probability of success, 𝝅 remains the same for each trial.
• 𝑬 𝑿 = 𝝅; Var 𝑿 = 𝝅(1− 𝝅); Standard deviation = 𝝅(1− 𝝅)
3
Binomial distributions
• The binomial distribution arises when a Bernoulli experiment is repeated n
times.
• Each trial is independent, so that the probability of success 𝝅 remains
constant for each trial
• In a binomial experiment, we are interested in X = the number of successes
in n trials, so the binomial random variable X is the sum of n independent
Bernoulli random variables:
𝑋 = 𝑋1 + 𝑋2 + ⋯ + 𝑋𝑛
• The probability of a particular number of successes 𝑃 𝑋 is determined by
parameters n and 𝝅
4
Characteristics of the Binomial Distribution
Parameters 𝑛 = number of trials; 𝜋 = probability of success
𝑛!
PDF 𝑃(𝑋 = 𝑥) = 𝜋𝑥 1 − 𝜋 𝑛−𝑥
𝑥! 𝑛 − 𝑥 !
Domain 𝑥 = 0, 1,2, … , 𝑛
Mean 𝑛𝜋
Standard deviation 𝑛𝜋 1 − 𝜋
5
Example: Quick Oil Change Shop
• Consider a shop that specializes in quick oil changes. It is important to this type of
business to ensure that a car’s service time is not considered “late” by the
customer. We can define service times as being either late or not late and define the
random variable X to be the number of cars that are late out of the total number
of cars serviced.
• We assume that cars are independent of each other and the chance of a car
being late stays the same for each car.
• Suppose that historically 𝑃(car is late) = 𝜋 = .10.
• We would like to know the probability that exactly 2 of the next 12 cars serviced are
late.
• In this case, n = 12, and we want to know 𝑃(𝑋 = 2):
6
Example: Quick Oil Change Shop
• Suppose that historically 𝑃(car is late) = 𝜋 = .10.
• Suppose we would like to know the probability that exactly 2 of the next 12 cars
serviced are late.
• In this case, n = 12, and we want to know 𝑃(𝑋 = 2):
𝑛!
𝑃 𝑋=𝑥 = 𝜋𝑥 1 − 𝜋 𝑛−𝑥
𝑥! 𝑛 − 𝑥 !
12! 2 12−2
𝑃 𝑋=2 = .10 1 − .10
2! 12 − 2 !
12 × 11 × 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 2 10
𝑃 𝑋=2 = .10 .90
(2 × 1)(10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1)
12×11
= .10 2
.90 10
=.2301
(2×1)
7
Binomial Shape
• A binomial distribution is
• skewed right if 𝜋 < .50,
• skewed left if 𝜋 > .50,
• and symmetric only if 𝜋 = .50.
• However, skewness decreases as n increases, regardless of the value of 𝜋
8
Recognizing Binomial Applications
• The binomial distribution has five main characteristics.
• The number of trials (n) is fixed.
• There are only two outcomes for each trial: success or failure.
• The probability of success for each trial 𝜋 remains constant.
• The trials are independent of each other.
• The random variable (X) is the number of successes out of n trials.
• Even if you don’t know 𝜋, you may have a binomial experiment.
• In practice, the value of 𝜋 would be estimated from experience.
9
Find Binomial probabilities using
• The binomial formula.
• The binomial tables in the Appendix of the text.
• Excel :
• PDF using = [Link](𝑥, 𝑛, 𝜋, 𝟎),
• CDF using = [Link](𝑥, 𝑛, 𝜋, 𝟏)
• Scientific calculators
10
Example: insured patients
• On average, 20 percent of the emergency room patients at Royal Melbourne Hospital have
private health insurance.
• In a random sample of four patients, what is the probability that two will be insured?
• X = number of insured patients (“success”).
• P insured = 𝜋 = .20 (20% chance that a given patient will be insured).
• P 𝑢𝑛insured = 1 − 𝜋 = .80 (80% chance that a patient will be uninsured).
• N = 4 patients.
• The domain is X = 0, 1, 2, 3, 4 patients.
• Mean = 𝜇 = 𝑛𝜋 = 4 .20 = 0.8 patient
• Standard deviation = 𝜎 = 𝑛𝜋 1 − 𝜋 = 4 .20 1 − .20 = 0.8 patient
11
Example: insured patients
In a random sample of four patients, what is the probability that two
patients will be insured?
• We can calculate binomial probabilities by the formula (n = 4 and 𝜋 = 0.2) :
𝑛!
𝑃 𝑋=𝑥 = 𝜋 𝑥 1 − 𝜋 𝑛−𝑥
𝑥! 𝑛 − 𝑥 !
4!
𝑃(𝑋 = 2) = .2 2
1 − 0.2 4−2
= .1536 or 15.36%.
2! 4 − 2 !
• Or, we can calculate binomial probabilities by using Excel’s binomial formula
=[Link](x, n, 𝜋, cumulative),
where cumulative is 0 (if you want a PDF) or 1 (if you want a CDF).
12
Example: insured patients
• Use Excel to find the probability that, in a random sample of 4 emergency
room patients, 1, 2, 3 and 4 patients have private health insurance when
𝜋 =0.2
• Use Excel to find the PDF for each event
• Find the probability that at none, at least 1, at least 2, at least 3, and all 4
patients are insured.
• PDF using =[Link](𝑥, 𝑛, 𝜋, 0), CDF using =[Link](𝑥, 𝑛, 𝜋, 1)
X PDF: P(X=x) CDF: P(X≤x)
0 0.4096 0.4096
1 0.4096 0.8192
2 0.1536 0.9728
3 0.0256 0.9984
4 0.0016 1.0000
13
Compound events
• A compound event is expressed using an inequality.
• Consider the event that the sample of four patients will contain at most two
insured patients.
• The probability of this event would be expressed as 𝑃 𝑋 ≤ 2 .
𝑃 𝑋 ≤2 =𝑃 𝑋 =0 +𝑃 𝑋 =1 +𝑃 𝑋 =2
= .4096 + .4096 + .1536
= .9728
14
Compound events
• To interpret phrases such as “more than” or “at least,” it is helpful to sketch a
diagram:
15
Compound events
X PDF: P(X=x) CDF: P(X≤x)
0 0.4096 0.4096
1 0.4096 0.8192
2 0.1536 0.9728
3 0.0256 0.9984
4 0.0016 1.0000
• What is the probability that fewer than two patients have insurance?
𝑃 𝑋 < 2 = 𝑃 0 + 1 = .4096 + .4096 = .8192.
• What is the probability that no more than two patients have insurance?
𝑃 𝑋 ≤ 2 = 𝑃 0 + 𝑃 1 + 𝑃 2 = .4096 + .4096 + .1536 = .9728
16
Compound events
X PDF: P(X=x) CDF: P(X≤x)
0 0.4096 0.4096
1 0.4096 0.8192
2 0.1536 0.9728
3 0.0256 0.9984
4 0.0016 1.0000
• What is the probability that at least two patients are insured?
𝑃 𝑋 ≥ 2 = 𝑃 2 + 𝑃 3 + 𝑃 4 =. 1536 + .0256 + 0.0016 = .1808
𝑃 𝑋 ≥ 2 = 1 − 𝑃 𝑋 < 2 = 1 − 0.8192 = .1808
17
Linear transformations of random variables
• A linear transformation of a random variable X is performed by adding a constant, multiplying by
a constant, or both.
• Consider the random variable 𝑎 X + 𝑏, where 𝑎 and 𝑏 are any constants
• Adding a constant shifts the mean but does not affect the variance or standard deviation
• Multiplying by a constant affects both the mean and the variance (and standard deviation).
Let X ~ (𝜇𝑋 , 𝜎𝑋 ) and define Y = 𝑎 X + 𝑏, where 𝑎 and 𝑏 are constants
Rule 1: E(Y)= 𝑎 E(X)+ 𝑏
𝜇𝑌 = 𝑎𝜇𝑋 + 𝑏
Rule 2: 𝑉𝑎𝑟 𝑌 = 𝑎 2 𝑉𝑎𝑟 𝑋
𝜎𝑌2 = 𝑎 2 𝜎𝑋2
𝜎𝑌 = 𝜎𝑌2 = 𝑎 2 𝜎𝑋2 = 𝑎 𝜎𝑋
18
Example: Exam Scores
• Professor Hardtack gave a tough exam whose
raw scores had
𝜇 = 40 and 𝜎 = 10
𝑎 = 1 and b = 20
𝜇 = 40 and 𝜎 = 10,
so he decided to raise the mean by 20 points.
E(Y)=𝑎E(X)+ b;
• One way to increase the mean to 60 is to shift
=1 x (40)+20=60
the curve by adding 20 points to every
student’s score.
Var Y = 𝑎2 Var X
ie Y=1x (X) + 20
= 1 x (10)2=100
• Rule 1 says that adding a constant to all X-
values will shift the mean but will leave the
standard deviation unchanged, 𝜎𝑌 = 𝜎𝑌2 = 𝑎2 𝜎𝑋2 = 1 x(10)=10
𝑎 = 1 and b = 20.
19
Adding 20 points to every student’s score.
20
Example: Exam Scores
𝜇 = 40 and 𝜎 = 10
𝑎 = 1.5 and b = 0
• Alternatively, Professor Hardtack could multiply
every exam score by 1.5, which also would
accomplish the goal of raising the mean from 40 to
E(Y)=𝑎E(X)+ b;
60.
=1.5 x (40)=60
• Rule 2 says that the standard deviation would rise
from 10 to 15, thereby also increasing the
dispersion. Var Y = 𝑎2 Var X
• In other words, this policy would “spread out” the = (1.5)2 x (10)2
students’ exam scores. Some scores might even
=2.25 x 100=225
exceed 100
𝑎 = 1.5 and b = 0.
𝜎𝑌 = 𝜎𝑌2 = 𝑎2 𝜎𝑋2
= 1.5 x 10 = 15
21
multiply every exam score by 1.5
22
Sums of Independent Random Variables
If we consider the sum of two independent random variables X and Y, given as
A = X + Y,
where X ~ (𝜇𝑋 , 𝜎𝑋 ) and Y ~ (𝜇𝑌 , 𝜎𝑌 )
Rule 3: 𝐸 𝐴 = 𝐸 𝑋 + 𝐸(𝑌)
𝜇𝐴 = 𝜇𝑋 + 𝜇𝑌
• Rule 3 says that the means can be added.
Rule 4: 𝑉𝑎𝑟 𝐴 = 𝑉𝑎𝑟 𝑋 + 𝑉𝑎𝑟(𝑌)
𝜎𝐴2 = 𝜎𝑋2 + 𝜎𝑌2
𝑉𝑎𝑟 𝐴 = 𝑉𝑎𝑟 𝑋 + 𝑉𝑎𝑟(𝑌)
𝜎𝐴 = 𝜎𝑋2 + 𝜎𝑌2
• Rule 4 says that the variances can be added if the variables are independent.
23
Sums of Random Variables that are NOT
independent
• If X and Y are not independent (that is, if X and Y are correlated), then we
cannot use Rule 4 to find the standard deviation of their sum.
• The covariance of two random variables, denoted Cov(𝑋, 𝑌) or 𝜎𝑋𝑌 , describes
how the variables vary in relation to each other.
• We use both the covariance and the variances of X and Y to calculate the
variance and the standard deviation of the sum of X and Y.
24
Sums of Random Variables that are NOT
independent
If we consider the sum of two random variables X and Y, given as
A= X + Y, where
X ~ (𝜇𝑋 , 𝜎𝑋 ) and Y ~ (𝜇𝑌 , 𝜎𝑌 ) and Cov(𝑋, 𝑌) = 𝜎𝑋𝑌
Rule 3: 𝐸 𝐴 = 𝐸 𝑋 + 𝐸(𝑌)
𝜇𝐴 = 𝜇𝑋 + 𝜇𝑌
Rule 5: 𝑉𝑎𝑟(𝐴) = 𝑉𝑎𝑟 𝑋 + 𝑉𝑎𝑟(𝑌) + 2Cov(𝑋, 𝑌)
𝜎𝐴2 = 𝜎𝑋2 + 𝜎𝑌2 + 2𝜎𝑋𝑌
𝜎𝐴 = 𝜎𝑋2 + 𝜎𝑌2 + 2𝜎𝑋𝑌
25
Linear transformations and sums of random
variables that are NOT independent
If we consider the sum of two linearly transformed random variables X and Y, given as
Q = 𝑎X + 𝑏Y, where
X ~ (𝜇𝑋 , 𝜎𝑋 ) and Y ~ (𝜇𝑌 , 𝜎𝑌 ) and Cov(𝑋, 𝑌) = 𝜎𝑋𝑌
From Rules 1 & 3: 𝐸 𝑄 = 𝑎𝐸(𝑋) + 𝑏𝐸(𝑌)
𝜇𝑄 = 𝑎𝜇𝑋 + 𝑏𝜇𝑌
From Rule 2 & 5: 𝑉 𝑄 = 𝑎 2 𝑉𝑎𝑟 𝑋 + 𝑏 2 𝑉𝑎𝑟(𝑌) + 2 𝑎𝑏 Cov(𝑋, 𝑌)
𝜎𝑄2 = 𝑎 2 𝜎𝑋2 + 𝑏 2 𝜎𝑌2 + 2𝑎𝑏𝜎𝑋𝑌
𝜎𝑄 = 𝑎 2 𝜎𝑋2 + 𝑏 2 𝜎𝑌2 + 2𝑎𝑏𝜎𝑋𝑌
26
Example: linear transformations and sums of random
variables that are NOT independent
You are thinking about investing $100 in Meta or Tesla shares.
Define M and T as random variables representing the value of the $100 investment in
Meta shares after 1 yr, and Tesla shares after 1 year, respectively.
From extensive research, we know that
2
E(M)= 𝜇𝑀 =108; var(M)= 𝜎𝑀 =216
E(T)= 𝜇 𝑇 =108; var(T) =𝜎𝑇2 =484
Cov(M,T)= 𝜎𝑀𝑇 =-132
Can you do better by diversifying? What is the mean and variance of the value of $100
after a year if you put $50 in Meta & $50 in Tesla?
27
Example: diversifying your portfolio
E(M) = 𝜇𝑀 =108; var(M)= 𝜎𝑀2 = 216
E(T) = 𝜇 𝑇 =108; var(T) = 𝜎𝑇2 = 484
Cov(M,T) = 𝜎𝑀𝑇 = –132
Define Q = 0.5M + 0.5T
From slide 26 : Q = 𝑎X + 𝑏Y so 𝑎 = 𝑏 = 0.5 and define X = Meta; Y = Tesla
𝐸 𝑄 = 𝑎𝐸(𝑋) + 𝑏𝐸(𝑌)
𝑉 𝑄 = 𝑎2 𝑉𝑎𝑟 𝑋 + 𝑏2 𝑉𝑎𝑟(𝑌) + 2 𝑎𝑏 Cov(𝑋, 𝑌)
E[Q] = 0.5 E[M] + 0.5 E[T] = 0.5 x 108 + 0.5 x 108 = 108
Var[Q] = 0.52 𝜎𝑀2 + 0.52 𝜎𝑇2 + 2 x (0.5 x 0.5)𝜎𝑀𝑇
= 0.25 x 216 + 0.25 x 484 + 2 x 0.25 x (−132) = 109
The diversified portfolio has the same expected return as each stock but has a lower risk (i.e.
lower variance). If you prefer a lower risk, you can do better by diversifying.
28
Today we covered
• Binomial distributions
• Calculating binomial probabilities
• Compound events
• Linear transformations of random variables
• Sums of independent random variables
• Sums of random variables that are not independent
29