Week-5 GA Solution 1
Week-5 GA Solution 1
1. A person randomly chooses a battery from a store which has 40 batteries of type A and
60 batteries of type B. Battery life of type A and type B batteries are exponentially
distributed with average life of 4 years and 6 years, respectively. If the chosen battery
lasts for 5 years, what is the probability that the battery is of type A?
1
(a) 5
1 + e 12
1
(b) −5
1 + e 12
−4
e 5
(c) −6
1+e 5
−6
e 5
(d) −4
1+e 5
Solution:
Define a event X as follows:
(
1 If the chosen battery is of type A
X=
0 If the chosen battery is of type B
Y |X = 0 ∼ Exp( 16 )
It implies that
−y
fY |X=1 (y) = 14 e 4 ; y > 0 and
−y
fY |X=0 (y) = 16 e 6 ;y > 0
fY |X=1 (5).P (X = 1)
fX|Y =5 (1) =
fY (5)
fY |X=1 (5).P (X = 1)
=
fY |X=1 (5).P (X = 1) + fY |X=0 (5).P (X = 0)
1 −5
4
e 4 . 52
= 1 −5 −5
4
e 4 . 52 + 16 e 6 . 35
1 −5
10
e4
= 1 −5
1 −5
10
e 4 + 10 e6
−5
e 4
= −5 −5
e 4+e 6
1
= 5
1 + e 12
3 exp( 18 )
(a)
3 exp( 18 ) + 6 + 2 exp( 29 )
3 exp( −1
8
)
(b)
3 exp( 8 ) + 6 + 2 exp( −2
−1
9
)
2 exp( −2
9
)
(c)
3 exp( 8 ) + 6 + 2 exp( −2
−1
9
)
6
(d)
3 exp( 32 ) + 6 + 2 exp( −1
−1
18
)
Solution:
Page 2
Given that X ∼ Uniform{1, 2, 3} and Z ∼ Normal(1, 4) are independent.
Y = XZ + X
It implies that
Y |X = 1 = Z + 1 ∼ Normal(2, 4)
Y |X = 2 = 2Z + 2 ∼ Normal(4, 16)
Y |X = 3 = 3Z + 3 ∼ Normal(6, 36)
Therefore,
−(y−2)2
fY |X=1 (y) = √1 exp
2 2π 8
−(y−4)2
fY |X=2 (y) = √1 exp
4 2π 32
−(y−6)2
fY |X=3 (y) = √1 exp
6 2π 72
−(2−4)2
√1 exp . 13
4 2π 32
=
−(2−4)2 −(2−2)2 −(2−6)2
√1 exp . 31 + √1 exp . 13 + √1 exp . 31
4 2π 32 2 2π 8 6 2π 72
exp −1 1
8 4
= 1 −1
1 −2
+ 16 exp
4
exp 8
+ 2
exp(0) 9
3 exp( −1
8
)
=
3 exp( −1
8
) + 6 + 2 exp( −2
9
)
a) (
1 0<y<1
fY (y) =
0 otherwise
Page 3
b) (
(1 − y)3 0<y<1
fY (y) =
0 otherwise
c) (
y3 0<y<1
fY (y) =
0 otherwise
d) (
3y 2/3 0<y<1
fY (y) =
0 otherwise
Hint:
d
Apply the monotonic, differentiable function theorem and (1 − x)3 = −3(1 − x)2
dx
Solution:
We know that in the range (0, 1), (1 − x)3 is monotonic (decreasing function).
1
Therefore, we can use the formula, fY (y) = ′ −1 fX (g −1 (y))
|g (g (y))|
And
g ′ (g −1 (y)) = g ′ (1 − y 1/3 ) = −3(1 − (1 − y 1/3 ))2 = −3y 2/3
|g ′ (g −1 (y))| = 3y 2/3 , since y 2/3 is positive in the range (0, 1).
fX (g −1 (y)) = fX (1 − y 1/3 ) = 3(1 − (1 − y 1/3 ))2 = 3y 2/3
3y 2/3
Therefore, fY (y) = 2/3
3y
⇒ fY (y) = 1
Therefore
(
1 0<y<1
fY (y) =
0 otherwise
Page 4
Define Y = 13 (12 − X). Find the PDF of the random variable Y .
a) (
(12 − 3y)2 /27 −6 < y < 3
fY (y) =
0 otherwise
b) (
(12 − 3y)2 /27 3 < y < 6
fY (y) =
0 otherwise
c) (
(12 − 3y)/27 −6 < y < 3
fY (y) =
0 otherwise
d) (
(12 − 3y)/27 3 < y < 6
fY (y) =
0 otherwise
Solution:
We know that in the range (-6, 3), 13 (12 − x) is monotonic (decreasing function).
1
Therefore, we can use the formula, fY (y) = ′ −1 fX (g −1 (y))
|g (g (y))|
And
g ′ (g −1 (y)) = g ′ (12 − 3y) = − 13
|g ′ (g −1 (y))| = 13
(12 − 3y)2
fX (g −1 (y)) = fX (12 − 3y) =
81
(12 − 3y)2
Therefore, fY (y) = 81
1
3
(12 − 3y)2
⇒ fY (y) =
27
When x = −6, y = 6 and x = 3, y = 3.
Page 5
Therefore
(12 − 3y)2
3<y<6
fY (y) = 27
0 otherwise
Page 6
Define Y = 6X + 5. Find the variance of Y.
Rb 1
Use a
xn dx = n+1
(bn+1 − an+1 )
Rb Rc Rb
Also, a
xn dx = a
xn dx + c
xn dx where a < c < b.
Solution:
Var(Y ) = Var(6X + 5) = 36Var(X)
And Var(X) = E[X 2 ] − (E[X])2
Z ∞
E[X] = xfX (x)dx
−∞
Z 2
= xfX (x)dx
0
Z 1 Z 2
= xfX (x)dx + xfX (x)dx
0 1
Z 1 Z 2
= x.xdx + x(2 − x)dx
0 1
1 2 2
x3 2x2 x3
= + −
3 2 3
0 1 1
1 (23 − 13 )
= + (22 − 12 ) −
3 3
1 7
= +3−
3 3
=1
Page 7
Z ∞
2
E[X ] = x2 fX (x)dx
−∞
Z 2
= x2 fX (x)dx
Z0 1 Z 2
2
= x fX (x)dx + x2 fX (x)dx
Z0 1 Z 2 1
= x2 .xdx + x2 (2 − x)dx
0 1
1 2 2
x4 2x3 x4
= + −
4 3 4
0 1 1
1 2 1
= + (23 − 13 ) − (24 − 14 )
4 3 4
1 14 15
= + −
4 3 4
7
=
6
Therefore,
Var(X) = 76 − 1 = 16
⇒ Var(Y ) = 36 × 16 = 6
Page 8
y−9
Therefore, g −1 (y) =
2
g(x) = 2x + 9 ⇒ g ′ (x) = 2
Therefore,
fX (g −1 (y))
fY (y) = ′ −1
| g (g (y)) |
y−9
fX
2
=
y − 9
| g′ |
2
2
y−9
1 1 −3
√ e− 2
2 2
2 2π
=
2
1 (y − 15)2
= √ e−
4 2π 32
8. Suppose X is a continuous random variable with mean 50 and variance 16. Using Cheby-
shev inequality, find the greatest lower bound of the probability that X takes a value in
between 42 and 58.
(Enter the answer correct to two decimal places)
Solution:
Using Chebyshev inequality, we know that for any random variable X
Var(X)
P (| X − E[X] |≤ c) ≥ 1 − . . . (1)
c2
16 1 3
Therefore, the greatest lower bound is 1 − 2
= 1 − = = 0.75.
8 4 4
Page 9
9. A passenger train arrives punctually at a station every 20 minutes. Each morning, a
passenger walks in to the train station. Let X denote the amount of time (in minutes)
the passenger waits for the train from the time he reaches the train station. It is known
that the probability density function of X is
1, if 0 < x < 20
fX (x) = 20
0, Otherwise
Solution:
The expectation of a function of random variable g(X) is given by,
Z ∞
E[g(X)] = g(x)fX (x) dx
−∞
Expectation of X 3 is given by
Z ∞
1
E[g(X)] = x3
dx
−∞ 20
Z 20
1
= x3 dx
0 20
4 20
1 x
=
20 4 0
1 204
= ×
20 4
E[g(X)] = 2000
10. 60% of the total people in a city were male and 40% were female. The age of the males is
Normal (60, 25) and the age of the females is Normal (55, 36). If the age of a randomly
selected person is 60, what is the probability that the selected candidate is male?
9
(a)
−25
9 + 5exp( )
72
3
(b)
−25
3 + 5exp( )
72
Page 10
9
(c)
−5
9 + 5exp( )
6
3
(d)
−5
3 + exp( )
6
Solution:
Define a event X as follows:
(
1 If the person chosen is a male
X=
0 If the person chosen is a female
It implies that
1 y − 60 2
−
1
fY |X=1 (y) = √ e 2 5 ; y > 0 and
5 2π
1 y − 55 2
−
1
fY |X=0 (y) = √ e 2 6 ;y > 0
6 2π
60 3 40 2
P (X = 1) = = and P (X = 0) = =
100 5 100 5
Page 11
To find: fX|Y =60 (1). Now,
fY |X=1 (60).P (X = 1)
fX|Y =60 (1) =
fY (60)
fY |X=1 (60).P (X = 1)
=
fY |X=1 (60).P (X = 1) + fY |X=0 (60).P (X = 0)
1 60 − 60 2
−
1 3
√ e 2 5
5 2π 5
= 2
1 60 − 60 1 60 − 55 2
− −
1 3 1 2
√ e 2 5 + √ e 2 6
5 2π 5 6 2π 5
1 3
√
5 2π 5
=
1 25
−
1 3 1 2
√ + √ e 2 36
5 2π 5 6 2π 5
9
=
−25
9 + 5exp
72
11. Let X ∼ Uniform[0, 1] be a continuous random variable. Define a new random variable
Y = − log(X).
(i) Find the probability density function of Y .
(a) fY (y) = e−y , for y > 0.
(b) fY (y) = 1 − e−y , for y > 0.
(c) fY (y) = 1 − ey , for y > 0.
(d) fY (y) = ey , for y > 0.
Solution:
Given, X ∼ Uniform[0, 1]
So, fX (x) = 1
We know that in the range [0, 1], − log(x) is monotonic (decreasing function).
1
Therefore, we can use the formula, fY (y) = ′ −1 fX (g −1 (y))
|g (g (y))|
Given, Y = − log(x) = g(x) (let)
=⇒ −y = log(x) =⇒ exp(−y) = exp(log(x)) =⇒ x = exp(−y) = g −1 (x)
Therefore, g −1 (x) = exp(−y)
−1
g(x) = − log(x) =⇒ g ′ (x) =
x
Page 12
And
−1
g ′ (g −1 (y)) =
exp(−y)
1
|g ′ (g −1 (y))| =
exp(−y)
fX (g −1 (y)) = fX (exp(−y)) = 1
1
Therefore, fY (y) = = exp(−y)
1
exp(−y)
Therefore
Solution :
Z ∞
E[Y ] = yfY (y)dy
Z−∞
∞
= y × exp(−y)dy − − − − − − eq(1)
0
Z
I= y × exp(−y)dy
Z
= −y exp(−y) − − exp(−y)dy {Using Integrate by parts}
Z
= −y exp(−y) − exp(−y) + C {Since, − exp(−y) = exp(−y)}
Alternative method:
(
exp(−y) y ≥ 0,
fY (y) =
0 y<0
Page 13
On comparing with PDF of exponential distribution
(
λ exp(−λy) y ≥ 0,
fY (y) =
0 y<0
We get λ = 1
Therefore,
Y ∼ exp(1)
So,
1
E[Y ] = =1
λ
12. Let X be a continuous uniform random variable on [0, 100]. Define f (x) as
(
2(a − x), if x ≤ a
f (x) =
x − a, if x > a,
where a is a real number between 0 and 100. What value should you choose for a to
minimize the expected value of f (X)? Enter the answer correct to two decimal places.
Solution:
Given, X ∼ Uniform[0, 100]
1
fX (x) =
100
The expectation of a function of random variable g(X) is given by,
Z a Z 100
1 1
E[f (X)] = 2(a − x) · dx + (x − a) · dx
0 100 a 100
a 100
x2 1 x2
2
= ax − + − ax
100 2 0 100 2 a
2 2
a2
2 2 a 1 100 2
= a − + − a · 100 − +a
100 2 100 2 2
a2 1002 a2
1
= + − 100a +
100 100 2 2
2 2
a 100 a
= + −a+
100 2 200
3a2
= + 50 − a
200
Page 14
To minimize E[f (X)], we differentiate it with respect to a and set the derivative equal
to zero:
d 6a
E[f (X)] = −1=0
da 200
Solving for a, we get:
6a 200
= 1 =⇒ a = = 33.33
200 6
13. The probability density function of a continuous random variable X is given by
(
1
ax + 10 , 1≤x≤2
fX (x) =
0, otherwise.
(a) Find the distribution of Y = 3X + 2.
2y − 3 , 5 ≤ x ≤ 8
(A) fY (y) = 10
0, otherwise.
2y − 3 , 5 ≤ x ≤ 8
(B) fY (y) = 30
0, otherwise.
2y + 3 , 1 ≤ x ≤ 2
(C) fY (y) = 30
0, otherwise.
y − 2, 5 ≤ x ≤ 8
(D) fY (y) = 3
0, otherwise.
Answer : (B)
Solution :
First of all we will find out the value of a in the above function and we know that
the integration of a pdf over the entire range is equal to 1, Therefore,
Z 2
1
ax + =1
1 10
2 2
x x
a + =1
2 10 1
2 a 1
2a + − + =1
10 2 10
3a 1
+ =1
2 10
3
a=
5
Page 15
Now, as Y = 3X + 2 is a monotonic function and differential function. Therefore,
g(x) = 3X + 2
g ′ (x) = 3
And,
Y −2
X=
3
Y −2
g −1 (y) =
3
Now putting all the values in the below formula:
1 −1
f (y) = fx (g (y))
|g ′ (g −1 (y))|
we get,
1 3 y−2 1
f (y) = +
3 5 3 10
1 y−2 1
f (y) = +
3 5 10
2y − 4 + 1
f (y) =
30
2y − 3
f (y) =
30
Hence, the distribution of Y = 3X + 2 is
2y − 3 , 5 ≤ x ≤ 8
fY (y) = 30
0, otherwise.
(b) Find the value of E(Y ). Enter the answer up to two decimal places.
8
2y − 3
Z
E(Y ) = y
5 30
8
2y 2 − 3y
Z
E(Y ) =
5 30
Page 16
8
1 2y 3 3y 2
E(Y ) = −
30 3 2 5
1197
E(Y ) =
180
E(Y ) = 6.65
14. In an university, 30% of the students enrolled in a math course are from the science
stream, while 70% are from the commerce stream. The exam scores for science stream
students follows N (55, 36), and the exam scores for commerce stream students follows
N (60, 25). If a randomly selected student scored 60 in the exam, what is the probability
that the student is from the commerce stream? Enter the answer up to two decimal
places.
Answer : 0.80 , Range : 0.76 - 0.84
Solution :
Let X represent the stream of the student.
Thus, P (X = S) = 0.30 and P (X = C) = 0.70. Also it is given that,
P (Y |X = S) ∼ N (55, 36)
P (Y |X = C) ∼ N (60, 25)
where S = Science stream, C = commerce stream
Now,
Page 17
" 2 # " 2 #
1 −1 y − 60 1 −1 y − 55
fY (y) = 0.7 × √ exp + 0.3 × √ exp
2π5 2 5 2π6 2 6
−(60 − 60)2
7
√ exp
50 2π 50
P (X = C|Y = 60) = 2
−(60 − 55)2
7 −(60 − 60) 1
√ exp + √ exp
50 2π 50 20 2π 72
7
P (X = C|Y = 60) = 50
7 1 −25
+ exp
50 20 72
0.14
P (X = C|Y = 60) =
0.14 + 0.035
Page 18