You are on page 1of 35

Function of Random Variable

&
Expectation of a Random
Variable

TB ch-5
Function of a Random Variable

If X is a discrete/continuous random variable and Y = g(X) is a


function of X. Then Y is also a discrete/continuous random
variable, but its probability distribution function will be
different of probability distribution function of X.
Function of a Discrete Random Variable
Example: If X have a uniform distribution with probability function
1
f(x) = x = 1, 2, … 9, and Y = 𝑋 − 5 is function of X. Then determine
,
9
the probability function of Y. Also, find P(Y = 1).
Example: If X have a uniform distribution with probability function
1
f(x) = x = 1, 2, … 9, and Y = 𝑋 − 5 is function of X. Then determine
,
9
the probability function of Y. Also, find P(Y = 1).
Sol: x 1 2 3 4 5 6 7 8 9
y |X-5|= 3 2 1 0 1 2 3 4
4

Thus y=0,1,2,3,4 and f(y)=1/(4-0+1) = 1/5


Expected Value of random variable
Definition:
If X is a discrete random variable with probability function 𝑓(𝑥),
then the expected value of X is
E(X) = σ 𝑥 . 𝑓(𝑥)

If X is a continuous random variable with probability function


𝑓(𝑥), then the expected value of X is

E(X) = ‫׬‬−∞ 𝑥 . 𝑓 𝑥 𝑑𝑥
Example-1
Find the expected number of heads when coin is tossed three times.
Example-2
Two unbiased dice are thrown. Find the expected value of the sum of
numbers on that.

Ans:
Possible sums: 2,3,4,5,6,7,8,9,10,11,12
Respective prob: 1/36, 2/36, 3,4,5,6,5,4,3,2,1/36
Expected value: σ 𝑥. 𝑃(𝑥) = 2x1/36 + 3x2/36 +….+ 12x1/36 = 252/36 = 7
Example-3
The sale of petrol in a petrol pump on average is Rs. 80,000 on a rainy day and Rs.
95000 on a clear day. The forecast predicted for the weather on coming Monday
says that the prob. Is 0.76 for a clear day. Find the expected value of petrol sale on
the coming Monday.
Sol to Example-3
The sale of petrol in a petrol pump on average is Rs. 80,000 on a rainy
day and Rs. 95000 on a clear day. The forecast predicted for the
weather on coming Monday says that the prob. Is 0.76 for a clear day.
Find the expected value of petrol sale on the coming Monday.

Solution: We know that, E(X) = σ𝑥 𝑥 . 𝑓(𝑥)


Here, 𝑥 = Value associated with sale of petrol

E(x) = x1. f(x1) + x2. f(x2) = (0.76)(95000) + (0.24)(80000) = 91,400 Rs.


Example-4
A box contains 6 tickets. Two of the tickets carry price of Rs. 5 and
other 4 carry price of Rs. 1.
(a) If one ticket is drawn what is the expected value of the price?
(b) If 2 tickets are drawn what is the expected value of the price?
Sol to Example-4
A box contains 6 tickets. Two of the tickets carry price of Rs. 5 and
other 4 carry price of Rs. 1.
(a) If one ticket is drawn what is the expected value of the price?
(b) If 2 tickets are drawn what is the expected value of the price?
Solution:
Here, 𝑥 = Price associated with ticket
(1) 1 ticket is drawn
2 𝐶1 2 1 4 𝐶1 4 2
f(x1) = = = , 𝑓(𝑥2) = = =
6 𝐶1 6 3 6 𝐶1 6 3

1 2 7
So, 𝐸 𝑥 = 𝑓 𝑥1 . 𝑋1 +𝑓 𝑥2 . 𝑋2 = 5 + 1 =
3 3 3
Case (i): Both of Rs. 1
Random variable X1 = 1 + 1 = 2
4𝐶2
f(x1) =
6𝐶2

Case (ii): One ticket is of Rs. 1 & one ticket is of Rs. 5


Random variable X2 = 1 + 5 = 6
2𝐶1 × 4𝐶
1
f(x2) =
6𝐶2
Case (iii): Both of Rs. 5
2𝐶2
Random variable X3 = 5 + 5 = 10 f(x3) =
6𝐶2

So, 𝐸 𝑥 = f(x1)𝑋1 + f(x2)𝑋2 + f(x3)X3 = (0.4)(2) + (0.53)(6) + (0.066667)(10)


= 4.67
Example-5
A company estimates the net profit of a new product to be Rs. 3 lakhs during a first
year if it is successful; Rs. 1 lakh if it is moderately successful; and loss of Rs. 1 lakh if
it is unsuccessful. The firm assigns probability as 0.15 for being successful and 0.25
for being moderately successful. What is the expected value of profit the company
makes in the first year?
Properties of Expectation
1. If c is a constant, then E(c) = c.

2. E X + Y = E X + E(Y)

3. E X Y = E X . E Y if X and Y are independent variables.

4. E aX + b = aE X + b where, a and b are constants.

5. If c is a constant and u is a function, then E[cu X ] = cE[u X ].

