You are on page 1of 19

Lecture-5

Thinking Challenge

You toss 2 coins. You’re


interested in the number of
tails. What are the expected
value, variance, and
standard deviation of this
random variable, number of
tails?
Expected value(𝝁)
• If 𝑋 is a random variable, then Mean or Expectation or Expected
value of 𝑋 is denoted by,
𝐸 [𝑋] = 𝜇 is defined by
• 𝐸 𝑋 = 𝑥𝑖 . 𝑃[𝑋 = 𝑥𝑖 ]
= 𝑥𝑖 . 𝑓𝑋 𝑥𝑖 = 𝑥𝑖 . 𝑝 𝑥𝑖 when 𝑋 is discrete


• 𝐸 [𝑋] = −∞
𝑥. 𝑓𝑋 𝑥 𝑑𝑥 when 𝑋 is continuous
Example 1:
• The pdf of weekly gravel sales 𝑋 was
3 1 − 𝑥2
𝑓𝑋 𝑥 = 𝑖𝑓 0 ≤ 𝑥 ≤ 1
2
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

So 𝐸(𝑋) = −∞ 𝑥. 𝑓𝑋 𝑥 𝑑𝑥
1 3 1−𝑥 2 3
= 0
𝑥. 𝑑𝑥 =
2 8
Variance (𝝈𝟐𝑿 )

𝑉𝑎𝑟 [𝑋] = 𝜎𝑋2 is defined by


𝑉𝑎𝑟 [𝑋] = 𝐸 {[𝑋 − 𝜇]2 }
= 𝐸 {[𝑋 − 𝐸(𝑋)]2 }
Therefore,
• 𝑉𝑎𝑟[𝑋] =  𝑥𝑖 −  2 𝑓𝑋 𝑥𝑖 =  𝑥𝑖 −  2 𝑝 𝑥𝑖 when 𝑋 is discrete

• 𝑉𝑎𝑟 𝑋 = −∞
𝑥 −  2𝑓𝑋 𝑥 𝑑𝑥 when 𝑋 is continuous
Note: 𝑉𝑎𝑟 [𝑋] = 𝐸 {[𝑋 − 𝜇]2 }
= 𝐸[𝑋2] – {𝐸[𝑋]}2
Example 1 (Continued)
3
For 𝑋 = weekly gravel sales, we computed 𝐸 𝑋 = , Since
8
∞ 2
𝐸(𝑋)2 = −∞ 𝑥 . 𝑓𝑋 𝑥 𝑑𝑥
1 2 3 1−𝑥 2 1
= 0𝑥 . 𝑑𝑥 =
2 5

𝑉𝑎𝑟 [𝑋] = 𝐸[𝑋2] – {𝐸[𝑋]}2


1 3 2
= − ( ) = 0.059
5 8
Standard deviation 𝑺𝑫(𝑿) = 𝝈𝑿

• 𝑆𝐷(𝑋) = 𝑉𝑎𝑟(𝑋)
i.e., The standard deviation is the positive square root of the
Variance.
Example 1 (Continued)
𝜎𝑋 = 𝑉𝑎𝑟(𝑋) = 0.059 = 0.244
Laws of the Expected Value
• 𝐸[𝑎] = 𝑎 𝑎-constant
• 𝐸 [𝑎𝑋] = 𝑎 𝐸[𝑋]
• 𝐸 [ 𝑎𝑋 + 𝑏] = 𝑎 𝐸[𝑋] + 𝑏
• Let 𝑋1, 𝑋2, … … . 𝑋𝑛 be random variables on the same sample space
then
𝐸[𝑋1 + 𝑋2 … … . +𝑋𝑛] = 𝐸[𝑋1] + 𝐸[𝑋2] + ⋯ … … + 𝐸[𝑋𝑛]

• If 𝑋 and 𝑌 are independent random variables


𝐸 [𝑋. 𝑌] = 𝐸[𝑋]. 𝐸[𝑌]
Laws of Variance
• 𝑉𝑎𝑟 (𝑋 + 𝑘) = 𝑉𝑎𝑟 (𝑋) where, 𝑘 is a Constant.
• 𝑉𝑎𝑟 (𝑘 𝑋) = 𝑘2 𝑉𝑎𝑟(𝑋)
• 𝑉𝑎𝑟 (𝑎 𝑋 + 𝑏) = 𝑎2 𝑉𝑎𝑟(𝑋)
• If 𝑋 and 𝑌 are independent random variables
1. 𝑉𝑎𝑟 (𝑋 + 𝑌) = 𝑉𝑎𝑟 (𝑋) + 𝑉𝑎𝑟 (𝑌)
2. 𝑉𝑎𝑟 (𝑋 − 𝑌) = 𝑉𝑎𝑟 (𝑋) + 𝑉𝑎𝑟 (𝑌)
Example 2:
Example 3:
Example 4:
Example 5:
An unbiased coin is tossed four times. Let 𝑋 denotes the number of
heads. Find,
(i) 𝐸(𝑋) (ii) 𝑉𝑎𝑟 (𝑋)
X 0 1 2 3 4
P(X=x) 1/16 4/16 6/16 4/16 1/16
4
E(X)   x i P(X  x i )
i 0

1 4 6 4 1
= 0.  1.  2.  3.  4.
16 16 16 16 16

=2
4
E(X )   x i2 P(X  x i )
2

i 0

= 1 4 6 4 1
0.  1.  4.  9.  16.
16 16 16 16 16

=5

Var(X)  E(X )  [E(X)] 2 2

=5-4

=1
Example 6: A PDF of a random variable X is given by
3e 3x for x  0
f X (x)  
0 o/w
Find (i) 𝐸 (𝑋) and (ii) 𝑉𝑎𝑟 (𝑋)
Solution:- 
E(X)   x.f

X (x).dx
0 

 x.f (x)dx   x.f X (x)dx


=
X
 0


 3x
=0+ x.3e dx
0
= 1
3

E(X 2 )   .f X (x).dx
2
x

0 

 X   .f X (x)dx
2 2
= x .f (x)dx x
 0

=0+ 
2  3x
x .3e dx
0
= 2
9
Var(X)  E(X 2 )  E(X) 
2

2 1
= -
9 9

= 1
9
Exercise 1:
If the PDF of X is given by
2(1  x) for 0  x  1
f X (x)  
0 o/w
2
Show that E(X r )  and use this result to evaluate E[(2X  1) 2 ]
(r  1)(r  2)
Exercise 2:
Suppose that the probability function shown below reflects the
possible lifetimes (in months after emergence) for fruit flies.

(a)What proportion of fruit flies die in their second month?


(b) What is the probability that a fruit fly lives more than four
months?
(c) What is the mean lifetime for a fruit fly?
(d) What is the standard deviation of fruit fly lifetimes?
Solution:

You might also like