Notes Chapter 3
Notes Chapter 3
RANDOM VARIABLE
RV
Discrete Continuous
Probability Probability
distribution density
function function
Cumulative
distribution
function
Expected
value, E(X)
Variance
and SD
Introduction
Random variable: rule to assign a number to each outcome of a sample space
Symbol/ Notation – X, Y, Z
Value of RV – x, y, z
Example 1:
Two balls are drawn without replacement from a box containing 4 red balls and 3 black balls. Y
is the number of red balls and y is the value of random variable Y.
Sample space y
RR 2
RB 1
BR 1
BB 0
So, the possible value for Y are 0, 1 or 2.
Example 2:
A shop owner asked two of his customers whether the new tom yam menu is good. The responses
recorded Y for ‘Yes’ and N for ‘No’. Let X be the ‘number of Yes responses’ recorded. Find the
value of random variable X.
Solution:
S={YY, YN, NY, NN}
𝑃(𝑌𝑌) = 2 𝑃(𝑌𝑁) = 1 𝑃(𝑁𝑌) = 1 𝑃(𝑁𝑁) = 0
So, the possible value for X are 0, 1 or 2.
Exercise:
1. Let an experiment consist of three tosses of a fair coin.
a. List down the sample space.
b. Let X be the random variable that denotes the number of heads occurring in the
three tosses. Find the possible values for X.
2. There are 3 blue marble and 4 green marbles in a box. Two marbles were selected randomly
with replacement before the second marble was taken. Let Z be the random variable that
denoted the number of blue marble selected. Find the possible values for Z.
𝑥 0 1 2 3
𝑃(𝑋 = 𝑥) 1 3 3 1
8 8 8 8
Example 3:
A taxi driver randomly guesses at the answer on two true – false questions. Find the probability
distribution.
Solution: 1
C
Let X = number of correct answers 2
1 C
C = correct answer 2 1
2 W
W = wrong answer
1
1 1 1 1
2
𝑃(𝑋 = 0) = 𝑃(𝑊𝑊) = × = 2 W C
2 2 4
1 1 1
𝑃(𝑋 = 1) = 𝑃(𝑊𝐶) + 𝑃(𝐶𝑊) = × = 1
W
4 4 2 2
1 1 1
𝑃(𝑋 = 2) = 𝑃(𝐶𝐶) = × =
2 2 4
So, the probability distribution function is
𝑥 0 1 2
𝑃(𝑋 = 𝑥) 1 1 1
4 2 4
Example 4:
Determine whether the distribution is probability distribution function.
𝑥 0 1 2
𝑃(𝑋 = 𝑥) 2 3 2
7 7 7
Solution:
𝑃(0) + 𝑃(1) + 𝑃(2)
2 3 2
= + +
7 7 7
=1 Therefore, 𝑃(𝑋) is a probability distribution since ∑3𝑖=1 𝑃(𝑋𝑖 ) = 1.
Exercise:
𝑥 0 1 2 3 4
𝑃(𝑋 = 𝑥) 0.12 0.45 0.2 0.15 0.08
Use the probability distribution function above to calculate
a) 𝑃(𝑋 ≤ 2)
b) 𝑃(𝑋 ≥ 2)
c) 𝑃(𝑋 < 3)
d) 𝑃(𝑋 > 1)
e) 𝑃(1 ≤ 𝑋 ≤ 3)
f) 𝑃(1 < 𝑋 < 4)
g) 𝑃(1 ≤ 𝑋 < 4)
h) 𝑃(0 ≤ 𝑋 ≤ 2)
Solution:
a) 𝑃(𝑋 ≤ 2) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
= 0.12 + 0.45 + 0.2
= 0.77
b) 𝑃(𝑋 ≥ 2) = 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3) + 𝑃(𝑋 = 4)
= 0.2 + 0.15 + 0.08
= 0.43
c) 𝑃(𝑋 < 3) = 𝑃(𝑋 ≤ 2) = 0.77
d) 𝑃(𝑋 > 1) = 𝑃(𝑋 ≥ 2) = 0.43
e) 𝑃(1 ≤ 𝑋 ≤ 3) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.45 + 0.2 + 0.15
= 0.8
f) 𝑃(1 < 𝑋 < 4) = 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.2 + 0.15
= 0.35
g) 𝑃(1 ≤ 𝑋 < 4) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.45 + 0.2 + 0.15
= 0.8
h) 𝑃(0 < 𝑋 ≤ 2) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
= 0.45 + 0.2
= 0.65
Exercise:
1) Consider the following probability distribution function
𝑥 -1 0 1 2 3 4
𝑃(𝑋 = 𝑥) 0.25 𝑝 0.14 0.23 0.1 0.05
a) Calculate 𝑝
b) Find
i) 𝑃(𝑋 < 1) ii) 𝑃(𝑋 ≤ 3) iii) 𝑃(𝑋 ≥ 0) iv) 𝑃(−1 ≤ 𝑋 < 2)
v) 𝑃(1 < 𝑋 ≤ 4) vi) 𝑃(0 ≤ 𝑋 < 3)
Answer: a) 𝑝 = 0.23 b)i) 0.48 b)ii) 0.95 b) iii) 0.75 b)iv) 0.85
b)v) 0.38 b)vi) 0.6
𝐹 (𝑥 ) = 𝑃(𝑋 ≤ 𝑥 ) = ∑ 𝑃(𝑋 = 𝑥)
−∞
Example 6:
Let the random variable 𝑋 denotes the number of heads in 3 tosses of a fair coin.
a) Find the value of 𝐹(𝑥) for 𝑥 = 0, 1, 2 and 3.
b) Find 𝐹(1.5)
Solution:
𝑥 0 1 2 3
𝑃(𝑋 = 𝑥) 1 3 3 1
8 8 8 8
𝑥 0 1 2 3 0 ,𝑥 < 0
ۓ1
𝐹(𝑥) 1⁄ 4⁄ 7⁄ 1 ۖ ⁄8 , 0 ≤ 𝑥 < 1
8 8 8
𝐹(𝑥) = 4⁄8 , 1 ≤ 𝑥 < 2
۔
7
ۖ ⁄8 , 2 ≤ 𝑥 < 3
ە1 , 𝑥≥3
Example 7:
Suppose a random variable 𝑋 has the following cumulative distribution function
𝑥 1 2 3 4 5
𝐹(𝑥) 0.11 0.25 0.64 0.77 1
a) Find 𝑃(𝑋 = 3).
b) Find 𝑃(𝑋 ≥ 4)
c) Find the distribution of 𝑋.
11.4.21
Solution:
𝑥 1 2 3 4 5
𝑃(𝑋 = 𝑥) 0.11 0.14 0.39 0.13 0.23
Exercise:
1) Suppose a random variable 𝑌 has the following cumulative distribution function:
0 ,𝑦 < 3
ۓ0.01 , 3 ≤ 𝑦 < 4
ۖ
0.23 , 4 ≤ 𝑦 < 5
𝐹(𝑦) =
۔0.6 , 5 ≤ 𝑦 < 6
ۖ0.86 , 6 ≤ 𝑦 < 7
ە1 , 𝑦≥7
a) Find 𝑃(𝑌 = 7)
b) Find 𝑃(𝑌 ≥ 6)
c) Find 𝑃(𝑋 < 4)
d) Find the distribution of 𝑌
Answer: a) 0.14 b) 0.36 c) 0.01
2) For discrete random variable 𝑊, the cumulative distribution functions are as follow:
1 𝑤
𝐹(𝑤) = 1 − (1 − 𝑤) , 𝑤 = 1, 2, 3, 4
4
a) Find 𝐹(3)
b) Find 𝑃(𝑊 = 3)
c) Find 𝑃(2 ≤ 𝑤 ≤ 4)
Answer: a) 63/64 b) 15/64 c) 3 / 4
Expected value (MEAN), VARIANCE and Standard Deviation (SD)
Example 8:
Suppose that the number of handphone sold in a day has the following probability distribution:
𝑥 0 1 2 3 4 5
𝑃(𝑋 = 𝑥) 0.2 0.1 0.3 0.1 0.3 0.2
Based on this probability distribution, find the average of number of handphone sold in a day,
variance and standard deviations.
Solution:
𝑛
𝐸(𝑋) = ∑ 𝑥 𝑃(𝑋 = 𝑥)
𝑥=0
𝑆𝑑(𝑋) = √1.76
= 1.3266
Exercise:
1) Suppose that the probability distribution of 𝑍 is as follow:
𝑧 1 2 3 4 5
𝑃(𝑍 = 𝑧) 0.1 0.2 0.4 0.2 0.1
Find the mean, variance and standard deviation.
Answer: 3, 1.2 and 1.0955
𝑓(𝑥) ≥ 0, ∀𝑥
𝑎
𝑃(𝑋 = 𝑎) = 𝑃(𝑎 ≤ 𝑥 ≤ 𝑎) = ∫ 𝑓(𝑥) 𝑑𝑥
𝑎
∞
∫ 𝑓(𝑥) 𝑑𝑥 = 1
−∞
Example 9:
Show that the following function is a continuous random variable:
3𝑥 2 , 0 ≤ 𝑥 ≤ 1 ;
𝑓(𝑥) = {
0 , otherwise.
Solution:
∞ 0 1 ∞
2
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 0 𝑑𝑥 + ∫ 3𝑥 𝑑𝑥 + ∫ 0 𝑑𝑥
−∞ −∞ 0 1
= [𝑥 3 ]10
= 1−0=1
∞
Since ∫−∞ 𝑓(𝑥) 𝑑𝑥 = 1, then this function is continuous RV.
Example 10:
Let 𝑀 have the probability density function:
4𝑚3 , 0 ≤ 𝑚 ≤ 1
𝑓(𝑚) = {
0 , otherwise.
a) Find 𝑃(0.25 ≤ 𝑀 ≤ 0.75)
b) Find 𝑃(𝑀 > 0.5)
Solution:
a) 𝑃(0.25 ≤ 𝑀 ≤ 0.75)
0.75
=∫ 4𝑚3 𝑑𝑚
0.25
= [𝑚4 ]0.75
0.25
= (0.75)4
− (0.25)4
= 0.3125
b) 𝑃(𝑀 > 0.5)
1
= ∫ 4𝑚3 𝑑𝑚
0.5
= [𝑚4 ]10.5
= 14 − (0.5)4 = 15⁄16
Exercise:
The total number of hours, measured in units of 10, that a student spends on reading book over
a period of one week is a continuous random variable 𝑋 with density function,
𝑥2 , 0<𝑥<1
𝑓(𝑥) = { 𝑘 − 𝑥 , 1 ≤ 𝑥 < 2
0 , elsewhere.
a) Find the value of 𝑘.
b) Find:
i) 𝑃(𝑋 < 1.5)
ii) 𝑃(𝑋 > 1.5)
iii) 𝑃(1 ≤ 𝑋 < 1.8)
Answer: a) 𝑘 = 13⁄6 b) i) 0.792 b)ii) 0.208 b)iii) 0.6133
∞
𝐸(𝑋) = ∫ 𝑥 𝑓(𝑥) 𝑑𝑥 Mean
−∞
Example 11:
Given 𝑥 is continuous random variable with probability density function as follow:
𝑥 , 0≤𝑥<1
𝑓(𝑥) = {2 − 𝑥 , 1 ≤ 𝑥 < 2
0 , others.
Find:
a) 𝐸(𝑋)
b) 𝑉𝑎𝑟 (𝑋)
c) 𝐸(2𝑋 + 3)
d) 𝑉𝑎𝑟 (3𝑋 − 1)
Solution:
1 2
a) 𝐸(𝑋) = ∫0 𝑥(𝑥) 𝑑𝑥 + ∫1 𝑥(2 − 𝑥) 𝑑𝑥
1 2
= ∫ 𝑥 𝑑𝑥 + ∫ 2𝑥 − 𝑥 2 𝑑𝑥
2
0 1
3 1 2
𝑥 2
𝑥3
= [ ] + [𝑥 − ]
3 0 3 1
1 4 2
= +( − )=1
3 3 3
1 2 2
b) 𝐸(𝑋 = ∫0 𝑥 (𝑥) 𝑑𝑥 + ∫1 𝑥 2 (2 − 𝑥) 𝑑𝑥
2)
1 2
= ∫ 𝑥 𝑑𝑥 + ∫ 2𝑥 2 − 𝑥 3 𝑑𝑥
3
0 1
1 2
𝑥4 2𝑥 3 𝑥 4
=[ ] +[ − ]
4 0 3 4 1
1 4 5 7
= +( − )=
4 3 12 6
∞
𝐹 (𝑋) = 𝑃(𝑋 ≤ 𝑥 ) = ∫ 𝑓(𝑥 ) 𝑑𝑥
−∞
𝑃(𝑋 ≤ 𝑎) = 𝐹(𝑎)
Example 12:
The following is cumulative distribution for continuous random variable 𝑇:
0 , 𝑡<0
1
𝐹(𝑡) = { (𝑡 3 + 2𝑡) , 0 ≤ 𝑡 ≤ 4
72
1 , 𝑡≥4
Find:
1) 𝑃(1 ≤ 𝑇 ≤ 2)
2) 𝑃(𝑇 > 3)
3) 𝑃(2 < 𝑇 < 4)
Solution:
1 1
a) 𝑃(1 ≤ 𝑇 ≤ 2) = 72 (23 + 2(2)) − 72 (13 + 2(1))
1
=
8
b) 𝑃(𝑇 > 3) = 1 − 𝐹(3)
1 3
= 1− (3 + 2(3))
72
13
=
24
c) 𝑃(2 < 𝑇 < 4) = 𝐹(4) − 𝐹(2)
1 3 1
= (4 + 2(4)) − (23 + 2(2))
72 72
5
=
6
Exercise:
1) Using the same problem as in Example 12, find 𝑃(𝑇 > 1.5).
Answer: 0.9115