6. If c1 and c2 are constants and u1 and u2 are functions, then


E[c1 u1 X + c2 u2 X ] = c1 E u1 X + c2 E[u2 X ]

7. 𝑉 𝑋 = 𝐸 𝑋 2 − 𝐸 𝑋 2

8. 𝑉 𝑎𝑋 + 𝑏 = 𝑎2 . 𝑉(𝑋)
Example-6
The probability distribution of a random variable X is as follows:
Xi 0 1 2 3 4
Probability 1/10 P 3/10 p 1/10
f(Xi)

(i) Find the value of p.


(ii) Find E(X+1)
(iii) Find E(3X + 5)
Sol to Example-6
The probability distribution of a random variable X is as follows:
Xi 0 1 2 3 4
Probability 1/10 p 3/10 p 1/10
(i) Find the value of p.
(ii) Find E(X + 1)

Solution:
(i) We know that σ𝑥∈𝑆 𝑓 𝑥 = 1

So, 1/10 + p + 3/10 + p + 1/10 = 1


➔ 5/10 + 2p = 1
➔ 2p = 1 – 5/10 = ½
➔ p = 1/4
(ii) We know that 𝐸 𝑎𝑋 + 𝑏 = 𝑎 𝐸 𝑋 + 𝑏
E(X + 1) = E(X) + 1
= (σ𝑥∈𝑆 𝑥. 𝑓 𝑥 ) + 1
= [(0 * 1/10) + (1 * ¼) + (2 * 3/10) + (3 * ¼) + (4 * 1/10)] + 1
= [0 + ¼ + 3/5 + ¾ + 2/5] + 1
= (5+12+15+8)/20 + 1
= (40/20) + 1
=3
Example-7
The probability distribution of a random variable x is as follows:
Xi -1 0 1 2 3 4
Probability 1/8 1/8 1/4 1/4 1/8 1/8
f(Xi)

Find the mean and variance of x.


Sol to Example-7
The probability distribution of a random variable x is as follows:
Xi -1 0 1 2 3 4
Probability 1/8 1/8 1/4 1/4 1/8 1/8

Find the mean and variance of x.


Solution:
The formula of Mean and variance in terms of expectation are
Mean = E(X) and Variance = 𝐸 𝑋 2 − (𝐸 𝑋 )2
Xi f(xi) E(X)= xi * f(xi) xi2 𝐸 𝑋 2 = xi2 * f(xi)

-1 1/8 -1/8 1 1/8

0 1/8 0 0 0

1 1/4 1/4 1 1/4

2 1/4 1/2 4 1

3 1/8 3/8 9 9/8

4 1/8 4/8 16 16/8

Σ 12/8 = 1.5 36/8 = 4.5

