Chapter 2 Concept of Random Variables
Chapter 2 Concept of Random Variables
• Expectation
– Mean and variance
– Expectation of functions of random variables
– Properties of expectation
• Chebychev’s Inequality
• Therefore
𝐴𝐴1 = {𝐻𝐻𝐻𝐻} is equivalent to 𝐵𝐵1 = {2}
𝐴𝐴2 = {𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵2 = {1}
𝐴𝐴3 = {𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵3 = {0}
𝐴𝐴4 = {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵4 = {2, 1}
Number of heads, 𝑥𝑥 0 1 2
Pr(𝑋𝑋 = 𝑥𝑥) 1/4 1/2 1/4
𝑥𝑥 8 9 10 11 12
Pr(𝑋𝑋 = 𝑥𝑥) 5/36 4/36 3/36 2/36 1/36
• That is, the possible values of 𝑋𝑋 may be listed as 𝑥𝑥1 , 𝑥𝑥2, 𝑥𝑥3, ⋯.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-20
2.2.2 Probability Function
• For a discrete random variable, each value of 𝑋𝑋 has a certain
probability 𝑓𝑓(𝑥𝑥).
(2) ∑∞
𝑖𝑖=1 𝑓𝑓(𝑥𝑥𝑖𝑖 ) = 1.
𝑥𝑥 0 1 2
𝑓𝑓 𝑥𝑥 = Pr(𝑋𝑋 = 𝑥𝑥) 1/4 1/2 1/4
f (x )
½
¼
x
0 1 2
½
¼
x
0 1 2
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-27
Example 2
• Consider throwing a pair of fair dice.
• Let X be the sum of the two dice. Then we have
𝑥𝑥 2 3 4 5 6 7
Pr(𝑋𝑋 = 𝑥𝑥) 1/36 2/36 3/36 4/36 5/36 6/36
𝑥𝑥 8 9 10 11 12
Pr(𝑋𝑋 = 𝑥𝑥) 5/36 4/36 3/36 2/36 1/36
𝑦𝑦 1 2 3 4
𝑓𝑓(𝑦𝑦) 0.4 0.3 0.2 0.1
Example
• Consider selecting at random a student who is among the
35,000 registered for the current semester in NUS.
• Let X = the number of modules for which the selected
student is registered and suppose that X has the
probability function.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-39
Another View of Probability Function (Continued)
𝑥𝑥 1 2 3 4 5 6 7
𝑓𝑓(𝑥𝑥) 0.01 0.03 0.13 0.25 0.39 0.17 0.02
𝑑𝑑
Pr 𝑐𝑐 ≤ 𝑋𝑋 ≤ 𝑑𝑑 = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
𝑐𝑐
(b)
1/2
1
Pr 𝑋𝑋 ≤ = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
2 0
1/2
2 1/2
=� 2𝑥𝑥 𝑑𝑑𝑑𝑑 = 𝑥𝑥 0
0
1
=
4
= � Pr(𝑋𝑋 = 𝑡𝑡)
𝑡𝑡≤𝑥𝑥
• The c.d.f. of a discrete random
variable is a step function.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-60
CDF for Discrete Random Variables (Continued)
Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = Pr(𝑋𝑋 = 𝑎𝑎 or 𝑎𝑎 + 1 or ⋯ or 𝑏𝑏)
Also Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = 𝐹𝐹 𝑏𝑏 − 𝐹𝐹(𝑎𝑎 − 1)
• Taking 𝑎𝑎 = 𝑏𝑏 yields
Pr 𝑋𝑋 = 𝑎𝑎 = 𝐹𝐹 𝑎𝑎 − 𝐹𝐹 𝑎𝑎 − 1 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-62
2.4.2 CDF for Continuous Random Variables
• If X is a continuous random
variable, then
𝑥𝑥
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓 𝑡𝑡 𝑑𝑑𝑑𝑑
−∞
• Also,
Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = Pr 𝑎𝑎 < 𝑋𝑋 ≤ 𝑏𝑏
= 𝐹𝐹(𝑏𝑏) – 𝐹𝐹(𝑎𝑎).
• 0 ≤ 𝐹𝐹(𝑥𝑥) ≤ 1.
𝑥𝑥−1
1 − 𝑝𝑝 𝑝𝑝, if 𝑥𝑥 = 1, 2, 3, ⋯ ;
𝑓𝑓 𝑥𝑥 = �
0, otherwise.
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓(𝑡𝑡) = � 1 − 𝑝𝑝 𝑡𝑡−1 𝑝𝑝
𝑡𝑡≤𝑥𝑥 𝑡𝑡=1
𝑥𝑥−1
𝑠𝑠
= 𝑝𝑝 � 1 − 𝑝𝑝 , where 𝑠𝑠 = 𝑡𝑡 − 1
𝑠𝑠=0
𝑝𝑝 1 − 1 − 𝑝𝑝 𝑥𝑥
=
1 − 1 − 𝑝𝑝
= 1 − 1 − 𝑝𝑝 𝑥𝑥 , for 𝑥𝑥 = 1, 2, 3, ⋯
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-67
Example 1 (Continued)
Remark
• Since 𝑓𝑓 𝑥𝑥 = 0 between positive integers, hence 𝐹𝐹(𝑥𝑥) is
constant between positive integers and
0, if 𝑥𝑥 < 1,
𝐹𝐹 𝑥𝑥 = �
1 − 1 − 𝑝𝑝 𝑥𝑥 , if 𝑥𝑥 ≥ 1
where [𝑥𝑥] is the largest integer ≤ 𝑥𝑥.
(e.g., 2.7 = 2, 3 = 3).
(c)
𝐹𝐹 0 = Pr 𝑋𝑋 ≤ 0 = Pr 𝑋𝑋 = 0 = 0.3,
𝐹𝐹 1 = Pr 𝑋𝑋 ≤ 1 = Pr 𝑋𝑋 = 0 or 1
= Pr 𝑋𝑋 = 0 + Pr 𝑋𝑋 = 1
= 0.3 + 0.6 = 0.9,
𝐹𝐹 2 = Pr 𝑋𝑋 ≤ 2 = 1.
(c)
The c.d.f. is thus given by
0, if 𝑥𝑥 < 0,
0.3, if 0 ≤ 𝑥𝑥 < 1,
𝐹𝐹 𝑥𝑥 =
0.9, if 1 ≤ 𝑥𝑥 < 2,
1, if 2 ≤ 𝑥𝑥.
𝑥𝑥 −𝑥𝑥 2 / 2𝜃𝜃2
𝑒𝑒 , for 𝑥𝑥 > 0,
𝑓𝑓 𝑥𝑥; 𝜃𝜃 = �𝜃𝜃 2
0, otherwise.
(b)
200
Pr 𝑋𝑋 ≤ 200; 𝜃𝜃 = 100 = � 𝑓𝑓 𝑥𝑥; 𝜃𝜃 𝑑𝑑𝑑𝑑
−∞
200 𝑥𝑥 2
𝑥𝑥 −
=� 𝑒𝑒 2 100 2 𝑑𝑑𝑑𝑑
0 1002
200
𝑥𝑥 2
− 20000
= −𝑒𝑒 0 = −𝑒𝑒 −2 + 𝑒𝑒 0
= −0.1353 + 1 = 0.8647.
(b)
• Pr 𝑋𝑋 < 200 = Pr(𝑋𝑋 ≤ 200) = 0.8647 since X is a
continuous random variable.
(d)
Pr 100 ≤ 𝑋𝑋 ≤ 200 = 𝐹𝐹 200 − 𝐹𝐹 100
= 1 − exp − 200 2 /20000
− 1 − exp − 100 2 /20000
= 𝑒𝑒 −1/2 − 𝑒𝑒 −2
= 0.4712.
(d)
Alternatively,
200 𝑥𝑥 2
𝑥𝑥 −
Pr 100 ≤ 𝑋𝑋 ≤ 200 = � 𝑒𝑒 2 100 2 𝑑𝑑𝑑𝑑
100 1002
200
𝑥𝑥 2
− 20000
= −𝑒𝑒 100 = 0.4712.
Definition 2.7b
• If X is a continuous random variable with probability
density function 𝑓𝑓𝑋𝑋 (𝑥𝑥), the mean of X is defined by
∞
𝜇𝜇𝑋𝑋 = 𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 .
−∞
2. In the discrete case, if 𝑓𝑓𝑋𝑋 𝑥𝑥 = 1/𝑁𝑁 for each of the N values of 𝑥𝑥,
hence the mean,
1
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥𝑖𝑖 𝑓𝑓(𝑥𝑥𝑖𝑖 ) = � 𝑥𝑥𝑖𝑖 ,
𝑁𝑁
𝑖𝑖 𝑖𝑖
becomes the average of the N items.
Alternate Solution,
• Let Y denote the amount that one gains when rolling a die.
• Then 𝑌𝑌 = 𝑖𝑖 − 𝑐𝑐, where 𝑖𝑖 = 1, 2, ⋯ , 6
• Then clearly Pr 𝑌𝑌 = 1 − 𝑐𝑐 = ⋯ = Pr 𝑌𝑌 = 6 − 𝑐𝑐 = 1/6.
1
• 𝐸𝐸 𝑌𝑌 = 1 − 𝑐𝑐 + ⋯ + 6 − 𝑐𝑐 = 3.5 − 𝑐𝑐.
6
• To be a fair game, 𝐸𝐸(𝑌𝑌) = 0, and hence the admission fee, c,
satisfies
3.5 − 𝑐𝑐 = 0 or 𝑐𝑐 = 3.5
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-95
Example 3
• A private pilot wishes to insure his airline for 1,000,000.
• The insurance company estimates that a total loss may
occur with probability 0.0002, a 50% loss with probability
0.001, and a 25% loss with probability 0.01, and a 10% loss
with probability 0.01.
• Ignoring all other partial losses, what premium should the
insurance company charge each year to realize an average
profit of 5,000?
3 2 ,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2 1 − 𝑥𝑥 for 0 < 𝑥𝑥 < 1,
0, otherwise.
Find E(X).
Remarks:
(a) 𝑉𝑉(𝑋𝑋) ≥ 0.
(b) 𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋2 − 𝐸𝐸 𝑋𝑋 2.
2. 𝑔𝑔 𝑥𝑥 = 𝑥𝑥 𝑘𝑘 .
𝑥𝑥 –1 0 1 2
𝑓𝑓𝑋𝑋 (𝑥𝑥) 1/8 2/8 1/8 4/8
(a) (Continued)
Alternatively, we can find 𝐸𝐸(𝑋𝑋 2 ) first and then obtain
𝑉𝑉(𝑋𝑋) using the formula 𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2 .
𝐸𝐸 𝑋𝑋 2 = � 𝑥𝑥 2 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
1 2
2 2
2
1 2
4 9
= −1 +0 +1 +2 = .
8 8 8 8 4
2 2
9 2
5
𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 − 𝐸𝐸 𝑋𝑋 = −1 = .
4 4
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-111
Solution to Example 1 (Continued)
(b)
𝐸𝐸 𝑌𝑌 = 𝐸𝐸 𝑋𝑋 2 + 2 = � 𝑥𝑥 2 + 2 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
2
1 2 1
= −1 + 2 + 02 + 2 + 12 + 2
8 8 8
2
4 17
+ 2 +2 = .
8 4
9 17
Alternatively, 𝐸𝐸 𝑌𝑌 = 𝐸𝐸 𝑋𝑋 2 +2= + 2= .
4 4
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-112
Solution to Example 1 (Continued)
(b)
2
2
17
𝑉𝑉(𝑌𝑌) = � 𝑥𝑥 + 2 − 𝑓𝑓𝑋𝑋 (𝑥𝑥)
4
𝑥𝑥
2 2
17 1 17 2
= 3− + 2−
4 8 4 8
2 2
17 1 17 4 51
+ 3− + 6− = .
4 8 4 8 16
(b) (Continued)
Alternatively, we can find 𝐸𝐸(𝑌𝑌 2 ) first and then obtain
𝑉𝑉(𝑌𝑌) using the formula
𝑉𝑉 𝑌𝑌 = 𝐸𝐸 𝑌𝑌 2 − 𝐸𝐸 𝑌𝑌 2 ,
where
2 2
1 2
2 2
1 2
4 170
𝐸𝐸 𝑌𝑌 = 3 +2 +3 +6 =
8 8 8 8 8
2
170 17 51
𝑉𝑉 𝑌𝑌 = − = .
8 4 16
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-114
Example 2
• Suppose that the random variable X is continuous with the
following p.d.f.:
𝑥𝑥
, for 0 < 𝑥𝑥 < 15,
225
𝑓𝑓𝑋𝑋 𝑥𝑥 = 30 − 𝑥𝑥
, for 15 ≤ 𝑥𝑥 ≤ 30,
225
0, otherwise.
𝑥𝑥
, for 0 ≤ 𝑥𝑥 < 2,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2
0, otherwise.
Property 1 (Continued)
• Proof: For discrete case,
𝐸𝐸 𝑎𝑎𝑎𝑎 + 𝑏𝑏 = � 𝑎𝑎𝑎𝑎 + 𝑏𝑏 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
In general,
𝐸𝐸 𝑎𝑎1 𝑔𝑔1 𝑋𝑋 + 𝑎𝑎2 𝑔𝑔2 𝑋𝑋 + ⋯ + 𝑎𝑎𝑘𝑘 𝑔𝑔𝑘𝑘 𝑋𝑋
= 𝑎𝑎1 𝐸𝐸 𝑔𝑔1 𝑋𝑋 + 𝑎𝑎2 𝐸𝐸 𝑔𝑔2 𝑋𝑋 + ⋯ + 𝑎𝑎𝑘𝑘 𝐸𝐸[𝑔𝑔𝑘𝑘 (𝑋𝑋)]
where 𝑎𝑎1 , 𝑎𝑎2 , ⋯ , 𝑎𝑎𝑘𝑘 are constants.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-124
Properties of Expectation (Continued)
Property 2
𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2
.
• Hence
𝑉𝑉 𝑔𝑔 𝑋𝑋 = 1130000 − 7002 = 640000
and
𝑉𝑉 𝑔𝑔 𝑋𝑋 = 640000 = 800
𝑥𝑥 0 1 2 3 4 5 6
𝑓𝑓𝑋𝑋(𝑥𝑥) 0.1 0.15 0.2 0.25 0.2 0.06 0.04