Birla Institute of Technology & Science, Pilani
Work Integrated Learning Programs Division
Second Semester 2024-2025
Mid-Semester Test Solution
EC-2 Makeup
Course No. : SSCLZC416
Course Title : Mathematical Foundations for Data Science
Nature of Exam : Closed Book
Weightage : 30% No. of Pages = 2
Duration : 2 Hours No. of Questions = 6
Date of Exam : 12-07-2025, AN
Note to Students:
1. Please follow all the Instructions to Candidates given on the cover page of the answer book.
2. All parts of a question should be answered consecutively. Each answer should start from a fresh page.
3. Assumptions made if any, should be stated clearly at the beginning of your answer.
4. Notation used here are as per the text book.
1 0 −1 2
Q1. Let 𝐴 = [ 2 1 −3 4]
0 2 −2 3
1 −1 −4 2
(a) Find the Echelon form of A. [3M]
1 0 −1 2 1 0 −1 2 1 0 −1 2
Ans: 𝐴 = [ 2 1 −3 4] ≈ [ 0 1 −1 0] ≈ [0 1 −1 0] [2𝑀]
0 2 −2 3 0 2 −2 3 0 0 0 3
1 −1 −4 2 0 −1 −3 0 0 0 −4 0
1 0 −1 2
≈ [0 1 −1 0][1M]
0 0 −4 0
0 0 0 3
(b) Using your answer in (a) find the determinant of A. [1M]
Ans: Determinant of A = (-1)*[1*1*(-4)*3] =12 [1M]
1
(c) Suppose 𝑏 = [1], what can you conclude about the solution of the linear system of
1
1
equations AX = b(whether no solution or unique solution or infinite number of solutions) [1M]
Ans: Since in the reduced row echelon form of A, all columns have pivot elements, the system
Ax = b has a unique solution. [1M]
1 0 0
Q2. Consider the matrix 𝐴 = [0 2 −1].
0 −1 2
(a) Prove that A is a symmetric positive definite matrix. [3M]
𝑥1
Ans: Let X= [𝑥2 ] be any non-zero vector in R3.
𝑥3
1 0 0 𝑥1 𝑥1
𝐴𝑋 = [0 2 −1] [ 2 ] = [ 2 − 𝑥3 ] [1M]
𝑥 2𝑥
0 −1 2 𝑥3 −𝑥2 + 2𝑥3
𝑥1
𝑋 𝑇 (𝐴𝑋) = [𝑥1 , 𝑥2 , 𝑥3 ] [ 2𝑥2 − 𝑥3 ] = 𝑥1 2 + 𝑥2 2 + 𝑥3 2 + (𝑥2 − 𝑥3 )2 > 0(since X is non-zero)[2M]
−𝑥2 + 2𝑥3
(b) Using this matrix A, find an inner product on R3. [1M]
𝑦1
< 𝑋, 𝑌 > = 𝑋 𝑇 (𝐴𝑌)
= [𝑥1 , 𝑥2 , 𝑥3 ] [ 2 − 𝑦3 ] = 𝑥1 𝑦1 + 2𝑥2 𝑦2 − 𝑥2 𝑦3 − 𝑥3 𝑦2 + 2𝑥3 𝑦3 [1M]
2𝑦
−𝑦2 + 2𝑦3
1 3
(c) Using the inner product defined in (b) find the angle between the vectors [−1] and [0] [1M]
−2 1
1 3
< [−1] , [0] > = 3 + 0 + 1 − 0 − 4 = 0.
−2 1
Since the inner product is 0, the vectors are orthogonal. [1M]
1 0 0 0 1 0
Q3. Consider the matrices 𝐴 = [0 0 1] and 𝐵 = [0 1 0].
0 0 0 0 0 0
(a) Find the ranks of A and B. [1M]
Since A is in reduced row echelon form and there are two non-zero rows, rank of A is 2. [0.5M]
0 1 0
Since the reduced row echelon form of 𝐵 = [0 0 0], rank of B is 1. [0.5M]
0 0 0
(b) Are the column vectors of A linearly independent? Why? [1M]
Since one of the column vectors is 0 vector, the column vectors are linearly dependent. [1M]
(c) Find bases and dimensions of the subspaces {𝒙 ∈ 𝑅 3 : 𝐴𝒙 = 0} and {𝒙 ∈ 𝑅 3 : 𝐵𝒙 = 0}. [3M]
1 0 0 𝑥1 0
𝑥
𝐴𝒙 = 0 implies [0 0 1] [ 2 ] = [0]. This implies 𝑥1 = 0 and 𝑥3 = 0. [0.5M]
0 0 0 𝑥3 0
0
The Basis is {[1]} [0.5M] and the dimension is 1. [0.5M]
0
0 1 0 𝑥1 0
𝑥
𝐵𝒙 = 0 implies [0 1 0] [ 2 ] = [0]. This implies 𝑥2 = 0. [0.5M]
0 0 0 𝑥3 0
1 0
The Basis is {[0] , [0] } [0.5𝑀] and the dimension is 2. [0.5M]
0 1
1 0
Q4. Suppose 𝐴 = [2 1] and 𝐴 = 𝑈∑𝑉 𝑇 is the singular value decomposition of A. Find the matrices
0 1
∑ and 𝑉 . [no need to find 𝑈]. [5M]
1 0
1 2 0 5 2
Ans: 𝐴𝑇 𝐴 = [ ] [2 1] = [ ] [0.5M]
0 1 1 2 2
0 1
The characteristic equation of 𝐴𝑇 𝐴 is 𝜆2 − 7λ + 6 = 0. [0.5M]
Solving this equation, we get the roots are 6 and 1.
So, the eigen values of 𝐴𝑇 𝐴 are 6 and 1. [0.5M]
√6 0
The matrix ∑= [ 0 1 ] [1M]
0 0
The eigen vector corresponding to 6:
−1 2 𝑥1 0
Solving [ ] [𝑥 ] = [ ] we get 𝑥1 = 2𝑥2 .
2 −4 2 0
2
2
Hence one eigen vector is [ ]. After normalizing, 𝑣1 = [√5
1 ] [1M]
1
√5
The eigen vector corresponding to 1:
4 2 𝑥1 0
Solving [ ] [ ] = [ ] we get 2𝑥1 = −𝑥2 .
2 1 𝑥2 0
1
1 √5
Hence one eigen vector is [ ]. After normalizing, 𝑣2 = [−2 ] [1M]
−2
√5
2 1
√5 √5
Hence the matrix 𝑉=[1 −2
]. [0.5M]
√5 √5
Q5. Consider the function 𝑓(𝑥, 𝑦) = 𝑒 𝑥 (cos 𝑦 + sin 𝑦).
𝜋
(a) Find ∇f(x,y) at (0, 2 ). [2M]
𝑒 𝑥 (cos 𝑦 + sin 𝑦)
Ans: ∇𝑓(𝑥, 𝑦) = [ 𝑥 ] [1M]
𝑒 (cos 𝑦 − sin 𝑦)
𝜋 1
∇𝑓 (0, 2 ) = [ ] [1M]
−1
(b) Suppose if you further consider x, y as functions of r and s given by x(r,s) = 2r + 3s,
𝜕𝑓 𝜕𝑓
y(r, s) = r – s. Using the chain rule find 𝜕𝑟 and 𝜕𝑠 . [3M]
𝜕𝑓 𝜕𝑓 𝜕𝑥 𝜕𝑓 𝜕𝑦
Ans: 𝜕𝑟 = 𝜕𝑥 𝜕𝑟 + 𝜕𝑦 𝜕𝑟 [0.5M]
= [𝑒 𝑥 (cos 𝑦 + sin 𝑦)]2 + [𝑒 𝑥 (cos 𝑦 − sin 𝑦)]1 = 3 𝑒 𝑥 cos 𝑦 + 𝑒 𝑥 sin 𝑦
= 3𝑒 (2𝑟+2𝑠) cos(𝑟 − 𝑠) + 𝑒 (2𝑟+3𝑠) sin(𝑟 − 𝑠) [1M]
𝜕𝑓 𝜕𝑓 𝜕𝑥 𝜕𝑓 𝜕𝑦
= 𝜕𝑥 𝜕𝑠 + 𝜕𝑦 𝜕𝑠 [0.5M]
𝜕𝑠
= [𝑒 𝑥 (cos 𝑦 + sin 𝑦)]3 + [𝑒 𝑥 (cos 𝑦 − sin 𝑦)](−1) = 2 𝑒 𝑥 cos 𝑦 + 4𝑒 𝑥 sin 𝑦
= 2𝑒 (2𝑟+2𝑠) cos(𝑟 − 𝑠) + 4𝑒 (2𝑟+3𝑠) sin(𝑟 − 𝑠) [1M]
Q6. Consider the function 𝑓(𝑥, 𝑦) = 𝑥 3 + 𝑦 3 . −3𝑥 − 12𝑦 − 2.
(a) Find the points of local maximum and local minimum (if any) of the function f(x, y). [3M]
3𝑥 2 − 3 0
∇𝑓(𝑥, 𝑦) = [ 2 ] = [ ] implies 𝑥 = ±1, 𝑦 = ±2.
3𝑦 − 12 0
The points where the function achieves local maximum or minimum are (1, 2), (-1, -2), (1, -2)
and (-1, 2). [1M]
𝑓𝑥𝑥 𝑓𝑥𝑦 6𝑥 0
Hessian of f(x, y) = [ ]=[ ] = 36𝑥𝑦 [0.5M]
𝑓𝑥𝑦 𝑓𝑦𝑦 0 6𝑦
Hessian of f(x, y) at (1, 2) = 72 > 0
Hessian of f(x, y) at (-1, -2) = 72 > 0
Hessian of f(x, y) at (1, -2) = -72 < 0
Hessian of f(x, y) at (-1, 2) = -72 < 0 [0.5M]
So at (1 ,2) and (-1, -2) f(x, y) attains local minimum.
At (1, -2) and (-1, 2) f(x, y) attains local maximum. [1M]
(b) On the line y = 0(x-axis) find the points of local maximum and local minimum of f(x, y). [2M]
On the line y = 0(x-axis), g(𝑥) = f(𝑥, 0) = 𝑥 3 − 3𝑥 − 2
𝑑𝑔
= 3𝑥 2 − 3 = 0 implies 𝑥 = ±1.
𝑑𝑥
The points where the function f(x,y) achieves local maximum or minimum on x-axis are
(1, 0), (-1, 0) [1M]
𝑑2 𝑔 𝑑2 𝑔 𝑑2 𝑔
= 6𝑥. 𝑑𝑥 2 at x =1 = 6 and 𝑑𝑥 2 at x = -1 = -6.
𝑑𝑥 2
So on the x-axis f(x,y) attains maximum at (-1, 0) and minimum at (1, 0). [1M]
-----------------------------------------------------------------------