06 Discrete Random Variables (Moodle Slides)
06 Discrete Random Variables (Moodle Slides)
Must
Outcomes
be familiar with
Descriptive statistics
Probability
Probability Discrete random variables
Outcomes
Know the definitions
S Prob
In words:
× ½ (HHH) ⅛
• X assigns a
real number × ½ (HHT) ⅛
to the ½
outcomes in ½ × ½ (HTH) ⅛
the sample
½
½ (THH) ⅛
space
• Random
× ½ (HTT) ⅛
× ½
variable ⇒ ½ ½ (THT) ⅛
Population
× ½
• Discrete: (TTH) ⅛
countable
½
number of
½ (TTT) ⅛
outcomes
Probability Discrete random variables
S Prob
In words:
(HHH) ⅛
• X assigns a
real number (HHT) ⅛
to the
outcomes in (HTH) ⅛
the sample (THH) ⅛
space
• Random (HTT) ⅛
variable ⇒
(THT) ⅛
Population
• Discrete: (TTH) ⅛
countable
number of (TTT) ⅛
outcomes
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable from sample space
X:Ω→ℝ
X=x P(X = x) S Prob
In words:
0 ⅛ (HHH) ⅛
• X assigns a
real number 1 ⅜ (HHT) ⅛
to the 2 ⅜
outcomes in (HTH) ⅛
the sample 3 ⅛ (THH) ⅛
space
• Random (HTT) ⅛
variable ⇒
(THT) ⅛
Population
• Discrete: (TTH) ⅛
countable
number of (TTT) ⅛
outcomes
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable Now we have numbers for calculations
X:Ω→ℝ
X=x P(X = x)
In words:
0 ⅛
• X assigns a
real number 1 ⅜
to the 2 ⅜
outcomes in
the sample 3 ⅛
space
• Random
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable
X:Ω→ℝ Like histogram
X=x P(X = x) P(X ≤ x) Probability mass function
In words: 3/8
0 ⅛ ⅛
• X assigns a
real number 1 ⅜ ½
to the 2 ⅜ ⅞ 1/4
Probability
outcomes in
the sample 3 ⅛ 1
space
1/8
• Random Probability
variable ⇒ Mass
Population Function, 0
• Discrete: i.e., pmf 0 1 2 3
countable Number of tails
number of Like relative
outcomes frequencies
for samples
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable
X:Ω→ℝ
X=x P(X = x) P(X ≤ x)
In words:
0 ⅛ ⅛
• X assigns a
real number 1 ⅜ ½
to the 2 ⅜ ⅞
outcomes in
the sample 3 ⅛ 1
space
• Random Probability Cumulative
variable ⇒ Mass Distribution
Population Function, Function,
• Discrete: i.e., pmf i.e., CDF
countable
number of Like relative Like ogive for
outcomes frequencies samples
for samples
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable
X:Ω→ℝ
X=x P(X = x) P(X ≤ x)
In words:
0 ⅛ ⅛ 𝑃 𝑋 3
• X assigns a
real number 1 ⅜ ½
to the 2 ⅜ ⅞
𝑃 𝑋 2
outcomes in
the sample 3 ⅛ 1 𝑃 𝑋 2
𝑃 𝑋 3
space
𝑃 𝑋 1
• Random Probability Cumulative 𝑃 𝑋 1
variable ⇒ Mass Distribution
Population Function, Function, 𝑃 𝑋 0 𝑃 𝑋 0
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
Random variable
X:Ω→ℝ
X=x 𝑝 𝑥 𝐹 𝑥
In words:
0 ⅛ ⅛ 𝑝 3
• X assigns a
real number 1 ⅜ ½
to the 2 ⅜ ⅞
𝑝 2
outcomes in
the sample 3 ⅛ 1 𝐹 2
𝐹 3
space
𝑝 1
• Random Probability Cumulative 𝐹 1
variable ⇒ Mass Distribution
Population Function, Function,
𝑝 0 𝐹 0
Definition In general
These functions can be presented as a table or as an equation
X:Ω→ℝ
𝑋 𝑥 𝑃 𝑋 𝑥 𝑝 𝑥 𝑃 𝑋 𝑥 𝐹 𝑥
Properties of 𝑃 𝑥
In words:
𝑥 𝑝 𝑥 𝑝 𝑥
• X assigns a • 0 𝑃 𝑥 1 when
real number 𝑥 𝑝 𝑥 𝑝 𝑥 𝑝 𝑥
to the 𝑥∈𝑋
𝑥 𝑝 𝑥 𝑝 𝑥 𝑝 𝑥 𝑝 𝑥
outcomes in • 1 ∑∀ 𝑃 𝑥
the sample ⫶ ⫶ ⫶
space Properties of 𝐹 𝑥
• Random Probability Cumulative • 𝑃 𝑋 𝑠𝑚𝑎𝑙𝑙𝑒𝑠𝑡 𝑥 0
variable ⇒ Mass Distribution
Population Function, Function, • 𝑃 𝑋 𝑙𝑎𝑟𝑔𝑒𝑠𝑡 𝑥 1
• Discrete: i.e., pmf i.e., CDF • 𝑃 𝑋 𝑥 𝑃 𝑋
countable
number of Like relative Like ogive for 𝑥 𝑃 𝑋 𝑥 1
outcomes frequencies samples
for samples
Probability Discrete random variables
X:Ω→ℝ
𝑋 𝑥 𝑃 𝑋 𝑥
Mean = 𝜇 𝐸𝑋 ∑∀ 𝑥 𝑝 𝑥
In words:
𝑥 𝑝 𝑥
• X assigns a
real number 𝑥 𝑝 𝑥 Population parameter / random variable parameter
to the 𝑥 𝑝 𝑥
outcomes in Variance = 𝑉 𝑋 𝜎 𝐸 𝑋 𝜇
the sample ⫶ ⫶
space
Variance = 𝑉 𝑋 𝜎 𝐸𝑋 𝜇
• Random Variance = 𝑉 𝑋 𝜎 ∑∀ 𝑥 𝑝 𝑥 𝜇
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
X:Ω→ℝ
Mean = 𝜇 𝐸𝑋 ∑∀ 𝑥 𝑝 𝑥
In words:
• X assigns a
real number
to the
outcomes in X=x P(X = x) 𝑥𝑝 𝑥
the sample
space 0 ⅛ 0× ⁄ = 0
• Random 1 ⅜ 1× ⁄ = ⁄
variable ⇒
Population 2 ⅜ 2× ⁄ = ⁄
• Discrete: 3 ⅛ 3× ⁄ = ⁄
countable
number of 𝐸𝑋 = ⁄ = 1.5 tails are expected when flipping a fair
outcomes coin three times
Probability Discrete random variables
Definition E.g.: Consider flipping a fair coin three times… and let X = number of tails
X:Ω→ℝ
Variance = 𝑉 𝑋 𝜎 𝐸 𝑋 𝜇
In words: Variance = 𝑉 𝑋 𝜎 𝐸𝑋 𝜇
• X assigns a
real number
Variance = 𝑉 𝑋 𝜎 ∑∀ 𝑥 𝑝 𝑥 𝜇
to the
outcomes in X=x P(X = x) 𝑥 𝑝 𝑥 𝑥𝑝 𝑥 𝜎
the sample
space 0 ⅛ 0 × ⁄ = 0 0× ⁄ = 0 𝜎
• Random 1 ⅜ 1 × ⁄ = ⁄ 1× ⁄ = ⁄ 𝜎
variable ⇒
Population 2 ⅜ 2 × ⁄ = ⁄ 2× ⁄ = ⁄
𝜎
• Discrete: 3 ⅛ 3 × ⁄ = ⁄ 3× ⁄ = ⁄
countable
number of 𝐸𝑋 = ⁄ 𝐸𝑋 = ⁄
outcomes
Probability Discrete random variables – Linear transformations
Definition E.g.: Consider the following 5 measurements: 𝑋: 76, 72, 65, 70, 82
Definition E.g.: Consider the following 5 measurements: 𝑋: 76, 72, 65, 70, 82
Definition In general:
In words: b. Determine 𝑃 𝑋 2 .
• X assigns a
real number
to the
outcomes in c. Determine 𝑃 1 𝑋 3 .
the sample
space
• Random d. Calculate 𝐸 𝑋 , 𝑉 𝑋 , and the standard deviation of 𝑋.
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
In words: b. Determine 𝑃 𝑋 2 .
• X assigns a
real number
to the
outcomes in c. Determine 𝑃 1 𝑋 3 .
the sample
space
• Random d. Calculate 𝐸 𝑋 , 𝑉 𝑋 , and the standard deviation of 𝑋.
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
In words: b. Determine 𝑃 𝑋 2 .
• X assigns a
real number
to the
outcomes in c. Determine 𝑃 1 𝑋 3 .
the sample
space
• Random d. Calculate 𝐸 𝑋 , 𝑉 𝑋 , and the standard deviation of 𝑋.
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
In words:
• X assigns a
real number
to the
outcomes in
the sample
space
• Random
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
In words:
• X assigns a
real number
to the
outcomes in
the sample
space
• Random
variable ⇒
Population
• Discrete:
countable
number of
outcomes
Probability Discrete random variables
X:Ω→ℝ
Example: Let the random variable X be the number of days that a certain patient needs to be in the hospital.
and R1000 for each day after the first two days, what
Example: Let the random variable X be the number of days that a certain patient needs to be in the hospital.
and R1000 for each day after the first two days, what
Must
Outcomes
be familiar with
Counting techniques: Combinations
Outcomes
Know the definitions
Examples…
𝐸𝑋 𝑛𝑝 2.5 𝐸𝑋 𝑛𝑝 7.5
Small 𝑛 Small 𝑛 𝑀𝑜𝑑𝑒 8
𝑀𝑜𝑑𝑒 2
𝑀𝑜𝑑𝑒 𝑀𝑒𝑎𝑛 Small 𝑝 Large 𝑝 𝑀𝑒𝑎𝑛 𝑀𝑜𝑑𝑒
⇒ 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑙𝑦 ⇒ Binomial ⇒ Binomial ⇒ 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒𝑙𝑦
𝑠𝑘𝑒𝑤𝑒𝑑 positively negatively 𝑠𝑘𝑒𝑤𝑒𝑑
skewed skewed
𝑛 30 is considered large
𝑃 𝑋 2 0.25 1 0.25
𝑃 𝑋 2 0.2637
Probability Special discrete random variables – Binomial
E.g.1: If the number of independent trials is 𝑛 5, the probability of a success remains 𝑝 0.25 for every trial,
and 𝑋 # of successes, then what is 𝑃 𝑋 2 ?
𝑋 2
𝑛 5 𝑋 2
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 pmf
Probability Special discrete random variables – Binomial
E.g.1: If the number of independent trials is 𝑛 5, the probability of a success remains 𝑝 0.25 for every trial,
and 𝑋 # of successes, then what is 𝑃 𝑋 2 ?
𝑃 𝑋 15 0.30 1 0.30
𝑃 𝑋 15 0.00004
Probability Special discrete random variables – Binomial
E.g.2: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
𝑃 𝑋 15 0.30 1 0.30
𝑃 𝑋 15 0.00004
𝑋 15
𝑛 20 𝑋 15
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 pmf
Probability Special discrete random variables – Binomial
E.g.2: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
𝑃 𝑋 15 0.30 1 0.30
𝑃 𝑋 15 0.00004
𝐸𝑋 𝑛𝑝 20 0.30 6
𝑉 𝑋 𝑛𝑝𝑞 20 0.30 0.70 4.2
Probability Special discrete random variables – Binomial
E.g.3: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
CDF
table
𝑛 𝑥
parameter value
𝑃 𝑋 15 𝑃 𝑋 0 𝑃 𝑋 1 p parameter
𝑃 𝑋 15 𝑃 𝑋 2 𝑃 𝑋 3
𝑃 𝑋 15 𝑃 𝑋 4 𝑃 𝑋 5
𝑃 𝑋 15 ⋯ CDF
values
𝑃 𝑋 15 𝑃 𝑋 14 𝑃 𝑋 15
𝑃 𝑋 15 1.0000
From Binomial table
Probability Special discrete random variables – Binomial
E.g.3: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
𝑃 𝑋 15 𝑃 𝑋 0 𝑃 𝑋 1
𝑃 𝑋 15 𝑃 𝑋 2 𝑃 𝑋 3
𝑃 𝑋 15 𝑃 𝑋 4 𝑃 𝑋 5
𝑃 𝑋 15 ⋯
𝑃 𝑋 15 𝑃 𝑋 14 𝑃 𝑋 15
𝑃 𝑋 15 1.0000
From Binomial table
Probability Special discrete random variables – Binomial
E.g.3: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
𝑃 𝑋 15 1.0000
From Binomial table
𝑋 15
𝑛 20 𝑋 15
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝 CDF
Probability Special discrete random variables – Binomial
E.g.4: If the number of independent trials is 𝑛 20, the probability of a success remains 𝑝 0.30 for every
trial, and 𝑋 # of successes, then what is 𝑃 𝑋 15 ?
𝑃 𝑋 15 1.0000
From Binomial table
𝑃 𝑋 15 1 𝑃 𝑋 15
𝑃 𝑋 15 1 1.0000
𝑃 𝑋 15 0
Probability Special discrete random variables – Binomial
E.g.5: You guess the answers to a 10 question, multiple choice test, where each question has two options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
Probability Special discrete random variables – Binomial
E.g.5: You guess the answers to a 10 question, multiple choice test, where each question has two options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
𝑃 𝑋 5 ⁄ 1 ⁄
𝑃 𝑋 5 0.2461
Probability Special discrete random variables – Binomial
E.g.5: You guess the answers to a 10 question, multiple choice test, where each question has two options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
𝑋 5
𝑋 5
𝑛 10 pmf
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝
Probability Special discrete random variables – Binomial
E.g.5: You guess the answers to a 10 question, multiple choice test, where each question has two options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
𝑃 𝑋 5 𝑃 𝑋 0 𝑃 𝑋 1
𝑃 𝑋 5 𝑃 𝑋 2 𝑃 𝑋 3
𝑃 𝑋 5 𝑃 𝑋 4
𝑃 𝑋 4 0.3770
𝑋 4
𝑋 4 𝑛 10 CDF
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝
Probability Special discrete random variables – Binomial
E.g.7: You guess the answers to a 10 question, multiple choice test, where each question has two options and
only one option is correct. What is the probability of passing the test?
𝑃 𝑋 4 0.3770
𝑃 𝑋 5 1 𝑃 𝑋 4
𝑃 𝑋 5 1 0.3770
𝑃 𝑋 5 0.6230
Probability Special discrete random variables – Binomial
E.g.8: You guess the answers to a 10 question, multiple choice test, where each question have five options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
𝑋 5
𝑋 5
𝑛 10 pmf
𝑃 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 𝑝
Probability Special discrete random variables – Binomial
E.g.8: You guess the answers to a 10 question, multiple choice test, where each question have five options and
only one option is correct. What is the probability of scoring exactly 50% for the test?
Must
Outcomes
be familiar with
Discrete random variables
Binomial distribution
Probability Special discrete random variables – Poisson
Outcomes
Know the definitions
Examples…
counting events,
𝐸𝑋 𝑉 𝑋 λ
Probability Special discrete random variables – Poisson
average number of events per interval = 10/7 ≈ 1.4 = λ
x x x x x xx xx x
0 1 2 3 4 5 6 7 time
in
hours
(7) Disjoint intervals
Fixed size intervals
Probability Special discrete random variables – Poisson
average number of events per interval = 10/7 ≈ 1.4 = λ
Poisson (λ≈1.4)
4
3
3
intervals
Freq of
2
2
1 1
1
0
0 1 2 3
Events per interval
Probability Special discrete random variables – Poisson
average number of events per area = 10/7 ≈ 1.4 = λ
x x x
x xx x x
x
x
0 1 2 3 4 5 6 7 area
Poisson (λ≈1.4)
4
3
3
Freq of
2
areas
2
1 1
1
0
0 1 2 3
Events per area
Probability Special discrete random variables – Poisson
Effect of parameter λ
𝑃 𝑋 𝑥 for 𝑥 0,1,2,…
!
Probability Special discrete random variables – Poisson
E.g.1: If X is a Poisson random variable with an average rate of events 𝜆 5, then what is 𝑃 𝑋 2 ?
𝑃 𝑋 2
!
𝑃 𝑋 2 0.0842
𝑋 2
𝜆 5 𝑋 2
pmf
Probability Special discrete random variables – Poisson
E.g.2: If X is a Poisson random variable with an average rate of events 𝜆 3.5, then what is 𝑃 𝑋 2 ?
𝑃 𝑋 𝑥
!
𝑃 𝑋 2 0.0842
Probability Special discrete random variables – Poisson
E.g.2: If X is a Poisson random variable with an average rate of events 𝜆 3.5, then what is 𝑃 𝑋 2 ?
. .
𝑃 𝑋 2
!
𝑃 𝑋 2 0.1850
𝑋 2
𝜆 3.5 𝑋 2
pmf
Probability Special discrete random variables – Poisson
E.g.3: If X is a Poisson random variable with an average rate of events 𝜆 15, then what is 𝑃 𝑋 10 ?
𝑃 𝑋 𝑥
!
𝑃 𝑋 2 0.1850
Probability Special discrete random variables – Poisson
E.g.3: If X is a Poisson random variable with an average rate of events 𝜆 15, then what is 𝑃 𝑋 10 ?
𝑃 𝑋 10 𝑃 𝑋 0 𝑃 𝑋 1
𝑃 𝑋 10 𝑃 𝑋 2 𝑃 𝑋 3
𝑃 𝑋 10 ⋯ 𝑃 𝑋 10
Probability Special discrete random variables – Poisson
E.g.3: If X is a Poisson random variable with an average rate of events 𝜆 15, then what is 𝑃 𝑋 10 ?
CDF
table
𝑃 𝑋 10 𝑃 𝑋 0 𝑃 𝑋 1
Different
𝑃 𝑋 10 𝑃 𝑋 2 𝑃 𝑋 3 λ
values
𝑃 𝑋 10 ⋯ 𝑃 𝑋 10 Different
𝑥 Cumulative
values probabilities
Probability Special discrete random variables – Poisson
E.g.3: If X is a Poisson random variable with an average rate of events 𝜆 15, then what is 𝑃 𝑋 10 ?
Different
λ
values
Different Cumulative
𝑃 𝑋 10 𝑃 𝑋 0 𝑃 𝑋 1 𝑥 probabilities
𝑃 𝑋 10 𝑃 𝑋 2 𝑃 𝑋 3 values
𝑃 𝑋 10 ⋯ 𝑃 𝑋 10
Probability Special discrete random variables – Poisson
E.g.3: If X is a Poisson random variable with an average rate of events 𝜆 15, then what is 𝑃 𝑋 10 ?
𝑃 𝑋 10 𝑃 𝑋 0 𝑃 𝑋 1
𝑃 𝑋 10 𝑃 𝑋 2 𝑃 𝑋 3
𝑃 𝑋 10 ⋯ 𝑃 𝑋 10
𝑃 𝑋 10 0.118
𝑋 10
𝜆 15 𝑋 10
CDF
Probability Special discrete random variables – Poisson
E.g.1: The average number of clients arriving per hour at a certain bank is 12. Let X = # clients arriving per
a) 𝑃 𝑋 4 counting events,
b) 𝑃 𝑋 11
events occur in fixed time interval /area /volume,
c) 𝑃 𝑋 11
d) 𝑃 𝑋 11 time intervals /areas /volumes are non-overlapping,
E.g.1: The average number of clients arriving per hour at a certain bank is 12. Let X = # clients arriving per
a) 𝑃 𝑋 4
b) 𝑃 𝑋 11
c) 𝑃 𝑋 11
d) 𝑃 𝑋 11
Probability Special discrete random variables – Poisson
E.g.1: The average number of clients arriving per hour at a certain bank is 12. Let X = # clients arriving per
a) 𝑃 𝑋 4
b) 𝑃 𝑋 11
c) 𝑃 𝑋 11
d) 𝑃 𝑋 11
Probability Special discrete random variables – Poisson estimation to Binomial
𝑋~𝑏 𝑛, 𝑝 E.g.: An insurance company has 1,000,000 clients. Each client has a 0.001% chance of
𝐸𝑋 𝑛 𝑝 dying of a certain disease in any given year. The disease is not contagious but genetic.
if For each client that dies of this disease the company has to pay R100,000.
LARGE 𝑛 and
SMALL 𝑝
then a) What is the probability of 2 clients dying in any given year?
𝑋 ⩪ 𝑃𝑜𝑖 𝑛 𝑝
𝐸𝑋 λ
𝑛 𝑝
b) What is the expected payout for any given year?