DAMA_50_exam_resit_22-23
DAMA_50_exam_resit_22-23
DAMA_50_exam_resit_22-23
PART I
Problem 1
+1
2 1 2 3
Given X = ,A = , Y = +1 , the expression X T AY equals
1 4 5 6
−1
3 +3
• −2
• −2 3
−2
• 2
3
• None of these
Problem 2
For a non-rectangular matrix A, which of the following is true
Problem 3
0 1
Given A = , the expression tr(A3 ) equals
1 1
3 4
• 3
• 2
• 1
• 0
1
Problem 4
Consider the function f (x, y, z) = xy + z where x(t) = sin(t), y(t) = cos(t) and z(t) = t. The derivative of
the function with respect to t equals
3 2 cos2 (t)
• 1 + sin(2t)
• 1 + sin(t) + cos(t)
• None of these.
Problem 5
The function f (x, y) = x3 + y 3 − 3xy exhibits two stationary points one at (x, y) = (0, 0) and one at
(x, y) = (1, 1). These are, respectively,
• two minima.
• two maxima.
Problem 6
The gradient of the function f (x, y) = ln x2 + y 2 at (x, y) = (2, 2) equals
3 21 , 12
• 14 , 14
• (4, 4)
• (2, 2)
• (1, 1)
Problem 7
Consider the convex function f (x1 , x2 ) = x21 + 10x22 . Which of the following choices coincides with the
first gradient update x(1) having selected learning rate equal to 0.01 and initial guess x(0) = [0.5, 0.5]T :
2
Problem 8
Consider the independent random variables X and Y have variances 0.2 and 0.5, respectively. Let Z =
5X − 2Y . The variance of the random variable Z equals:
3 7
• 2
• 3
• 6
• None of these.
Problem 9
Suppose f⃗(x1 , x2 ) = (4x1 x2 , x1 + 3x2 )T . Which of the following answers is equal to the determinant of
the Jacobian matrix of f⃗(x1 , x2 )?
3 12x2 − 4x1
• 4x2 − 4x1
• 4x2 − 12x1
• 12x2 − x1
• None of these.
Problem 10
Which of the following expressions is the first defivative of the function f (x) = sin(x100 ) + sin100 (x)?
Problem 11
Which of the following functions is/are convex? √
(a) f (x) = ln(1 + ex ) on R , (b) f (x) = sin(x) on R , (c) f (x) = 1 + x2 on R
• Only (b).
• Only (a).
3
Problem 12
2
If we rotate the vector X = by 45◦ , we obtain the vector
−2
√
2 2
3
0
−2
•
2
2
•
−2
√
2 √2
•
−2 2
• None of these.
Problem 13
The probability of obtaining “heads” when a biased coin is tossed is 0.65. The coin is tossed seven times.
What is the probability of obtaining at least four “heads” ?
3 0.80
• 0.27
• 0.65
• 0.92
• 0.57
Problem 14
0 a b
For which of the following values of the parameters a, b the eigenvalues of the matrix A = a b 0 ,
b 0 b
are +1,-1,-2 ?
3 a = 1, b = −1
• a = −1, b = 0
• a = 1, b = 2
• a = 0, b = −1
• a = 1, b = 1
Problem 15
For which value of the parameter λ the system
3x + 2y = 10
6x + 4y = λ
4
3 λ = 20
• λ = 10
• λ=0
• λ=4
• λ=6
PART II
The following problems should be solved using by hand calculation. The answers should be handwritten,
scanned and uploaded in pdf format.
Problem 1
Consider the matrix
0 2 0
A= 2 0 0
0 0 1
−λ 2 0
det(A − λ1) = 0 ⇒ 2 −λ 0 = 0 ⇒ (1 − λ) λ2 − 22 = 0 ⇒
0 0 1−λ
(λ − 1) (λ − 2) (λ + 2) = 0 ⇒ λ = 2, 1, −2 (16.1)
AX = λX (16.2)
Similarly, for λ = 1
−1 2 0 x 0 −x + 2y = 0
2 −1 0 y = 0 ⇒ 2x − y = 0 ⇒x=y=0 (16.5)
0 0 1−1 z 0 0z = 0
5
Thus the eigenvector is
0 0
v2 = 0 , imposing v1T v1 = 1 ⇒ z 2 = 1 ⇒ z = 1 ⇒ v2 = 0 (16.6)
z 1
Finally, for λ = −2
2 2 0 x 0 2x + 2y = 0
2 2 0 y = 0 ⇒ 2x + 2y = 0 ⇒ y = −x, z = 0 (16.7)
0 0 1−2 z 0 −z = 0
(c) By definition, the matrix Ad is a diagonal matrix with entries the eigenvalues of A
2 0 0
Ad = 0 1 0 (16.9)
0 0 −2
and the matrix P is the matrix whose columns are the eigenvectors of A
1 0 1
1
P = √ 1 √0 −1 (16.10)
2 0 2 0
Problem 2
Using by hand calculation, compute the Taylor expansion of the function f (x, y) = sin(xy) around the
point ⃗x0 = (0, 0)T taking into account terms up to and including second order in x, y.
Solution
We will use the Taylor expansion
6
and
∂2f ∂ ∂f ∂
= = (y cos(xy)) = −y 2 sin(xy) (17.6)
∂x2 ∂x ∂x ∂x
∂2f ∂ ∂f ∂
= = (x cos(xy)) = −x2 sin(xy) (17.7)
∂y 2 ∂y ∂y ∂y
∂2f ∂ ∂f ∂
= = (x cos(xy)) = cos(xy) − xy sin(xy) (17.8)
∂x∂y ∂x ∂y ∂x
∂2f ∂2f
= = cos(xy) − xy sin(xy) (17.9)
∂y∂x ∂x∂y
Thus
∇f
⃗ (x, y) = (y cos(xy), x cos(xy)) ⇒ ∇f
⃗ (0, 0) = (0, 0) (17.10)
and
−y 2 sin(xy) cos(xy) − xy sin(xy) 0 1
H(x, y) = ⇒ H(0, 0) = (17.11)
cos(xy) − xy sin(xy) −x2 sin(xy) 1 0
7
PART III
The following problems should be solved utilising Sagemath and a sagemath/jupyter notebook. The solution
notebook should be uploaded in its original form (.ipynb file).
Problem 1
Consider the following two sets of vectors
Using Sagemath
(a) find which of these sets is/are basis/es in R3 . Comment on the result. [20%]
For the set/s that is/are basis/es
(b) construct the corresponding orthonormal basis e1 , e2 , e3 ; [20%]
(c) verify that the vectors e1 , e2 , e3 are indeed orthonormal; [20%]
(d) write the vector ⃗k = (1, 2, 3) in the basis e1 , e2 , e3 ; [20%]
(e) check whether the change of basis of question (d) preserves the norm of ⃗k. Comment on the result.
[20%]
Solution
8
9
Problem 2
Using sagemath and working numerically
(a) find a local minimum of the function
starting from the point x0 = (5, −1) and utilising two different algorithms (one using the derivatives and
one not using them). Derive the number of function calls utilised in each algorithm and compare the two
algorithms. [40%]
(b) Compute the function value and the gradient value at the minimum. [20%]
(c) Plot the above function using a contour plot (with appropriate parameter bounds) and depict the
position of the minimum. [20%]
(d) find a local minimum of f (x, y) in the region x2 + y 2 < 2 starting from the point x0 = (1/2, 1/2). [20%]
Solution
10
11