Tutorial 5 Solution
Tutorial 5 Solution
Department of Mathematics
QF1100 Introduction to Quantitative Finance (Semester 2, AY22/23)
Tutorial in Week 7
1. Toss a pair of fair dice. Let X be the sum of the faces. Then X is discrete, and
its possible values are 2, 3, . . . , 12. Recall that its pdf was given in our lecture.
Compute E[6X 2 − 7X − 30].
Note that
E[6X 2 − 7X − 30] = 6E[X 2 ] − 7E[X] − 30.
We have
1 2 3 4 5 6 5
E[X] =2 × +3× +4× +5× +6× +7× +8×
36 36 36 36 36 36 36
4 3 2 1
+9× + 10 × + 11 × + 12 ×
36 36 36 36
=7,
and
1 2 3 4 5 6 5
E[X 2 ] =22 × + 32 × + 42 × + 52 × + 62 × + 72 × + 82 ×
36 36 36 36 36 36 36
4 3 2 1
+ 92 × + 102 × + 112 × + 122 ×
36 36 36 36
329
= .
6
Then
329
E[6X 2 − 7X − 30] = 6E[X 2 ] − 7E[X] − 30 = 6 × − 7 × 7 − 30 = 250.
6
2. Define (
a + bx + x2 if 0 ≤ x ≤ 1;
f (x) =
0 otherwise.
Do there exist a and b such that f (x) is a probability density function of a random
variable X with mean E[X] = 23 ? If they exist, find the values of a and b and their
variance.
Firstly, since P (X < ∞) = 1, we have
∞ 1 1 ′
bx2 x3
Z Z Z
2
1 = f (x) dx = (a + bx + x ) dx = ax + + dx
−∞ 0 0 2 3
2 3 x=1
bx x 1 b
= ax + + = +a+ .
2 3 x=0 3 2
1
Secondly, since E[X] = 32 , we have
Z ∞ Z 1 Z 1 2 ′
2 2 3 ax 4x3 bx4
=E[X] = xf (x) dx = (ax + bx + x ) dx = + + dx
3 −∞ 0 0 2 3 4
2 x=1
ax bx3 x4 a b 1
= + + = + + .
2 3 4 x=0 2 3 4
a b 1 2
+ + = . (2)
2 3 4 3
1 b b 5
From (1), a = 2/3 − b/2. Therefore, equation (2) becomes − + = .
3 4 3 12
Then we get b = 1 and a = 2/3 − b/2 = 1/6. That is, f (x) = 1/6 + x + x2 when
0 ≤ x ≤ 1, which is non-negative. Therefore, it is a density function.
To obtain the variance of X, we first find E[X 2 ]:
1 1
x5 x4 x3
Z
2 1 91
E[X ] = x ( + x + x2 ) dx =
2
+ + = .
0 6 5 4 18 0 180
Then
91 4 11
Var(X) = E[X 2 ] − (E[X])2 = − = .
180 9 180
3. (Exponential distribution)
The amount of time, in hours, that a computer functions before breaking down is
a continuous random variable X with probability density function given by
(
λe−x/100 if x ≥ 0
f (x) =
0 if x < 0.
Following Question 5 in Tutorial 4, find its E[X] and the standard derivation σX .
By definition, Z ∞
x −x/100
E[X] = e dx.
0 100
Integrating by parts yields
∞
Z ∞
−x/100
E[X] = − xe + e−x/100 dx
0 0
∞
−x/100
=0 − 100e = 100.
0
2
To obtain the variance of X, we first find E[X 2 ]:
Z ∞ 2
2 x −x/100
E[X ] = e dx.
0 100
Integrating by parts yields
∞
Z ∞
2 −x/100
2
E[X ] = − x e + 2xe−x/100 dx
0 0
=0 − 200E[X] = 20000.
Hence
p p √
σX = Var(X) = E[X 2 ] − E[X]2 = 20000 − 10000 = 100.
Then
3
(c) Var(X), Var(Y ), and Var(Z);
(d) the correlation coefficients ρ(X, Y ), ρ(X, Z), and ρ(Y, Z).
(a).
1 3
pX (1) = p(1, 2, 3) = pX (2) = p(2, 1, 1) + p(2, 2, 1) + p(2, 3, 2) =
4 4
1 1 1
pY (1) = p(2, 1, 1) = pY (2) = p(1, 2, 3) + p(2, 2, 1) = pY (3) = p(2, 3, 2) =
4 2 4
1 1 1
pZ (1) = p(2, 1, 1) + p(2, 2, 1) = pZ (2) = p(2, 3, 2) = pZ (3) = p(1, 2, 3) = .
2 4 4
(b).
1 3 7
E(X) =1 × +2× =
4 4 4
1 1 1
E(Y ) =1 × + 2 × + 3 × = 2
4 2 4
1 1 1 7
E(Z) =1 × + 2 × + 3 × = .
2 4 4 4
(c).
1 3 72 3
Var(X) =12 × + 22 × − 2 =
4 4 4 16
1 1 1 1
Var(Y ) =12 × + 22 × + 32 × − 22 =
4 2 4 2
2
1 1 1 7 11
Var(Z) =12 × + 22 × + 32 × − 2 = .
2 4 4 4 16
√ p
(d). ρ(X, Y ) = 0, ρ(X, Z) = −5/ 33, and ρ(Y, Z) = 2/11.
The tutors will show the details during the tutorials.
6. (Optional) Let X be the normal random variable N (µ, σ 2 ).
Find its variance, i.e., Var(X). Hint: Use the substitution y = (x − µ)/σ and then
integrate by parts.
Since E[X] = µ, we have that
Z ∞
1 2 2
2
(x − µ)2 e−(x−µ) /2σ dx.
Var(X) = E (X − µ) = √ (0.0.1)
2πσ −∞
Substituting y = (x − µ)/σ in Equation (0.0.1) yields
Z ∞
σ2 2
Var(X) = √ y 2 e−y /2 dy
2π −∞
Z ∞
σ2
∞
−y 2 /2 −y 2 /2
=√ − ye + e dy by integration by parts
2π −∞ −∞
Z ∞
2 1 2
=σ √ e−y /2 dy
2π −∞
2
=σ .