Discrete Distributions
Discrete Distributions
Distributions
Outline
Introduction to Random Variables
Variables
• Default: A factor with levels “No” and “Yes” indicating whether the customer
defaulted on their debt.
• Student: A factor with levels “No” and “Yes” indicating whether the customer is a
student.
• Balance: The average balance that the customer has remaining on their credit card
after making their monthly payment.
• Income: Income of customer.
Default Data Set
ID Balance Income Student Default
1 729.52 44361.63 No No
2 817.18 12106.13 Yes No
3 1073.55 31767.14 No No
4 529.25 35704.49 No No
5 785.66 38463.5 No No
6 919.59 7491.559 Yes No
7 825.5 24905.23 No No
8 808.67 17600.45 Yes No
9 1161.06 37468.53 No No
Default Data Set
ID Balance Income Student Default
1 729.52 44361.63 No No
2 817.18 12106.13 Yes No
3 1073.55 31767.14 No No
4 529.25 35704.49 No No
5 785.66 38463.5 No No
6 919.59 7491.559 Yes No
7 825.5 24905.23 No No
8 808.67 17600.45 Yes No
9 1161.06 37468.53 No No
Default Data Set
ID Balance Income Student Default
1 729.52 44361.63 No
2 817.18 12106.13 Yes
3 1073.55 31767.14 No
4 529.25 35704.49 No
5 785.66 38463.5 No
6 919.59 7491.559 Yes
7 825.5 24905.23 No
8 808.67 17600.45 Yes
9 1161.06 37468.53 No
Default Data Set
• Let’s consider the first customer.
Default Data Set
• Let’s consider the first customer.
• There are only two possibilities for the first
customer-either he defaults, or he does not.
Default Data Set
• Let’s consider the first customer.
• There are only two possibilities for the first
customer-either he defaults, or he does not.
• Can we represent the same information in another
way?
Default Data Set
• Let’s define a variable 𝑋1 for the first customer,
which takes the following values:
1, if he defaults
𝑋1 = ቊ
0, 𝑖𝑓 ℎ𝑒 𝑑𝑜𝑒𝑠 𝑛𝑜𝑡
Default Data Set
• If you are a credit company manager,
possibly you are more interested in the
total number of defaulters.
Default Data Set
• If you are a credit company manager,
possibly you are more interested in the
total number of defaulters.
• Let 𝑋 be the total number of defaulters.
Default Data Set
• If you are a credit company manager,
possibly you are more interested in the
total number of defaulters.
• Let 𝑋 be the total number of defaulters.
• It is easy to see that
10,000
𝑋 = 𝑋𝑖 ,
𝑖=1
where 𝑋𝑖 corresponds to the 𝑖-th
customer.
Default Data Set
• What are the possible values of 𝑋?
Random Variables
• A function that assigns numerical values to the outcomes of a random
experiment.
• Denoted by uppercase letters (e.g., 𝑋).
• Values of the random variable are denoted by corresponding
lowercase letters.
Corresponding values of the random variable: 𝑥1, 𝑥2, 𝑥3, . . .
Examples
• Experiment 1: Rolling a six-sided die
Sample Space S = {1, 2, 3, 4, 5, 6}
Let X = Win $10 if odd number and lose $10 if even number
Possible values = {–10, 10}
• Experiment 2: Two shirts are selected from the production line and each is either
defective (D) or non-defective (N)
S = {(D, D), (D, N), (N, D), (N, N)} (D,D)
Let X = the number of defective (D,N)
shirts (N,D)
(N,N)
Possible values = {0, 1, 2}
Examples
• Experiment 3: Reviewing a single mortgage application and deciding
whether the client gets approved (A) or denied (D)
S = {A, D}.
Let X = 1 for A and 0 for D;
Possible values = {0, 1}.
Random Variables
Discrete
Random
Variable
Continuous
Random Variables
• Random variables may be classified as:
Discrete
The random variable assumes a countable number of distinct values.
Examples:
1. Number of students who get financial aid out of the 100 students who
applied
2. Number of cars that cross a particular bridge in a city between 9 AM and
10 AM
Random Variables
Continuous
The random variable is characterized by (infinitely) uncountable
values within any interval.
Example:
Time taken by a student to complete a 60-minute exam may
assume any value between 0 and 60 minutes.
Discrete Random Variable
Discrete Probability Distribution
• Every discrete random variable is associated with a probability
distribution that describes the variable completely.
A probability mass function is used to describe discrete random
variables.
A cumulative distribution function may also be used to describe
discrete random variables.
Discrete Probability Distribution
• The probability mass function for a discrete random variable X is
a list of the values of X with the associated probabilities, that is,
the list of all possible pairs
x, P X x
• The cumulative distribution function for X is defined as
P X x
Discrete Probability Distribution
• Two key properties of discrete probability distributions:
The probability of each value x is a value between 0 and 1. That is,
0 ≤ 𝑃(𝑋 = 𝑥) ≤ 1.
𝑃 𝑋 = 𝑥 = 1.
𝑥
An Example
• Consider the probability distribution that reflects the number of credit
cards that the students carry:
Number of Credit Cards Percentage
0 2.5%
1 9.8%
2 16.6%
3 16.5%
4 54.6%
Example contd..
• Is this a valid probability distribution?
• What is the probability that a reader carries no credit cards?
• What is the probability that a reader carries fewer than two?
• What is the probability that a reader carries at least two credit cards?
Number of Percentage
Credit Cards Example contd..
0 2.5% • Let 𝑋 denote the number of credit cards.
• We observe that, for 𝑥 = 0, 1, 2, 3, 4,
1 9.8% 0 ≤ 𝑃 𝑋 = 𝑥 ≤ 1.
• Also, we have
2 16.6% 4
𝑃 𝑋 = 𝑥 = 1.
3 16.5% 𝑥=0
• Thus, it satisfies the conditions of a valid
probability distribution.
4 54.6%
Number of Percentage
Credit Cards Example contd..
0 2.5% • We have to find
𝑃 𝑋=0 .
1 9.8% • This is 0.025, as given by the table.
2 16.6%
3 16.5%
4 54.6%
Number of Percentage
Credit Cards Example contd..
0 2.5% • We have to find
𝑃 𝑋<2 .
1 9.8% • Now,
𝑃 𝑋 <2 =𝑃 𝑋 =0 +𝑃 𝑋 =1
2 16.6% = 0.025 + 0.098 = 0.123.
3 16.5%
4 54.6%
Number of Percentage
Credit Cards Example contd..
0 2.5% • We have to find
𝑃 𝑋≥2 .
4 54.6%
Summary Measures for a Random Variable
• Summary measures for a random variable include the
Mean (Expected Value)
Variance
Standard Deviation
Mean
• For a discrete random variable 𝑋 with values 𝑥1, 𝑥2, 𝑥3, . . . ,
that occur with probabilities 𝑃(𝑋 = 𝑥𝑖 ) , the expected value
of 𝑋 is the probability weighted average of the values:
𝐸 𝑋 = 𝜇 = 𝑥𝑖 𝑃 𝑋 = 𝑥𝑖 .
Var X xi P X xi
2 2
xi2P X xi 2
SD X 2
Example
• Brad Williams is the owner of a large car dealership. Brad decides to construct
an incentive compensation program that equitably and consistently
compensates employees on the basis of their performance.
• He offers an annual bonus of $10,000 for superior performance, $6,000 for
good performance, $3,000 for fair performance, and $0 for poor performance.
• Based on prior records, he expects an employee to perform at superior, good,
fair, and poor performance levels with probabilities 0.15, 0.25, 0.40, and 0.20,
respectively.
Example contd..
Bonus (in $1,000s) Performance Type Probability
$10 Superior 0.15
6 Good 0.25
3 Fair 0.40
0 Poor 0.20
.
Example contd..
• We have
𝐸 𝑋 = 𝜇 = σ 𝑥𝑖 𝑃 𝑋 = 𝑥𝑖 = 4.2, or $4,200
𝑉𝑎𝑟(𝑋) = 𝜎2 = 9.97.
𝑉 𝑋 + 𝑌 = 𝑉 𝑋 + 𝑉 𝑌 + 2 Cov(𝑋, 𝑌)
𝐸 𝑎𝑋 + 𝑏𝑌 = 𝑎𝐸 𝑋 + 𝑏𝐸(𝑌)
𝑉 𝑎𝑋 + 𝑏𝑌 = 𝑎2 𝑉 𝑋 + 𝑏 2 𝑉 𝑌 + 2𝑎𝑏 Cov 𝑋, 𝑌
Portfolio Returns
Portfolio Returns
• A portfolio is defined as a collection of assets such as stocks and bonds.
Let 𝑅𝐴 and 𝑅𝐵 represent two random variables of interest, denoting the
returns of two assets.
If an investor has invested in both assets, we want to evaluate the return
generated by the portfolio, which is a linear combination of 𝑅𝐴 and 𝑅𝐵 .
That is, the portfolio return 𝑅𝑝 is given by
𝑅𝑝 = 𝑤𝐴 𝑅𝐴 + 𝑤𝐵 𝑅𝐵 ,
where 𝑤𝐴 and 𝑤𝐵 are the portfolio weights with 𝑤𝐴 + 𝑤𝐵 = 1.
Portfolio Returns
• Investment opportunities often use
Expected return as a measure of reward.
Variance or standard deviation of return as a measure of risk.
Two Cases
Case 1: Portfolio Returns
Case 1: Portfolio Returns
Portfolio 1: 40% in Stock A and 60% in Stock B
Case 2: Portfolio Returns
Case 2: Portfolio Returns
Portfolio 2: 40% in Stock A and 60% in Stock B
Portfolio Expected Return
Portfolio Returns
• Given a portfolio with two assets, Asset 𝐴 and Asset 𝐵, the expected
return of the portfolio, 𝑬(𝑹𝒑 ), is computed as:
𝐸 𝑅𝑝 = 𝑤𝐴 𝐸 𝑅𝐴 + 𝑤𝐵 𝐸 𝑅𝐵
Stock A Stock B
𝐸 𝑅𝐴 = 9.5% 𝐸 𝑅𝐵 = 7.6%
𝑆𝐷 𝑅𝐴 = 12.93% 𝑆𝐷 𝑅𝐵 = 8.20%
𝐶𝑜𝑣 𝑅𝐴 , 𝑅𝐵 = 18.60%
• Given the above information, calculate the expected return of this portfolio.
Portfolio Returns: An Example
• First, we compute the portfolio weights:
Stock Weights
A 40,000
𝑤𝐴 = = 0.40
40,000 + 60,000
B 60,000
𝑤𝐵 = = 0.60
40,000 + 60,000
Portfolio Returns: An Example
• The expected return from the portfolio is then given by
𝐸 𝑅𝑝 = 𝑤𝐴 𝐸 𝑅𝐴 + 𝑤𝐵 𝐸 𝑅𝐵
= 0.40 × 9.5% + 0.60 × 7.6%
= 8.36%.
Portfolio Variance
Portfolio Returns
• Using the covariance or the correlation coefficient of the two returns, the
portfolio variance of return is:
• 𝜌𝐴𝐵 is the correlation coefficient between the returns for Asset 𝐴 and Asset
𝐵.
Portfolio Returns: An Example
• Consider an investment portfolio of $40,000 in Stock A and $60,000 in Stock B.
Stock A Stock B
𝐸 𝑅𝐴 = 9.5% 𝐸 𝑅𝐵 = 7.6%
𝑆𝐷 𝑅𝐴 = 12.93% 𝑆𝐷 𝑅𝐵 = 8.20%
𝐶𝑜𝑣 𝑅𝐴 , 𝑅𝐵 = 18.60%
Stock Weights
A 40,000
𝑤𝐴 = = 0.40
40,000 + 60,000
B 60,000
𝑤𝐵 = = 0.60
40,000 + 60,000
Portfolio Returns
• The portfolio variance is then given by
P X x x p q
n x nx n!
x ! n x !
x nx
pq
𝑃 𝑋 = 2 = 0.3252.
Questions
• What is the probability that at least 2 out of 3 customers will use a credit card?
Questions
• What is the probability that at least 2 out of 3 customers will use a credit card?
• The required probability is
𝑃 𝑋 ≥ 2 = 1 − 𝑃 𝑋 ≤ 1 = 1 − [𝑃 𝑋 = 0 + 𝑃 𝑋 = 1 ]
= 1 − 0.0034 + 0.0573 = 0.9393.
The ColorSmart-5000 Case: TV
Repairs
The ColorSmart-5000 Case: TV Repairs
• The manufacturer of the ColorSmart-5000 television set claims that 95 percent
of its sets last at least five years without requiring a single repair.
• Suppose that you have contacted n = 8 randomly selected ColorSmart-5000
purchasers five years after they purchased their sets.
The ColorSmart-5000 Case: TV Repairs
• What is the probability that 5 out of 8 randomly selected television sets would
last at least five years without a single repair?
• What is the probability that five or fewer of the eight randomly selected
televisions would last five years without a single repair?
• What is the probability that at least five of the eight randomly selected
televisions would last five years without a single repair?
The ColorSmart-5000 Case: TV Repairs
• Each purchaser’s set will have needed no repairs (a success) or will have been
repaired at least once (a failure).
• We will assume that 𝑝, the true probability that a purchaser’s television set will
require no repairs within five years, is .95, as claimed by the manufacturer.
• Furthermore, it is reasonable to believe that the repair records of the
purchasers’ sets are independent of each other.
The ColorSmart-5000 Case: TV Repairs
• Let 𝑋 denote the number of the 𝑛 = 8 randomly selected sets that will have
lasted at least five years without a single repair.
• Then 𝑋 is a binomial random variable that can take on any of the potential
values 0, 1, 2, 3, 4, 5, 6, 7, or 8.
The ColorSmart-5000 Case: TV Repairs
• What is the probability that 5 out of 8 randomly selected television sets would
last at least five years without a single repair?
• The required answer is
𝑃 𝑋 = 5 = 0.0054.
The ColorSmart-5000 Case: TV Repairs
• What is the probability that five or fewer of the eight randomly selected
televisions would last five years without a single repair?
• The required answer is
𝑃 𝑋 ≤ 5 = 0.0058.
The ColorSmart-5000 Case: TV Repairs
• What is the probability that at least five of the eight randomly selected
televisions would last five years without a single repair?
• The required answer is
𝑃 𝑋 ≥ 5 = 1 − 𝑃 𝑋 ≤ 4 = 1 − 0.0004 = 0.9996.
Binomial Probability Distribution
• The expected value is:
E X np
• The variance is:
Var X npq
2
A Practical Example
Default Data Set
A data set on ten thousand customers.
Variables
• Default: A factor with levels “No” and “Yes” indicating whether the customer
defaulted on their debt.
• Student: A factor with levels “No” and “Yes” indicating whether the customer is a
student.
• Balance: The average balance that the customer has remaining on their credit card
after making their monthly payment.
• Income: Income of customer.
A Practical Example
• Let’s look at the Default dataset.
• Consider the variable “default”.
• Note that “default” is a qualitative variable− “Yes” indicates that the customer
has defaulted and “No” indicates that the customer has not defaulted on the
credit card payment.
Example contd..
• Let’s now define the random variable 𝑋, where 𝑋 denotes the total number of
defaulters.
• Then 𝑋 has a binomial distribution.
Example contd..
Suppose three customers have recently applied for credit card. What is
the probability that at least two of them will default?
Example contd..
• This example satisfies the conditions of a Bernoulli experiment.
• A customer either defaults (labelled success), with an 3.33% likelihood, or does
not default (labelled failure), with a 96.67% likelihood.
• Given a large number of customers, these probabilities of success and failure do
not change from customer to customer.
Example contd..
𝑥 𝑷(𝑿 = 𝒙)
0 0.9034
1 0.0934
2 0.0032
3 0.0000
Total=1.0000
Poisson Distribution
Poisson Distribution
• A binomial random variable counts the number of successes in a fixed number
of Bernoulli trials.
• In contrast, a Poisson random variable counts the number of successes over a
given interval of time or space.
• Examples of a Poisson random variable include
With respect to time—the number of cars that cross a bridge between 9:00
am and 10:00 am on a Monday morning.
With respect to space—the number of defects in a
50-yard roll of fabric.
Poisson Distribution
• A random experiment is a Poisson process if
The number of successes within a specified time or space interval equals any
integer between zero and infinity.
The numbers of successes counted in non-overlapping intervals are
independent.
The probability that success occurs in any interval is the same for all intervals
of equal size and is proportional to the size of the interval.
Poisson Distribution
• For a Poisson random variable X, the probability of x successes over a given interval of
time or space is
𝑒 −𝜇 𝜇 𝑥
𝑃 𝑋=𝑥 = , for 𝑥 = 0, 1, 2, …
𝑥!
where 𝜇 is the mean number of successes and e = 2.718 is the base of the natural
logarithm.
Poisson Distribution
• The expected value (𝐸(𝑋)) is
𝐸 𝑋 = 𝜇.
• The variance (𝑉𝑎𝑟(𝑋)) is
Var 𝑋 = 𝜇.
SD 𝑋 = 𝜇.
Case: Available Staff for Probable Customers
• Anne Jones is a manager of a local Starbucks. Due to a weak economy and
higher gas and food prices, Starbucks announced plans in 2008 to close 500 U.S.
locations.
• While Anne’s store will remain open, she is concerned that nearby closings
might affect her business.
• A typical Starbucks customer visits the chain between 15 and 18 times a month.
• Based on all this, Anne believes that customers will average 18 visits to her
store over a 30-day month.
Case: Available Staff for Probable Customers
• Anne needs to decide staffing needs.
◦ Too many employees would be costly to the store.
◦ Not enough employees could result in losing customers who choose not to
wait.
• With an understanding of the probability distribution of customer arrivals, Anne
will be able to:
◦ Calculate the expected number of visits from a typical Starbucks customer in a
given time period.
◦ Calculate the probability that a typical customer visits the store a specific
number of times in a given time period.
Questions
• How many visits should Anne expect in a 5-day period from a typical Starbucks
customer?
• What is the probability that a customer visits the chain five times in a 5-day
period?
• What is the probability that a customer visits the chain no more than two times
in a 5-day period?
• What is the probability that a customer visits the chain at least three times in a
5-day period?
Case: Available Staff for Probable Customers
How many visits should Anne expect in a 5-day period from a typical
Starbucks customer?
• Given the rate of 18 visits over a 30-day month, we can write the mean for
the 30-day period as 𝜇30 = 18. For this problem, we compute the
18 visits 3 visits
proportional mean for a 5-day period as 𝜇5 = 3, because = .
30 visits 5 visits
• In other words, on average, a typical Starbucks customer visits the store
three times over a 5-day period.
Case: Available Staff for Probable Customers
• What is the probability that a customer visits the chain five times in a 5-day
period?
𝑒 −3 35
𝑃 𝑋=5 = = 0.1008.
5!
• What is the probability that a customer visits the chain no more than two times
in a 5-day period?
𝑃 𝑋 ≤2 =𝑃 𝑋 =0 +𝑃 𝑋 =1 +𝑃 𝑋 =2
= 0.0498 + 0.1494 + 0.2241
= 0.4233.
Case: Available Staff for Probable Customers
• What is the probability that a customer visits the chain at least three times in a
5-day period?
𝑃 𝑋 ≥3 =1−𝑃 𝑋 ≤2
= 1 − 0.4233
= 0.5767.
Reading Materials
• Sections: 5.1, 5.2, 5.3, 5.4, 5.5
• Exercise Problems: 12, 24, 25, 32, 33, 47, 48, 66, 67