Final Exam 2023 - Solutions
Final Exam 2023 - Solutions
dr. A. Zocca
1st June 2023, 15:30 – 17:30 (+30 min for extra timers)
The exam consists of six exercises worth a total of 95 points = 10 + 15 + 25 + 15 + 10 + 20. The midterm
exam grade is calculated as 1 + (your points)/10 (the maximum is thus 10.5). The exam lasts for
2h (+ 30 min for extra timers). Do not forget to add the name of the formula you are using and/or
explanations next to your algebraic/numerical solutions. No book and no notes, you are allowed to use
only a simple calculator.
Solution:
(a) It means that P(X > s + t | X > t) = P(X > s) for every s, t ≥ 0.
1
(b) The density of X is given by fX (x) = 15 e− 5 x 1{x≥0} .
The required probability can be calculated as
Z 2
1 2 1
P(1 ≤ X ≤ 2) = fX (x)dx = [−e− 5 x ]21 = −e− 5 + e− 5 ≈ 0.1484.
1
FY (y) = P(Y ≤ y) = P(e−X/5 ≤ y) = P(−X/5 ≤ log y) = P(X ≥ −5 log y) = 1 − FX (−5 log y).
and, hence,
d d −5
fY (y) = FY (y) = (1 − FX (−5 log y)) = −fX (−5 log y) · = · · · = 1.
dy dy y
(c) [3 points] Let Y be equal to the number of indices i ∈ {1, 2, . . . , 100} for which Xi > 0. Using (a),
conclude which is the distribution of Y .
(d) [6 points] Using the Central Limit Theorem and the continuity correction, give an approximation of
the probability P(45 < Y ≤ 52).
Solution:
(a) Since Xi is a standard normal r.v., whose density is symmetric around the origin, we can immediately
conclude that P(Xi > 0) = 12 .
(b) The sum of four independent normal r.v.’s is itself normal , and specifically X1 + X2 + X3 + X4 ∼
N (0, 4).
X1 + X2 + X3 + X4
P −1≤ ≤ 1 = P − 4 ≤ X1 + X2 + X3 + X4 ≤ 4
4
X1 + X2 + X3 + X4
=P −2≤ √ ≤2
4
= Φ(2) − Φ(−2)
= Φ(2) − (1 − Φ(2))
= 2Φ(2) − 1
≈ 2 · 0.9772 − 1 = 0.9544
(c) Thanks to the independence assumption about the Xi ’s , Y is a binomial distribution with n = 100
and, in view of (a), p = 12 . In symbols, Y ∼ Bin(100, 21 ) .
(d) Using the continuity correction, P(45 < Y ≤ 52) = P(45.5 ≤ Y ≤ 52.5). Y is a r.v. with mean
np = 50 and variance np(1 − p) = 25 . Therefore,
45.5 − 50 Y − 50 52.5 − 50
P(45.5 ≤ Y ≤ 52.5) = P √ ≤ √ ≤ √
25 25 25
≈ Φ(0.5) − Φ(−0.9)
= Φ(0.5) − (1 − Φ(0.9))
≈ 0.6915 − (1 − 0.8159) = 0.5074
Exercise 3 [25 points = 5 + 5 + 5 + 5 + 5]
Let (X, Y ) be the random vectors, whose components describe the two coordinates of a point distributed
uniformly at random over the set D ⊂ R2 defined as
(a) [5 points] Draw the set D, calculate its area, and derive an explicit expression for the joint probability
density fX,Y (x, y).
X
(b) [5 points] Calculate P(Y > e 2 ).
(c) [5 points] Calculate E[XY ]. Are X and Y independent?
(d) [5 points] Calculate the density of the random variable Z = X + Y .
(e) [5 points] Calculate Cov(2X − 1, −Y + 2) and Cov(Z, X).
Hint: You do not need the answer to question (d) to make these calculations!
Solution:
(a) The set D is drawn in the figure below.
1
The joint density corresponding to the uniform distribution over D is equal to fX,Y (x, y) = Area(D) =
1
e2 −1
.
X
(b) We can think of the event {Y > e 2 } as a subset of points in the plane, say B = {(x, y) ∈ D : ex/2 <
y < ex , 0 < x < 2} ⊂ D ⊂ R2 . Then,
Z
X
P(Y > e 2 ) = fX,Y (x, y) dxdy
B
Z 2 Z ex
1 1 h x x/2
i2
= 2
dydx = e − 2e
0 ex/2 e − 1 e2 − 1 0
1 − 2e + e 2 e−1
= = ≈ 0.4621.
e2 − 1 e+1
(c) We first calculate
Z
E[XY ] = x · y · fX,Y (x, y) dxdy
R2
Z 2 Z ex Z 2 ex
xy xy 2
= dydx = dx
0 0 e2 − 1 0 2 (e2 − 1) 0
" #2
2
e2x x e2x x2 − 41
Z
= dx =
0 2 (e2 − 1) 2 (e2 − 1)
0
1 + 3e4
= ≈ 3.224
8 (e2 − 1)
and
2 Z ex 2 ex 2
y2 e2x
Z Z Z Z
y
EY = y · fX,Y (x, y) dxdy = 2
dydx = dx = dx
R2 0 0 e −1 0 2 (e2 − 1) 0 0 2 (e2 − 1)
2
e2x
1
1 + e2 ≈ 2.097.
= =
4 (e2 − 1) 0 4
2
(1+e2 )·(1+e2 ) (1+e2 )
Therefore, EX · EY = (e2 −1)4
= 4(e2 −1)
≈ 2.754, so in particular E[XY ] ̸= EX · EY , so X and Y
are not independent.
(d) In view of the geometry of the subset D and the fact that Z = X + Y , we must have Z ∈ [0, 2 + e2 ].
The density fZ (z) must then be equal to zero for z < 0 and for z > 2 + e2 .
Consider
Z +∞ now the case z ∈ (0, 2 + e2 ). We calculate the required density using the formula fZ (z) =
f (x, z − x) dx which yields
−∞
Z 2
1
fZ (z) = 1 1 x dx.
0 e2 − 1 {z−x>0} {z−x<e }
Let x∗ (z) ∈ R be the unique real number that solves the equation z − x = ex . The fact that this point
exists and is unique can be proved graphically by checking for the intersection of the line y = z − x and
of the function y = ex . The integral above then becomes
Z 2
1
fZ (z) = 2
1{x<z} 1{x>x∗ (z)} dx
0 e −1
Z min{2,z}
1
= 2
dx
max{0,x∗ (z)} e − 1
z
e2 −1
if z ≤ 1,
1 ∗ 1 ∗
= 2 (min{2, z} − max{0, x (z)}) = e2 −1 (z − x (z)) if 1 < z ≤ 2,
e −1
(2 − x∗ (z)) if 2 < z ≤ 2 + e2 .
1
e2 −1
0.20
0.15
0.10
0.05
-2 2 4 6 8 10
(e) Using the bilinearity of the covariance operator , we can conclude that
Using again the bilinearity of the covariance operator, we can conclude that
To obtain the final answer, we need to calculate the variance of X, for which we need to obtain the
second moment of X (since we already calculated EX). Thus,
Z 2 Z ex Z 2 2 ex Z 2 x 2
x2
Z
2 2 x y e x
E(X ) = x · fX,Y (x, y) dxdy = 2
dydx = 2
dx = 2
dx
R2 0 0 e −1 0 e −1 0 0 e −1
" #2
ex x2 − 2x + 2
= =2
e2 − 1
0
The variance is then Var(X) = E(X 2 ) − (EX)2 ≈ 2 − 1.313 = 0.687 and Cov(Z, X) ≈ 0.687 + 0.47 = 1.157.
(a) [4 points] Find the value of c such that f is a well-defined probability density.
(b) [5 points] Calculate the expected value of X and its variance.
X2
(c) [6 points] Derive the probability density function fY (y) of the random variable Y = 3 .
Solution:
R +∞
(a) We must have −∞ f (x) dx = 1, therefore
1
Z +∞ Z 0 Z Z +∞
5 5x 2 13 1 c 13
1= f (x) dx = e dx + cx2 dx + 4
dx = + + .
−∞ −∞ 3 0 1 64x 3 24 24
2
Solving for c, gives c = 3. This is a valid value because the resulting density is always non-negative.
(b)
R +∞
Using the formula EX = −∞ x · f (x) dx , we get
1
Z 0 Z Z +∞
5 2 13 1 3 13 371
EX = x e5x dx + 2
x · 3x dx + x 4
dx = − + + = ≈ 0.3865.
−∞ 3 0 1
2
64x 15 64 32 960
R +∞
We first calculate the second moment of X. Since E(X 2 ) = −∞ x2 · f (x) dx , we get
1
Z 0 Z Z +∞
5 2 13 2 3 13 271
E(X 2 ) = x2 e5x dx + x2 · 3x2 dx + x2 4
dx = + + = ≈ 0.4516.
−∞ 3 0 1 64x 75 160 32 600
2
fY (y) = 0, ∀ y ≤ 0.
We can then obtain the expressions of the pdf fY (y) for y > 0 by taking the first derivative of FY (y), i.e.,
√
5e−5 3y 9p 1
if 0 < y ≤ 12
2 √ + 3y ,
d
3 3y
√
2
fY (y) = FY (y) =
dy 5e−5 3y 13 1
2√ + if y > 12 .
p
3 3y 384 3y 5
1
X
fX (x) · 2 if y > 0,
fY (y) = x:x2 =3y 3x
0 if y ≤ 0.
p
fX (− 3y) · 1 p 1
2√ + fX ( 3y) · 2√ if y > 0,
= − 3 3y 3 3y
0 if y ≤ 0.
Focusing only on the y > 0 case, we need to distinguish two cases, depending on whether the argument
√ √
3y of fX (·) is above or below 12 , since the density fX is defined differently. Solving 3y = 12 yields the
1
threshold value y = 12 . Then,
√ √
fX (− 3y) fX ( 3y)
1
√ + 2√ if 0 < y ≤ 12 ,
− 23 √3y
3y
fY (y) = 3 √
fX (− 3y) fX ( 3y) 1
√ + 2√ if y > 12 ,
− 23 3y
3 3y
5 −5√3y √
3e√ 3( 3y)2 1
+ 2√ if 0 < y ≤ 12 ,
2 3y
3y
3
= 5 −5√3y 3
13
√
3e 64( 3y)4
1
2√ + 2√ if y > 12 ,
3 3y 3 3y
√
5e−5 3y 9p 1
if 0 < y ≤ 12
2√ + 3y ,
3 3y
√
2
=
5e−5 3y 13 1
2√ + if y > 12 .
p
3 3y 384 3y 5
Solution:
First solution method
(a) The random variable X rewrites as X = X1 + · · · + X16 where Xi is the binary random variable
defined as
(
1 if BA student is seated at chair i with one Math and one BA neighbor,
Xi =
0 otherwise.
(a) [5 points] Derive the marginal density fY (y). What is the distribution of Y ?
(b) [5 points] Derive the conditional density fX|Y (x|y).
(c) [5 points] Calculate P(X > 1 | Y = y).
(d) [5 points] Calculate E(X | Y = y).
Hint: You can use (without proving it) that for every a, b ̸= 0 the antiderivative of the function
a
ax · ebx is the function 2 ebx (bx − 1).
b
Solution:
R +∞
(a) Since fY (y) = −∞ fX,Y (x, y) dx, we get that for y ≤ 0 fY (y) = 0 , while for y > 0
Z +∞ +∞
x
−2 +y −1 −2 x +y
fY (y) = 4e y
y dx = −2e y
= 2e−2y .
−∞ −∞
Alternative solution:
The same answer could also be obtained by noticing from (b) that r.v. X|Y = y is exponentially distributed
with parameter y2 and using the well-known CDF of the exponential distribution.
(d) We can calculate
Z +∞ Z +∞ +∞
−2 x
y −1
1 − 2x y
E(X | Y = y) = x · fX|Y (x|y) dx = x · 2e y = − e y (2x + y) = .
−∞ 0 2 0 2
Alternative solution:
The same answer could also be obtained by noticing from (b) that r.v. X|Y = y is exponentially
distributed with parameter λ = y2 and using the well-known formula for the expected value of the
exponential distribution, we get E(X|Y = y) = λ1 = y2 .