probability mass function

Tutorial 3: Discrete Random
Variables 1
Yihan Zhang and Baoxiang Wang
Spring 2017
1
Discrete Random Variable
Random Variable 𝑋
Sample Space
Ξ©
π‘₯
Real Number Line
β€’ A random variable is discrete if its range is finite or countably infinite.
β€’ Each discrete random variable has an associated probability mass
function (PMF).
toss a coin Head
Tail
1
1
Probability
2
2
2
Example 1: Discrete random variables
Experiment
Random Variable Possible Values
Making 100 sales call
# sales
0,1,…,100
Inspect 70 radios
# defective
0,1,…,70
Answer 20 questions
# correct
0,1,…,20
Count cars at toll
between 11:00-1:00
# cars arriving
0,1,2,……
3
Example 2: Soccer Game
β€’ 2 games this weekend
β€’ 0.4 probability----not losing the first game
β€’ 0.7 probability----not losing the second game
β€’ equally likely to win or tie
β€’ independent
β€’ 2 points for a win, 1 for a tie and 0 for a loss.
β€’ Find the PMF of the number of points that the team earns in this
weekend.
4
Example 2: Soccer Game
𝑋1
2
1
0
P
0.2
0.2
0.6
2
0.35
0.07
0.07
0.21
1
0.35
0.07
0.07
0.21
0
0.3
0.06
0.06
0.18
𝑋2
𝑿 = π‘ΏπŸ + π‘ΏπŸ
𝑃
4
3
2
1
0
0.07
0.14
0.34
0.27
0.18
5
Compare: Continuous r.v. and PDFs
β€’ A random variable 𝑋 is called continuous if there is a function 𝑓𝑋 β‰₯ 0,
called the probability density function of 𝑋, or PDF, s.t.
𝑃(𝑋 ∈ 𝐡) =
for every subset 𝐡 βŠ† ℝ.
β€’ In particular, when 𝐡 = [π‘Ž, 𝑏],
𝑓𝑋 π‘₯ 𝑑π‘₯
𝐡
𝑏
𝑃(π‘Ž ≀ 𝑋 ≀ 𝑏) =
𝑓𝑋 π‘₯ 𝑑π‘₯
π‘Ž
is the area under the graph of PDF.
6
Continuous r.v. and PDFs
β€’ A random variable 𝑋 is called continuous if there is a function 𝑓𝑋 β‰₯ 0,
called the probability density function of 𝑋, or PDF, s.t.
𝑃(𝑋 ∈ 𝐡) =
for every subset 𝐡 βŠ† ℝ.
𝑓𝑋 π‘₯ 𝑑π‘₯
𝐡
7
Typical Discrete Random Variables
β€’ We review typical variables, and understand them using
examples
β€’ Binomial Random Variable
β€’ Poisson Random Variable
β€’ Poisson Limit Theorem
8
The Binomial Random Variable
β€’ We refer to 𝑋 as a binomial random variable with parameters 𝑛 and 𝑝
.
β€’ For π‘˜ = 0,1, … , 𝑛
β€’ 𝑝𝑋 (π‘˜) =
𝑛
π‘˜
π‘π‘˜ 1 βˆ’ 𝑝
π‘›βˆ’π‘˜
β€’ Mean: 𝑛𝑝, Mode: 𝑛 + 1 𝑝 , variance:𝑛𝑝(1 βˆ’ 𝑝)
β€’ Notice that
𝑛
π‘˜
=
𝑛
π‘›βˆ’π‘˜
, so 𝐡𝑖𝑛 π‘˜ 𝑛, 𝑝 = 𝐡𝑖𝑛 𝑛 βˆ’ π‘˜ 𝑛, 1 βˆ’ 𝑝 .
9
Example 3: Thinking Challenge
β€’ You are taking a multiple choice test with 20 questions. Each question
has 4 choices. The total score is 100 and each question has full score
5.
β€’ (a) Clueless on question 1, you decide to guess. What is the chance
you will get it right?
1
4
β€’ (b) If you guessed all 20 questions, what is the probability that you
get a score of exact 60?
12
8
20 1
3
12 4
4
10
Example 3: Thinking Challenge
β€’ You are taking a multiple choice test with 20 questions. Each question
has 4 choices. The total score is 100 and each question has full score
5.
β€’ (c) If you guessed all 20 questions, what is the probability that you get
a score no less than 80?
20
π‘˜=16
20
π‘˜
β€’ What is the result? Estimate?
1
4
π‘˜
3
4
20βˆ’π‘˜
11
The Poisson Random Variable
β€’ A Poisson random variable 𝑋 takes nonnegative integer values.
β€’ The PMF
β€’ 𝑝𝑋 π‘˜ =
π‘˜
πœ†
𝑒 βˆ’πœ† οΌŒπ‘˜
π‘˜!
= 0, 1, 2, … ,
β€’ Mean:πœ†, Mode:[πœ†], variance:πœ†
12
Poisson Limit Theorem
β€’ If 𝑛 β†’ ∞, 𝑝 β†’ 0 such that 𝑛𝑝 β†’ πœ†, then
π‘˜
𝑛 π‘˜
πœ†
𝐡𝑖𝑛 π‘˜ 𝑛, 𝑝 =
𝑝 (1 βˆ’ 𝑝)π‘›βˆ’π‘˜ β†’ 𝑒 βˆ’πœ†
= π‘ƒπ‘œπ‘–(π‘˜|πœ†)
π‘˜
π‘˜!
β€’
π‘˜ 1 20βˆ’π‘˜
1 π‘˜ 3 20βˆ’π‘˜
3
20
= 4π‘˜=0 π‘˜
4
4
4
4
π‘˜
3
15
4
4
βˆ’15
π‘ƒπ‘œπ‘–
π‘˜
20
×
=
𝑒
β‰ˆ 8.5664
π‘˜=0
π‘˜=0
4
π‘˜!
20
20
π‘˜=16 π‘˜
β€’β‰ˆ
× 10βˆ’4
β€’ very small!!
13
Example 4: Birthday
β€’ You go to a party with other 500 guests.
β€’ What is the probability that exactly one other guest has the same
birthday as you?
β€’ (exclude birthdays on Feb 29.)
500
1
β€’ By Poisson approximation, β‰ˆ
1
365
1
364
365
500
π‘ƒπ‘œπ‘–(1| )
365
499
=𝑒
βˆ’
500
365
500
365
β‰ˆ 0.3481.
14
Example 5: Phone calls
β€’ The number of calls coming per minute is a Poisson random variable
with mean 3.
β€’ (a) Find the probability that no calls come in a given 1 minute period.
𝑃 = π‘ƒπ‘œπ‘– 0 3 = 𝑒 βˆ’3
β€’ (b) Find the probability that at least two calls will arrive in a given two
minute period. (Assume independency.)
β€’ 𝑃 𝑋1 + 𝑋2 β‰₯ 2
= 1 βˆ’ 𝑃 𝑋1 + 𝑋2 < 2
= 1 βˆ’ 𝑃 𝑋1 = 𝑋2 = 0 βˆ’ 𝑃 𝑋1 = 0, 𝑋2 = 1 βˆ’ 𝑃 𝑋1 = 1, 𝑋2 = 0
= 1 βˆ’ 𝑒 βˆ’3 𝑒 βˆ’3 βˆ’ 𝑒 βˆ’3 𝑒 βˆ’3 3 βˆ’ 𝑒 βˆ’3 3𝑒 βˆ’3 = 1 βˆ’ 7𝑒 βˆ’6
15
Example 6: Chess match
β€’ Alice and Bob play a chess match
β€’ the first player to win a game wins the match
β€’ 0.4, the probability of Alice won
β€’ 0.3, the probability of Bob won
β€’ 0.3, the probability of a draw
β€’ independent
β€’ (a) What is the probability that Alice wins the match?
𝑃 = 0.4 + 0.3 × 0.4 +
0.32
1
4
× 0.4 + β‹― = 0.4 ×
=
1 βˆ’ 0.3 7
16
Example 6: Chess match
β€’ Alice and Bob play a chess match
β€’ the first player to win a game wins the match
β€’ 0.4, the probability of Alice won
β€’ 0.3, the probability of Bob won
β€’ 0.3, the probability of a draw
β€’ independent
β€’ (b) What is the PMF of the duration of the match?
𝑃 𝑋 = 1 = 0.7, P X = 2 = 0.3 × 0.7, 𝑃 𝑋 = 3 = 0.32 × 0.7
β€’ So 𝑋 follows geometric distribution with 𝑝 = 0.7 on positive integers
{1,2,3, … }.
17
Example 7: Functions of random variables
β€’ Let 𝑋 be a random variable that takes value from 0 to 9 with equal
probability 1/10.
β€’ (a) Find the PMF of the random variable π‘Œ = 𝑋 π‘šπ‘œπ‘‘(3).
X
0,3,6,9
1,4,7
2,5,8
Y
0
1
2
P
4
= 2/5
10
3/10
3/10
18
Example 7: Functions of random variables
β€’ Let 𝑋 be a random variable that takes value from 0 to 9 with equal
probability 1/10.
β€’ (b) Find the PMF of the random variable π‘Œ = 5 π‘šπ‘œπ‘‘(𝑋 + 1).
X
0
1
2
3
4
5
6
7
8
9
Y
0
1
2
1
0
5
5
5
5
5
Y
P
0
1
2
= 1/5
10
2
2
= 1/5
10
5
1/10
5
= 1/2
10
19