Linear Algebra Essentials
Level 5 — Mastery (cross-domain: math + physics + coding, build/prove) Time limit: 90 minutes Total marks: 60
Instructions: Answer all three questions. Show all reasoning. Proofs must be rigorous; code may be written in NumPy-style pseudocode but must be dimensionally correct and executable in spirit.
Question 1 — Spectral theory and positive definiteness (20 marks)
Let be symmetric, and consider the quadratic form .
(a) Prove that every eigenvalue of a real symmetric matrix is real, and that eigenvectors corresponding to distinct eigenvalues are orthogonal. (6 marks)
(b) Using the eigendecomposition (with orthogonal), prove that is positive definite if and only if all eigenvalues . (5 marks)
(c) Consider the specific matrix Compute its eigenvalues. Determine whether is positive definite, and state the minimum value of subject to (justify via the Rayleigh quotient). (6 marks)
(d) Physics link: above models the stiffness matrix of three masses connected by springs (spring constant 1) with fixed walls. Explain in one or two sentences what positive definiteness guarantees physically about the equilibrium. (3 marks)
Question 2 — SVD, rank, and least squares (22 marks)
Let
(a) Compute and give an explicit basis for its column space and its null space. (6 marks)
(b) Prove that for any real matrix , the nonzero singular values of are the square roots of the nonzero eigenvalues of , and that number of nonzero singular values. (6 marks)
(c) Compute the singular values of above (you may leave them as exact surds or 4-decimal numbers). (5 marks)
(d) Coding/derivation: Write NumPy-style pseudocode that, given a full SVD and a vector , returns the minimum-norm least-squares solution to using the pseudoinverse. Explain why truncating tiny singular values (below tolerance ) improves numerical stability, referencing the condition number. (5 marks)
Question 3 — Trace, orthogonality, and a build/prove synthesis (18 marks)
(a) Prove the cyclic property of the trace: for conformable matrices, starting from . (5 marks)
(b) Show that for any matrix , , where are singular values. (5 marks)
(c) Build/prove: Let be orthogonal. Prove that preserves the norm () and preserves dot products. Then prove and . (8 marks)
Answer keyMark scheme & solutions
Question 1
(a) [6 marks] Let , . Take conjugate transpose: (using real symmetric so ). Then Since , , so . (3) For distinct eigenvalues with , : So . (3)
(b) [5 marks] where . (2) Since is orthogonal (invertible), . () If all , then for ⇒ PD. (1.5) () If some , choose (i.e. , the eigenvector), giving ⇒ not PD. Contrapositive complete. (1.5)
(c) [6 marks] Characteristic polynomial of the tridiagonal matrix (size 3): eigenvalues are , : (3) All positive ⇒ is positive definite. (1) By the Rayleigh quotient, , attained at the corresponding unit eigenvector. (2)
(d) [3 marks] Positive definiteness means the potential energy is strictly positive for any nonzero displacement, so the equilibrium at is a strict energy minimum — the system is stable; any displacement raises the elastic energy and produces restoring forces. (3)
Question 2
(a) [6 marks] Row 3 = Row 1 + Row 2, and column 3 = column 1 + column 2. So . (2) Column space basis: (columns 1 and 2, independent). (2) Null space: solve . From column dependence ⇒ null vector . Basis: (dim = ). (2)
(b) [6 marks] is symmetric PSD, so it has orthonormal eigenvectors with eigenvalues : . (2) Define . For set ; then , so and is unit; these are orthonormal (from orthonormality of ). This yields with holding . (2) Rank dim of column space number of independent number of number of nonzero singular values. (2)
(c) [5 marks] Rank 2 ⇒ one zero eigenvalue. Trace . Sum of principal minors gives : compute (nonzero eigenvalue product). Eigenvalues of : ? Check: eigenvalues are , and roots of ⇒ . (3) So singular values: . (2)
(d) [5 marks]
def minnorm_lstsq(U, S, Vt, b, eps=1e-10):
# M = U @ diag(S) @ Vt
S_inv = np.array([1/s if s > eps else 0.0 for s in S])
# pseudoinverse M+ = V @ diag(S_inv) @ U^T
x = Vt.T @ (S_inv * (U.T @ b))
return x(3) Explanation: The pseudoinverse gives the minimum--norm solution among all least-squares minimizers. Tiny produce huge factors that amplify noise in ; the condition number blows up as . Zeroing singular values below (truncated SVD) discards these unstable directions, bounding the effective condition number and stabilizing the solution. (2)
Question 3
(a) [5 marks] Given (1, standard identity). Let , : (2) Again with , : . (2) Hence all three cyclic permutations equal.
(b) [5 marks] , so . (2.5) With SVD : , similar to . Trace is invariant under similarity ⇒ . (2.5)
(c) [8 marks] Norm preservation: (using ). (2) Dot product: . (2) Determinant: ; and ⇒ . (2) Trace: so . (2)
[
{"claim": "Eigenvalues of the 3x3 tridiagonal [2,-1] matrix are 2-sqrt2, 2, 2+sqrt2",
"code": "A=Matrix([[2,-1,0],[-1,2,-1],[0,-1,2]]); ev=set(A.eigenvals().keys()); expected={2-sqrt(2),Integer(2),2+sqrt(2)}; result = (ev==expected)"},
{"claim": "Minimum of Rayleigh quotient equals smallest eigenvalue 2-sqrt2",
"code": "A=Matrix([[2,-1,0],[-1,2,-1],[0,-1,2]]); lam=min(A.eigenvals().keys(),key=lambda z:float(z)); result = simplify(lam-(2-sqrt(2)))==0"},
{"claim": "Singular values of M are 3,1,0 (eigenvalues of M^T M are 9,1,0)",
"code": "M=Matrix([[1,0,1],[0,1,1],[1,1,2]]); mm=M.T*M; evs=sorted([float(v) for v in mm.eigenvals().keys()]); result = evs==[0.0,1.0,9.0]"},
{"claim": "rank(M)=2 and null space spanned by (1,1,-1)",
"code": "M=Matrix([[1,0,1],[0,1,1],[1,1,2]]); ns=M.nullspace(); result = (M.rank()==2 and len(ns)==1 and simplify(ns[0]-ns[0][0]*Matrix([1,1,-1]))==zeros(3,1))"},
{"claim": "trace(M^T M) equals sum of squares of singular values (9+1+0=10)",
"code": "M=Matrix([[1,0,1],[0,1,1],[1,1,2]]); result = trace(M.T*M)==10"}
]