Linear Algebra (Full)
Level: 3 — Production (from-scratch derivations, algorithms from memory, explain-out-loud) Time limit: 45 minutes Total marks: 60
Instructions: Show all working. Where a proof or algorithm is requested, reproduce it from memory with full justification of each step.
Question 1 (Cauchy–Schwarz from scratch). [10 marks]
(a) State the Cauchy–Schwarz inequality for . [2]
(b) Prove it from scratch. Consider and use the discriminant argument. Justify each step. [6]
(c) State the condition for equality and explain geometrically. [2]
Question 2 (Rank–nullity, derivation). [10 marks]
Let be an matrix representing .
(a) Prove the Rank–Nullity theorem , by extending a basis of the null space to a basis of and showing the images form a basis of the column space. [7]
(b) For , find and , verifying the theorem. [3]
Question 3 (Gram–Schmidt / QR, algorithm from memory). [12 marks]
(a) Write out the Gram–Schmidt algorithm (in pseudocode or explicit formulas) that converts an independent set into an orthonormal set. [4]
(b) Apply it to , . Give the orthonormal vectors . [5]
(c) Explain how Gram–Schmidt yields the QR decomposition and state why is upper triangular. [3]
Question 4 (Diagonalization, full procedure). [12 marks]
Let .
(a) Find the characteristic polynomial and eigenvalues. [3]
(b) Find a basis for each eigenspace. [4]
(c) Give and with , choosing orthogonal. [3]
(d) Explain out loud (in words) why a real symmetric matrix is always orthogonally diagonalizable (spectral theorem — sketch the key facts, no full proof needed). [2]
Question 5 (Least squares, normal equations from scratch). [10 marks]
Fit a line through the points .
(a) Set up the overdetermined system and derive the normal equations from minimizing . [4]
(b) Solve for . [4]
(c) State one advantage of the QR approach over forming directly. [2]
Question 6 (Determinant & Cramer, explain-out-loud). [6 marks]
(a) Using cofactor expansion, compute . [3]
(b) Use Cramer's rule to solve for only in , and explain in one sentence the geometric meaning of the determinant appearing in the denominator. [3]
Answer keyMark scheme & solutions
Question 1
(a) . [2]
(b) If trivial. Else define for all [2] (norm-squared is nonneg). This is a quadratic in with positive leading coefficient that is never negative, so its discriminant : [2] . Taking square roots gives the result. [2]
(c) Equality iff for some , i.e. — the vectors are linearly dependent (parallel/antiparallel). [2]
Question 2
(a) Let be a basis of (). Extend to a basis of , so . [2] Claim is a basis of . Spanning: any with gives (since ). [2] Independence: if then , so , giving . By independence of the full basis all . [2] Hence and . [1]
(b) Row reduce: , : . Two pivots ⇒ . [2] ; check . ✓ [1]
Question 3
(a) For : (projections onto already-computed ), then . [4]
(b) . [1] . [1] . [2] , so . [1]
(c) Rearranging Gram–Schmidt, with and . Since is a combination of only , the matrix has zeros below the diagonal ⇒ upper triangular; with orthonormal columns. [3]
Question 4
(a) ; eigenvalues . [3]
(b) : ⇒ eigenvector . [2] : ⇒ eigenvector . [2]
(c) Normalize: , , . [3]
(d) Key facts: symmetric matrices have all real eigenvalues; eigenvectors from distinct eigenvalues are orthogonal (from ); repeated eigenvalues still yield orthogonal eigenbases within eigenspaces — combining gives an orthonormal eigenbasis, so . [2]
Question 5
(a) , . Minimizing , . [4]
(b) , . Solve: . , . [4]
(c) QR avoids forming , which squares the condition number and can lose precision; QR is numerically more stable. [2]
Question 6
(a) Expand along first column: . [3]
(b) . . [2] Geometric meaning: is the signed area of the parallelogram spanned by the coefficient columns; nonzero ⇒ unique solution. [1]
[
{"claim":"Q2 rank of A is 2","code":"A=Matrix([[1,2,1,0],[2,4,3,1],[-1,-2,0,1]]); result=(A.rank()==2)"},
{"claim":"Q2 nullity 2, theorem 2+2=4","code":"A=Matrix([[1,2,1,0],[2,4,3,1],[-1,-2,0,1]]); result=(len(A.nullspace())==2 and A.rank()+len(A.nullspace())==4)"},
{"claim":"Q3 q2 = (1,-1,2)/sqrt6 orthonormal to q1","code":"q1=Matrix([1,1,0])/sqrt(2); q2=Matrix([1,-1,2])/sqrt(6); result=(simplify(q1.dot(q2))==0 and simplify(q2.dot(q2))==1)"},
{"claim":"Q4 eigenvalues 1 and 3","code":"A=Matrix([[2,1],[1,2]]); result=(set(A.eigenvals().keys())=={1,3})"},
{"claim":"Q5 least squares c0=7/6, c1=3/2","code":"A=Matrix([[1,0],[1,1],[1,2]]); b=Matrix([1,3,4]); c=(A.T*A).inv()*A.T*b; result=(c[0]==Rational(7,6) and c[1]==Rational(3,2))"},
{"claim":"Q6 determinant equals 7","code":"M=Matrix([[1,2,0],[0,3,1],[2,0,1]]); result=(M.det()==7)"},
{"claim":"Q6 Cramer x = 7/5","code":"result=(Rational((3*1-2*5),(1*1-2*3))==Rational(7,5))"}
]