12
Mean = E(X) = σ 𝑥𝑖 ∗ 𝑓 𝑥𝑖 = = 1.5
8
Now, E(x2 ) =
36 2
σ 𝑥𝑖 2 ∗ 𝑓 𝑥𝑖 = = 4.5 𝑎𝑛𝑑 𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 = 𝐸 𝑋2 − 𝐸 𝑋 = 4.5 − 1.52 = 2.25
8
Example-8
𝑥
Let X have the pmf 𝑓 𝑥 = , 𝑥 = 1,2,3,4.
10
Find the mean, 𝐸 𝑋 2 , 𝐸 𝑋 5 − 𝑋 , 𝐸 𝑋 − 2 2 , 𝑉 𝑋 , 𝑉 −3𝑋 + 5 .
Sol to Example-8
𝑥
Let X have the pmf 𝑓 𝑥 = , 𝑥 = 1,2,3,4.
10
Find the mean, 𝐸 𝑋 2 , 𝐸[𝑋 5 − 𝑋 ].
Solution:
𝑥
The mean of X is 𝐸 𝑋 = σ4𝑥=1 𝑥. 𝑓 𝑥 = σ4𝑥=1 𝑥.
10
1 2 3 4
= 1. + 2. + 3. + 4.
10 10 10 10
=3
4 4
𝑥
𝐸 𝑋2 = ෍ 𝑥 2. 𝑓 𝑥 = ෍ 𝑥 2.
10
𝑥=1 𝑥=1
2 1 2 3 4
= 1 . + 22 . + 32 . + 42 .
10 10 10 10
= 10
𝐸 𝑋(5 − 𝑋 = 𝐸 5𝑋 − 𝑋 2 = 5𝐸 𝑋 − 𝐸 𝑋 2 = 5 3 − 10 = 5
Example-9
𝑥 2 −5
Let X have the pmf 𝑓 𝑥 = , 𝑥 = 1,2,3,4.
10
2
Find the value of 𝐸 (𝑋 − 2) and V 3 − 5X .
Example-10
Let the random variable X have the pmf
( 𝑥 +1)2
𝑓 𝑥 = , 𝑥 = −1, 0, 1
9
Compute 𝐸 𝑋 , 𝐸 𝑋 2 , 𝐸 3𝑋 2 − 2𝑋 + 4 , 𝑉 𝑋 , 𝑉 5 − 7𝑋 , 𝑎𝑛𝑑 𝑉(4 + 5𝑋).
Example-11
Let X equal the number visible on the side facing upwards after a fair six –
sided die is cast at random. A reasonable probability model is given by the
pmf
1
𝑓 𝑥 =𝑃 𝑋=𝑥 = , 𝑥 = 1,2,3,4,5,6
6
Find mean, variance and standard deviation.
Solution:
1 1+2+3+4+5+6 7
Mean = 𝐸 𝑋 = σ6𝑥=1 𝑥 = =
6 6 2
V(X) = 𝐸 𝑋 2 − (𝐸 𝑋 )2
6
1 12 + 22 + 32 + 42 + 52 + 62 91
𝐸 𝑋2 = ෍ 𝑥2 = =
6 6 6
𝑥=1
Variance = V(X) = 𝐸 𝑋 2 − (𝐸 𝑋 )2

2
91 7 35
= − =
6 2 12
Example-12
Let X have the pmf
1
𝑓 𝑥 = , 𝑥 = −2,0,2
5
Find mean, variance and standard deviation.
1 −2+0+2
Solution: Mean = 𝐸 𝑋 = σ2𝑥=−2 𝑥 = =0
5 5
Variance = V(X) = 𝐸 𝑋 2 − (𝐸 𝑋 )2 ]
2
1 −22 + 02 + 22 8
𝐸 𝑋2 = ෍ 𝑥2 = =
5 5 5
𝑥=−2
8 8
Variance = − 0 =
5 5
Standard deviation 𝜎 = 8/5
Example-13
Let X have the pmf
2−𝑥
𝑓 𝑥 = , 𝑥 = 1, 2, 3, 4
3
Find 𝐸 𝑋 , 𝐸 𝑋 𝑋 − 1 𝑎𝑛𝑑 𝑉 𝑋 .
Example-14
Let X have the pmf
2−|𝑥|
𝑓 𝑥 = , 𝑥 = −1, 0, 1
4
Find 𝐸 𝑋 , 𝐸 𝑋 𝑋 − 1 𝑎𝑛𝑑 𝑉 𝑋 .
Example-15
If 𝐸 2𝑥 − 5 = 11, 𝑉 5 − 3𝑥 = 81, 𝐸 𝑎 − 𝑏𝑥 = −14, 𝑎𝑛𝑑
𝑉 𝑎𝑥 − 𝑏 2 = 36, then find a and b given they are positive.
Solution:
We know that, 𝐸 𝑎𝑥 + 𝑏 = 𝑎 𝐸 𝑋 + 𝑏
∴ 𝐸 2𝑥 − 5 = 2𝐸 𝑋 − 5 = 11
∴𝐸 𝑋 =8

𝑉 𝑎𝑥 + 𝑏 = 𝑎2 𝑉 𝑋
∴ 𝑉 5 − 3𝑥 = 9. 𝑉 𝑋 = 81
∴𝑉 𝑥 =94
Sol to Example-15
If 𝐸 2𝑥 − 5 = 11, 𝑉 5 − 3𝑥 = 81, 𝐸 𝑎 − 𝑏𝑥 = −14, 𝑎𝑛𝑑
𝑉 𝑎𝑥 − 𝑏 2 = 36, then find a and b given they are positive.
Solution:
We know that, 𝑬 𝒂𝒙 + 𝒃 = 𝒂 𝑬 𝑿 + 𝒃
∴ 𝐸 2𝑥 − 5 = 2𝐸 𝑋 − 5 = 11
∴𝐸 𝑋 =8

𝑽 𝒂𝒙 + 𝒃 = 𝒂𝟐 𝑽 𝑿
∴ 𝑉 5 − 3𝑥 = 9. 𝑉 𝑋 = 81
∴𝑉 𝑥 =9
Now, 𝑬 𝒂 − 𝒃𝒙 = −𝒃 𝑬 𝑿 + 𝒂 = −14
∴ −8𝑏 + 𝑎 = −14 … … … … … … … … … . (1)

𝑽 𝒂𝒙 − 𝒃𝟐 = 36
∴ 𝒂𝟐 𝑽 𝑿 = 36
∴ 9𝑎2 = 36 (since V(x) = 9)
∴ 𝑎2 = 4
∴ 𝑎 = ±2
But 𝑎 = −2 𝑖𝑠 𝑛𝑜𝑡 𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒 (according to the ques a and b are positive)
∴𝑎=2
From (1), b = 2
Example-16
A vendor can purchase a newspaper at a concession rate of 0.25 Rs. Per
copy against the selling price Rs. 0.40. Any unsold copies are however a
dead loss. He has estimated the following distribution for the number of
copies demanded.

No. of 15 16 17 18 19 20
Copies
Probability 0.04 0.19 0.33 0.26 0.11 0.07

How many copies should be ordered so that expected profit is maximum.


No. of Copies 15 16 17 18 19 20
Probability 0.04 0.19 0.33 0.26 0.11 0.07
Thank you

35

You might also like