Mathematical Expectation and Others
Mathematical Expectation and Others
Mathematical Expectation and Others
If 𝑋 is a discrete random variable with the probability function 𝑓(𝑥), then the expected value or
the mathematical expectation of 𝑋 , 𝐸(𝑋) is defined as
𝐸(𝑋) = ∑𝑥 𝑥𝑓(𝑥).
If 𝑋 is continuous having a density function 𝑓(𝑥), then
∞
𝐸(𝑋) = ∫−∞ 𝑥𝑓(𝑥)𝑑𝑥.
*𝐸[𝑊1 (𝑋) + 𝑊2 (𝑋) + ⋯ + 𝑊𝑘 (𝑋)] = 𝐸[𝑊1 (𝑋)] + 𝐸[𝑊2 (𝑋)] + ⋯ + 𝐸[𝑊𝑘 (𝑋)]
∑𝑥 𝑊(𝑥)𝑓(𝑥), 𝑖𝑓 𝑋 𝑖𝑠 𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒
*𝐸[𝑊(𝑋)] = { ∞
∫−∞ 𝑊(𝑥)𝑓(𝑥)𝑑𝑥, 𝑖𝑓 𝑋 𝑖𝑠 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠
* 𝑋 ∶ −3 − 2 0 1 2
𝑃(𝑋) = 𝑓(𝑥) : .10 .30 .15 .40 .05
Find 𝐸(𝑋) and 𝑉(𝑋).
Solution:
𝜇 = 𝐸(𝑋) = ∑ 𝑥𝑓(𝑥)
𝑥
−3
*A life insurance company in Bangladesh offers to sell a TK.25000 one-year term life insurance
policy to a 25 year-old man for a premium of TK. 2500. According to Bangladesh life table, the
probability of surviving one year for a 25 year old man is 0.97. What is the company’s expected
gain in the long run?
Solution:
The gain 𝑋 is a random variable that may take on the values 2500, if the man survives or 2500-
25000= -Tk. 22500 if he dies. Consequently, the probability of X is
𝑋 ∶ 2500 − 22500
𝑓(𝑥) ∶ .97 .03
So, 𝐸(𝑋) = (2500 × .97) + (−22500 ×. 03) = 1750
Thus the ultimate gain of the company is 1750.
*Find the mean (expected value) and variation of the following function
𝑓(𝑥) = 2(1 − 𝑥), 0 < 𝑥 < 1.
1 1 1 1
Solution: 𝐸(𝑋) = ∫0 𝑥. 2(1 − 𝑥)𝑑𝑥 = 2 [∫0 𝑥 𝑑𝑥 − ∫0 𝑥 2 𝑑𝑥] = 3
1 1
𝐸(𝑋 2 ) = ∫0 𝑥 2 . 2(1 − 𝑥)𝑑𝑥 = 6
1 1 2 1
∴ 𝑉(𝑋) = 𝜎 2 = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 6 − (3) = 18
□Expected value of a function of two random variables:
∑𝑥 ∑𝑦 𝑊(𝑥, 𝑦)𝑓(𝑥, 𝑦), 𝑖𝑓 𝑋 𝑎𝑛𝑑 𝑌 𝑎𝑟𝑒 𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒
𝐸[𝑊(𝑋, 𝑌)] = { ∞
∬−∞ 𝑊(𝑥, 𝑦)𝑓(𝑥, 𝑦)𝑑𝑥𝑑𝑦, 𝑖𝑓 𝑋 𝑎𝑛𝑑 𝑌 𝑎𝑟𝑒 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠
* Consider the following joint distribution of X and Y and find E(X), E(Y), E(X+Y) and E(X.Y).
X\Y -3 2 4 Total
1 .1 .2 .2 .5
3 .3 .1 .1 .5
Total .4 .3 .3 1
Solution:
E(X)=∑𝑥 ∑𝑦 𝑥𝑓(𝑥, 𝑦) = ∑𝑥 𝑥𝑔(𝑥) ,g(x) is the marginal distribution of X.
Thus,
E(X) = 𝑥1 𝑔(𝑥1 ) + 𝑥2 𝑔(𝑥2 )
=(1× 0.5) + (3 × .5)
=2
Similarly,
E(Y)=∑𝑦 𝑦ℎ(𝑦) = (−3 × .4) + (2 × .3 ) + (4 × .3) = .6
* Consider
1
P(x,y)=8 (6 − 𝑥 − 𝑦), 0 < 𝑥 < 2, 2 < 𝑦 < 4
𝑥
𝑥2
𝑒 =1+𝑥+ +⋯
2!
(𝑡𝑋)2 (𝑡𝑋)3 (𝑡𝑋)𝑟
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = 𝐸[1 + 𝑡𝑋 + + + ⋯+ +⋯]
2! 3! 𝑟!
𝑡2 𝑡𝑟
= 1 + 𝑡𝐸(𝑋) + 𝐸(𝑋 2 ) + ⋯ + 𝐸(𝑋 𝑟 ) + ⋯
2! 𝑟!
𝑡2 ′ 𝑡𝑟
= 1 + 𝑡𝜇1′ + 𝜇2 + ⋯ + 𝜇𝑟′ + ⋯
2! 𝑟!
𝑡𝑟
=∑∞
𝑟=0 ( 𝑟! ) 𝜇𝑟 ′
𝑡𝑟
So, the coefficient of is the rth raw moment
𝑟!
𝑡
Coefficient of = 𝜇1′
1!
𝑡2
Coefficient of = 𝜇2′
2!
𝑡𝑟
Coefficient of = 𝜇𝑟′
𝑟!
We also get moment from 𝑀𝑋 (𝑡) by differentiating 𝑀𝑋 (𝑡) with respect to t and then setting t=0 ,
i.e. ,
𝑑𝑟
𝜇𝑟′ = 𝑟 𝑀𝑋 (𝑡)|𝑡 = 0
𝑑𝑡
𝑑 𝜇3′ 𝑡 2
Thus, 𝑑𝑡 𝑀𝑋 (𝑡) = 𝜇1′ + 𝜇2′ 𝑡 + +⋯
2!
𝑑
Setting t=0, 𝑀𝑋 (0) = 𝜇1′ (= 𝐸(𝑋)).
𝑑𝑡
* Let X be a random variable with MGF 𝑀𝑋 (𝑡) , Let 𝑌 = 𝑎𝑋 , Where a is any constant then ,
𝑀𝑌 (𝑡) = 𝑀𝑋 (𝑎𝑡)
Proof: 𝑀𝑌 (𝑡) = 𝐸(𝑒 𝑌𝑡 ) = 𝐸(𝑒 𝑡𝑎𝑋 ) = 𝐸(𝑒 𝑎𝑡𝑋 ) = 𝑀𝑋 (𝑎𝑡).
Proof:
𝑀𝑌 (𝑡) = 𝐸(𝑒 𝑌𝑡 ) = 𝐸(𝑒 𝑋1𝑡+𝑋2 𝑡+⋯+𝑋𝑛𝑡 ) = 𝐸(𝑒 𝑋1 𝑡 𝑒 𝑋2 𝑡 𝑒 𝑋3 𝑡 … 𝑒 𝑋𝑛𝑡 )
= 𝐸(𝑒 𝑋1𝑡 )𝐸(𝑒 𝑋2 𝑡 ) … 𝐸(𝑒 𝑋𝑛𝑡 ) [As X’s are independent]
𝑛
Now,
𝑑 1
𝐸(𝑥) = 𝑀𝑥 (𝑡) = = 1, [𝑡 = 0]
𝑑𝑥 (1 − 𝑡)2
𝑑2 1
𝐸(𝑥 2 ) = 𝑑𝑥 2 𝑀𝑥 (𝑡) = (1−𝑡)3 = 2, [𝑡 = 0]
2
So, 𝑉(𝑥) = 𝐸(𝑥 2 ) − (𝐸(𝑥)) = 2 − 12 = 1
OR,
1 2 𝑟
𝑡 𝑡2 𝑡3
= 1 + 𝑡 + 𝑡 + ⋯ + 𝑡 + ⋯ = 1 + 1 ⋅ + 2! + 3! ⋅ + ⋯
1−𝑡 1! 2! 3!
𝑆𝑜 , 𝐸(𝑥 𝑟 ) = 𝑟!
So, E(X) = 1,
E (𝑋 2 ) = 2. (As before)
Cumulant Generating Function
If the logarithm of moment generating function of a distribution can be expanded as
𝑡2 𝑡𝑟
= 𝑘1 𝑡 + 𝑘2 + ⋯ + 𝑘𝑟 + ⋯
2! 𝑟!
Then the coefficient 𝑘𝑟 is called the 𝑟 𝑡ℎ cumulant of the distribution and 𝐾𝑥 (𝑡) is called the
cumulant generating function (KGF).
The 𝑟 𝑡ℎ cumulant 𝑘𝑟 can be obtained by differentiating 𝐾𝑥 (𝑡) , r times with respect to t and setting
t=0. Thus,
𝑑𝑟
𝑘𝑟 = [ 𝑑𝑥 𝑟 ln(𝑀𝑥 (𝑡)) ], where, t=0
--------------
Relationship between raw moment and corrected moment:
𝜇1 = 0
𝜇2 = 𝜇2′ + (𝜇1′ )2
𝜇3 = 𝜇3′ + 3 𝜇2′ . 𝜇1′ + 2(𝜇1′ )3
𝜇4 = 𝜇4′ − 4 𝜇3′ . 𝜇1′ + 6𝜇2′ . (𝜇1′ )2 −3(𝜇1′ )4
Binomial Distribution
When an experiment has two possible outcomes, success and failure and the experiment is repeated
𝑛 times independently and the probability 𝑃 of success of any given trial remains constant from
trial to trial, the experiment is known as binomial experiment.
where,
n: number of trials
p: probability of success
[ f(x) = P(X=x)]
𝜇 2’=𝐸(𝑋 2 ) = ⋯ = 𝑛𝑝𝑞 + 𝑛2 𝑝2
⋮
Example: The probability that a patient recovers from a diseases is 0.9. What is the probability that
an exactly 5 out of the next seven patients will survive?
Solution:
We assure that the operations are made independently and P=0.9 for each of the seven
patients.
n=7, p=0.9
patient1 p2 p3 p4 p5 p6 p7 Total
1: success(recover) 1 1 0 0 0 1 0 3
2: failure(not recover) 0 0 0 0 1 0 0 1
⋮
Bernoulli Binomial
Example:
A traffic control officer reports that 75% of the trucks passing through a check post are from within
Dhaka city. What is the probability that at least 3 of the next 5 trucks are from out of the city?
Solution: Let X be the number of trucks that pass through are from out of Dhaka city. The
probability of such an event is: p=1-0.75=0.25
X~ Bin (n=5, p=0.25)
=0.1035
Or, p(X≥3) =1-p(X=0)-p(X=1)-p(X=2)
= 0.2441
*Probability that at least 2 trucks are out of the city:
5
P(X≤2) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) = ( ) (0.25)0 (0.75)5−0 + ⋯
0
*Probability that less than 2 trucks are out of the city:
P(X<2) = P(X=0) + P(X=1)
*P(1≤X<3) = P(X=1) + P(X=2) + P(X=3)
*P(1<X<3) = P(X=2)
−O−
Mean of binomial random variable: E(X) = np
Variance of binomial random variable: V(X) = np(1-P)
𝑛𝑃(1−𝑃) 2
=5
𝑛𝑃
2
or, 1-P = 5
2 3
or, P = 1- 5 = 5
Now, nP = 5
5 5×5 25
or, 𝑛 = 𝑃 = =
3 3
25 3
X~𝐵𝑖𝑛(𝑛 = , 𝑃 = 5)
3
Poisson Distribution
Let µ be the mean of successes in a specified time or space and the random variable X is the
number of successes in a given time interval or specified region. Then X follows Poisson
distribution as
ⅇ −µ µ𝑥
f(x) = , x=0,1, ...∞
𝑥!
where e= 2.718.
Example: The average number of calls received by a telephone operator during a time interval of
10 minutes. during 5PM to 5:10 PM daily is 3. What is the prob. that the operator will receive,
i. no call
ii. exactly one call
iii. at least two calls tomorrow during the same time interval.
Soln: Let X be the random variable representing the number of calls made during the interval.
X ~ Poisson (3),
ⅇ −3 3𝑥
f(X=x) = , x≥0
𝑥!
ⅇ −3 30
i. P(X=0) = = 0.0498
0!
𝑒 −3 ∙ 3
ii. 𝑃(𝑋 = 1) = = 0.1494
1!
iii. 𝑃(𝑋 ≥ 2) = 1 − 𝑃(𝑋 = 0) − 𝑃(𝑥 = 1)
= 1 − 0.0498 − 0.1494
= 0.8008
Mean:
∞
𝐸(𝑋) = ∑ 𝑥 ∙ 𝑓(𝑋 = 𝑥) = . . . = 𝜇
𝑋=0
Variance:
𝑉(𝑋) = 𝐸[𝑋 − 𝐸(𝑋)]2 = ⋯ = 𝜇
Poisson approximation to binomial distribution:
If 𝑛 becomes larger and p becomes smaller, then the Poisson distribution with
𝜇 = 𝑛𝑝 provides an approximation to the binomial distribution.
Example: The probability of breaking a glass beaker while heating in the laboratory is 0.012. If we heat
250 such glass beakers, find the probability that there will be exactly 2 breaks.
Solution:
Let X be the number of breakage
X ~ Binomial (n = 250, p = 0.012)
Now, 𝑃(𝑋 = 2) = (250 2
2 )(0.012) (1 − 0.012)
(250−2)
= 0.2245
Since n is large and p is small, we may obtain an approximate probability by using the Poisson
distribution with 𝜇 = 𝑛𝑝 = 250 × 0.012 = 3.
𝑒 −3 ∙ 32
𝑃(𝑋 = 2) = = 0.2241
2!
Find the mean and standard deviation of a Poisson variate X for which P(X=1) = P(X=2).
Solution:
Let X ~ Poisson(𝜇)
𝑒 −𝜇 ∙ 𝜇1
𝑃(𝑋 = 1) =
1!
𝑒 −𝜇 ∙ 𝜇 2
𝑃(𝑋 = 2) =
2!
𝑒 −𝜇 ∙ 𝜇1 𝑒 −𝜇 ∙ 𝜇 2
∴ =
1! 2!
⇒𝜇=2
So, the mean = 2, Standard deviation = 2.
Normal Distribution
A random variable X is said to have a normal distribution with mean µ and variance 𝜎 2 (-∞ < µ <
∞ and 𝜎 2 > 0) if X has a continuous distribution for which the probability density function is
1 𝑥−𝜇 2
1
f(x) = 𝜎√2𝜋 𝑒 −2( 𝜎
)
, -∞ < x < ∞
If a random variable X has a normal distribution with mean µ and variance σ2 (i.e. X ~ N (µ ,
𝑋−𝜇
σ2)), then the variable Z = will be called a standard normal variable ( or Z score ) and its
𝜎
distribution is referred to as the standard normal distribution having the following density
function :
𝑍2
1 −
f(Z) = 𝑒 2 , -∞ < Z < ∞
√2𝜋
𝑋−𝜇 1 1
E(Z) = E ( ) = 𝜎 𝐸(𝑋 − 𝜇) = [ 𝐸(𝑋) − 𝐸(𝜇) ]
𝜎 𝜎
1
= [𝜇− 𝜇]
𝜎
=0
𝑋−𝜇 1 1
𝑣(𝑋)= 𝑣( ) = 𝜎2 𝑣(𝑋 − 𝜇) = [ 𝑣(𝑋) + 𝑣(𝜇) − 2𝑐𝑜𝑣[𝑋]
𝜎 𝜎2
1
= [𝜎 2 + 0 − 0]
𝜎2
=1
Thus, Z ~ N (0,1)
The cumulative distribution function (cdf) of the standard normal variable Z is usually denoted
by φ(Z). Thus
𝑍 𝑍2
1
φ(Z)= ∫ 𝑒 − 2 𝑑𝑍
√2𝜋
−∞
The GPA score of 80 students of the Department of Physics of University of Dhaka in their
1st year final exam was found to follow approximately a normal distribution with mean 2.1
and standard deviation 0.6. How many of these students are expected to have a score
between 2.5 and 3.5?
𝑋 ~ 𝑁(2.1,0.6)
=
0.9901 – 0.7480 = 0.2421
Hence, 24.21% or approximately 0.2421×80 = 20 students out of 80 are expected to make a score
between 2.5 and 3.5.
𝑘−25
or, P(Z> ) = 0.15
3
𝑘−25
or, P(Z< ) = 1- 0.15 = 0.85
3
𝜇 = 𝑛𝑃, 𝜎 = √𝑛𝑃(1 − 𝑃)
If, X~𝐵𝑖𝑛(𝑛, 𝑝), ie, E(X) = np, V(X) = nP(1-P) then,
𝑥 − 𝑛𝑃
𝑧= , 𝑖𝑓 𝑛 → ∞
√𝑛𝑃(1 − 𝑃)
Continuity Correction
P (a ≤ X ≤ b) ≈ P(a-0.5<𝑋 ′ <b+0.5)
Where 𝑋 ′ is the constant normal variable
*Let, X~Bin (n=10, P=0.5). Find P(2≤X≤4) using both
binomial distribution and normal distribution:
Solution:
Using binomial distribution:
P(2≤X≤4)
𝑛
=∑ ( ) 𝑃 𝑥 (1 − 𝑃)𝑛−𝑥
𝑥 𝑥
4
10 (0
=∑ ( ) ⋅ 5)𝑥 (1 − 0.5)10−𝑥 = 0.3662
𝑥=2 𝑥
Now, P(2≤X≤4) ≈ P(2-0.5≤X’≤4+0.5) = P(1.5≤X’≤4.5)
Using normal distribution, µ=np=5, 𝜎 2 =np(1-p) =2.5
𝑃(1.5 ≤ 𝑋 ′ ≤ 4.5)
1⋅5−5 4⋅5−5
=𝑃( ≤𝑧≤ )
√2⋅5 √2⋅5
= 𝑃(−2.21 ≤ 𝑍 ≤ −0.316)
= 𝑃(𝑍 ≤ −0.316) − 𝑝(𝑍 ≤ −0.21)
= 0.3764 − 0.0136
= 0.3628
The End