Linear Algebra Essentials
Level: 4 (Application — novel problems, no hints) Time: 60 minutes Total Marks: 60
Question 1. (12 marks) A data preprocessing pipeline uses the matrix
(a) Compute the eigenvalues and a set of eigenvectors of . (5)
(b) Write the eigendecomposition explicitly (state , , ). (4)
(c) Using the eigendecomposition, compute without directly multiplying three times. (3)
Question 2. (12 marks) Consider the feature vectors and .
(a) Compute , , and . (3)
(b) Compute the angle between and (give exactly and to the nearest degree). (4)
(c) Compute the vector projection of onto . (3)
(d) A recommender normalizes vectors to unit norm before taking dot products. Explain what geometric quantity the resulting dot product then measures. (2)
Question 3. (12 marks) Solve the linear system by Gaussian elimination and analyze it:
x + 2y + z &= 4 \\ 2x + 5y + 3z &= 7 \\ x + 3y + 2z &= 3 \end{aligned}$$ (a) Reduce the augmented matrix to row echelon form and find the solution. **(7)** (b) State the rank of the coefficient matrix and confirm consistency. **(3)** (c) Compute the determinant of the coefficient matrix and relate its value to invertibility. **(2)** --- **Question 4. (12 marks)** Let $M = \begin{bmatrix} 5 & 2 \\ 2 & 2 \end{bmatrix}$ be a covariance-like matrix. (a) Show $M$ is symmetric and determine whether it is positive definite using the leading principal minors test. **(5)** (b) Write the quadratic form $q(\mathbf{x}) = \mathbf{x}^T M \mathbf{x}$ for $\mathbf{x}=(x_1,x_2)$ explicitly as a polynomial. **(3)** (c) Evaluate $q$ at $\mathbf{x}=(1,-1)$ and confirm it is consistent with your answer in (a). **(2)** (d) State a relationship between the eigenvalues of a symmetric matrix and its positive definiteness. **(2)** --- **Question 5. (12 marks)** Consider the matrix $B = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix}$ (a $2 \times 3$ matrix). (a) Compute $B B^T$ and $B^T B$, and state their dimensions. **(4)** (b) Find the singular values of $B$ (use eigenvalues of $BB^T$). **(4)** (c) State $\operatorname{rank}(B)$ and give a basis for the null space of $B$. **(3)** (d) State one property connecting $\operatorname{trace}(BB^T)$ to the singular values. **(1)** --- *End of paper.*Answer keyMark scheme & solutions
Question 1
(a) Characteristic polynomial: (lower triangular). (1) Eigenvalues , . (1) For : , so . (1.5) For : , so . (1.5)
(b) Ordering : (P columns = eigenvectors, D = eigenvalues.) (4) (1 each for P, D, P⁻¹, consistency)
(c) , . (1) (2)
Question 2
(a) ; ; . (3)
(b) . . (2) , so . (2)
(c) . (3)
(d) After unit-normalization ; the dot product measures the cosine similarity (angle) between the vectors, independent of magnitude. (2)
Question 3
(a) Augmented matrix: : ; : . (2) : . Echelon form: (2) Free variable . From row 2: . From row 1: . (2) Solution: , — infinitely many solutions. (1)
(b) Rank of coefficient matrix (two nonzero rows). Rank of augmented too, so the system is consistent (with free parameter). (3)
(c) . (1) matrix is singular / non-invertible, consistent with rank and non-unique solution. (1)
Question 4
(a) since off-diagonals equal (both ) → symmetric. (1) Leading minors: ; . (3) Both positive → is positive definite (Sylvester's criterion). (1)
(b) . (Cross term .) (3)
(c) , consistent with positive definiteness (positive for all nonzero ). (2)
(d) A symmetric matrix is positive definite iff all its eigenvalues are strictly positive (positive semidefinite iff all ). (2)
Question 5
(a) (2) (2)
(b) Eigenvalues of are and ; singular values are their square roots: . (4)
(c) Two nonzero singular values → . (1) Null space: solve : . Basis . (2)
(d) (sum of squared singular values = Frobenius norm squared). (1)
[
{"claim":"A^3 = [[8,0],[19,27]] via eigendecomposition","code":"A=Matrix([[2,0],[1,3]]); result = (A**3 == Matrix([[8,0],[19,27]]))"},
{"claim":"cos angle u,v = 11/15","code":"u=Matrix([3,4,0]); v=Matrix([1,2,2]); c=(u.dot(v))/(u.norm()*v.norm()); result = simplify(c - Rational(11,15))==0"},
{"claim":"det of Q3 coefficient matrix is 0","code":"C=Matrix([[1,2,1],[2,5,3],[1,3,2]]); result = (C.det()==0)"},
{"claim":"M positive definite: minors 5>0 and det=6>0","code":"M=Matrix([[5,2],[2,2]]); result = (M[0,0]>0) and (M.det()==6)"},
{"claim":"singular values of B are sqrt(2) and 1","code":"B=Matrix([[1,0,1],[0,1,0]]); ev=sorted((B*B.T).eigenvals().keys()); result = (set(ev)=={1,2})"}
]