Level 4 — ApplicationLinear Algebra (Full)

Linear Algebra (Full)

printable — key stays hidden on paper

Level 4 — Application (novel problems, no hints) Time: 60 minutes | Total marks: 50

Answer all questions. Show full working. Calculators not permitted.


Question 1 (10 marks)

Consider the matrix A=(120124131210).A = \begin{pmatrix} 1 & 2 & 0 & 1 \\ 2 & 4 & 1 & 3 \\ -1 & -2 & 1 & 0 \end{pmatrix}.

(a) Reduce AA to reduced row echelon form. (3)

(b) State the rank of AA and give a basis for the column space of AA. (3)

(c) Find a basis for the null space of AA and verify the rank–nullity theorem for AA. (4)


Question 2 (10 marks)

A linear transformation T:R2R2T:\mathbb{R}^2 \to \mathbb{R}^2 has matrix M=(2112).M = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}.

(a) Find the eigenvalues and a corresponding orthonormal eigenbasis of MM. (5)

(b) Hence write M=QDQTM = QDQ^{\mathsf T} with QQ orthogonal and DD diagonal, and use this to determine whether the quadratic form q(x)=xTMxq(\mathbf{x}) = \mathbf{x}^{\mathsf T} M \mathbf{x} is positive definite. Justify. (5)


Question 3 (10 marks)

The points P=(1,0,2)P=(1,0,2), Q=(3,1,1)Q=(3,1,1), R=(2,2,0)R=(2,2,0) lie in R3\mathbb{R}^3.

(a) Find the area of triangle PQRPQR. (4)

(b) Find the vector (Cartesian) equation of the plane through PP, QQ, RR. (3)

(c) Find the perpendicular distance from the origin to this plane. (3)


Question 4 (10 marks)

Fit a line y=a+bxy = a + bx by least squares to the data (x,y){(0,1),(1,1),(2,2),(3,2)}.(x,y) \in \{(0,1),(1,1),(2,2),(3,2)\}.

(a) Set up the normal equations ATAc=ATyA^{\mathsf T}A\,\mathbf{c} = A^{\mathsf T}\mathbf{y} explicitly. (4)

(b) Solve for aa and bb. (4)

(c) Compute the residual sum of squares for your fit. (2)


Question 5 (10 marks)

Let B=(3045).B = \begin{pmatrix} 3 & 0 \\ 4 & 5 \end{pmatrix}.

(a) Compute BTBB^{\mathsf T}B and find its eigenvalues. (4)

(b) Hence state the singular values of BB. (3)

(c) Using the singular values, compute the determinant of BB two ways (directly, and as the product of singular values) and confirm they agree in absolute value. (3)

Answer keyMark scheme & solutions

Question 1

(a) Start with AA. R2R22R1R_2 \to R_2 - 2R_1, R3R3+R1R_3 \to R_3 + R_1: (120100110011).\begin{pmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{pmatrix}. R3R3R2R_3 \to R_3 - R_2: RREF=(120100110000).\text{RREF} = \begin{pmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{pmatrix}. (3) — correct elimination steps (1), zero row (1), leading 1s in reduced form (1).

(b) Pivots in columns 1 and 3, so rank = 2. Basis for column space = columns 1 and 3 of original AA: {(121),(011)}.\left\{\begin{pmatrix}1\\2\\-1\end{pmatrix}, \begin{pmatrix}0\\1\\1\end{pmatrix}\right\}. (3) — rank (1), identify pivot columns (1), original columns (1).

(c) Free variables x2,x4x_2, x_4. From RREF: x1=2x2x4x_1 = -2x_2 - x_4, x3=x4x_3 = -x_4. x=x2(2100)+x4(1011).\mathbf{x} = x_2\begin{pmatrix}-2\\1\\0\\0\end{pmatrix} + x_4\begin{pmatrix}-1\\0\\-1\\1\end{pmatrix}. Null space basis: those two vectors; nullity =2=2. Rank–nullity: rank+nullity=2+2=4=\text{rank} + \text{nullity} = 2+2 = 4 = number of columns. ✓ (4) — back-solve (1), two basis vectors (2), verification (1).


Question 2

(a) Characteristic polynomial: det(MλI)=(2λ)21=λ24λ+3=(λ1)(λ3)\det(M-\lambda I) = (2-\lambda)^2 - 1 = \lambda^2 -4\lambda +3 = (\lambda-1)(\lambda-3). Eigenvalues λ1=3\lambda_1 = 3, λ2=1\lambda_2 = 1.

  • λ=3\lambda=3: (M3I)=(1111)v1=(1,1)T(M-3I)=\begin{pmatrix}-1&1\\1&-1\end{pmatrix}\Rightarrow \mathbf{v}_1=(1,1)^{\mathsf T}.
  • λ=1\lambda=1: (MI)=(1111)v2=(1,1)T(M-I)=\begin{pmatrix}1&1\\1&1\end{pmatrix}\Rightarrow \mathbf{v}_2=(1,-1)^{\mathsf T}.

Orthonormalize: v^1=12(1,1)T\hat{\mathbf v}_1 = \tfrac{1}{\sqrt2}(1,1)^{\mathsf T}, v^2=12(1,1)T\hat{\mathbf v}_2 = \tfrac{1}{\sqrt2}(1,-1)^{\mathsf T}. (5) — char poly (1), eigenvalues (1), eigenvectors (2), normalization (1).

(b) Q=12(1111),D=(3001),M=QDQT.Q = \frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix},\quad D=\begin{pmatrix}3&0\\0&1\end{pmatrix},\quad M=QDQ^{\mathsf T}. Since MM is symmetric with all eigenvalues >0>0 (3 and 1), q(x)=xTMxq(\mathbf x)=\mathbf x^{\mathsf T}M\mathbf x is positive definite. (5)Q,DQ,D (2), QT=Q1Q^{\mathsf T}=Q^{-1} orthogonality (1), positive-definite criterion via eigenvalues (2).


Question 3

(a) PQ=(2,1,1)\vec{PQ}=(2,1,-1), PR=(1,2,2)\vec{PR}=(1,2,-2). PQ×PR=ijk211122=(1(2)(1)2, (1)12(2), 2211)=(0,3,3).\vec{PQ}\times\vec{PR} = \begin{vmatrix} \mathbf i&\mathbf j&\mathbf k\\2&1&-1\\1&2&-2\end{vmatrix} = (1\cdot(-2)-(-1)\cdot2,\ (-1)\cdot1-2\cdot(-2),\ 2\cdot2-1\cdot1) = (0,3,3). PQ×PR=0+9+9=32|\vec{PQ}\times\vec{PR}| = \sqrt{0+9+9}=3\sqrt2. Area =12(32)=322=\tfrac12(3\sqrt2)=\dfrac{3\sqrt2}{2}. (4) — two edge vectors (1), cross product (2), area (1).

(b) Normal n=(0,3,3)\mathbf n=(0,3,3), or simplified (0,1,1)(0,1,1). Plane through P=(1,0,2)P=(1,0,2): 0(x1)+1(y0)+1(z2)=0y+z=2.0(x-1)+1(y-0)+1(z-2)=0 \Rightarrow y+z=2. (3) — normal (1), point substitution (1), equation (1).

(c) Distance =0+020+1+1=22=2=\dfrac{|0+0-2|}{\sqrt{0+1+1}} = \dfrac{2}{\sqrt2}=\sqrt2. (3) — distance formula (1), substitution (1), value (1).


Question 4

(a) A=(10111213)A=\begin{pmatrix}1&0\\1&1\\1&2\\1&3\end{pmatrix}, y=(1,1,2,2)T\mathbf y=(1,1,2,2)^{\mathsf T}, c=(a,b)T\mathbf c=(a,b)^{\mathsf T}. ATA=(46614),ATy=(611).A^{\mathsf T}A=\begin{pmatrix}4&6\\6&14\end{pmatrix},\qquad A^{\mathsf T}\mathbf y=\begin{pmatrix}6\\11\end{pmatrix}. (Sums: x=6\sum x=6, x2=14\sum x^2=14, y=6\sum y=6, xy=0+1+4+6=11\sum xy = 0+1+4+6=11.) (4) — matrix AA (1), ATAA^{\mathsf T}A (1.5), ATyA^{\mathsf T}\mathbf y (1.5).

(b) Solve (46614)(ab)=(611)\begin{pmatrix}4&6\\6&14\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix}=\begin{pmatrix}6\\11\end{pmatrix}. Determinant =41436=20=4\cdot14-36=20. a=61461120=846620=1820=0.9,b=4116620=443620=820=0.4.a=\frac{6\cdot14-6\cdot11}{20}=\frac{84-66}{20}=\frac{18}{20}=0.9,\quad b=\frac{4\cdot11-6\cdot6}{20}=\frac{44-36}{20}=\frac{8}{20}=0.4. Fit: y=0.9+0.4xy=0.9+0.4x. (4) — determinant (1), Cramer/elimination (2), values (1).

(c) Predictions: at x=0,1,2,3x=0,1,2,3: 0.9,1.3,1.7,2.10.9, 1.3, 1.7, 2.1. Residuals: 10.9=0.11-0.9=0.1; 11.3=0.31-1.3=-0.3; 21.7=0.32-1.7=0.3; 22.1=0.12-2.1=-0.1. RSS =0.01+0.09+0.09+0.01=0.20=0.01+0.09+0.09+0.01=0.20. (2) — predictions/residuals (1), RSS (1).


Question 5

(a) BTB=(3405)(3045)=(25202025)B^{\mathsf T}B=\begin{pmatrix}3&4\\0&5\end{pmatrix}\begin{pmatrix}3&0\\4&5\end{pmatrix}=\begin{pmatrix}25&20\\20&25\end{pmatrix}. Char poly: (25λ)2400=λ250λ+225=(λ45)(λ5)(25-\lambda)^2-400 = \lambda^2 -50\lambda +225 = (\lambda-45)(\lambda-5). Eigenvalues 4545 and 55. (4)BTBB^{\mathsf T}B (2), eigenvalues (2).

(b) Singular values σi=λi\sigma_i=\sqrt{\lambda_i}: σ1=45=35\sigma_1=\sqrt{45}=3\sqrt5, σ2=5\sigma_2=\sqrt5. (3)

(c) Direct: detB=3504=15\det B = 3\cdot5 - 0\cdot4 = 15. Product of singular values: 355=35=153\sqrt5\cdot\sqrt5 = 3\cdot5 = 15. detB=15=σ1σ2|\det B| = 15 = \sigma_1\sigma_2. ✓ (3) — direct det (1), product (1), agreement (1).


[
  {"claim":"Q2 eigenvalues of M are 1 and 3","code":"M=Matrix([[2,1],[1,2]]); ev=sorted(M.eigenvals().keys()); result=(ev==[1,3])"},
  {"claim":"Q3 area of triangle PQR is 3*sqrt(2)/2","code":"P=Matrix([1,0,2]); Q=Matrix([3,1,1]); R=Matrix([2,2,0]); c=(Q-P).cross(R-P); area=c.norm()/2; result=simplify(area-3*sqrt(2)/2)==0"},
  {"claim":"Q4 least squares solution a=0.9, b=0.4","code":"A=Matrix([[1,0],[1,1],[1,2],[1,3]]); y=Matrix([1,1,2,2]); c=(A.T*A).inv()*A.T*y; result=(c==Matrix([Rational(9,10),Rational(2,5)]))"},
  {"claim":"Q4 RSS equals 0.2","code":"A=Matrix([[1,0],[1,1],[1,2],[1,3]]); y=Matrix([1,1,2,2]); c=(A.T*A).inv()*A.T*y; r=y-A*c; rss=(r.T*r)[0]; result=simplify(rss-Rational(1,5))==0"},
  {"claim":"Q5 singular values of B are 3*sqrt(5) and sqrt(5)","code":"B=Matrix([[3,0],[4,5]]); ev=sorted((B.T*B).eigenvals().keys()); svs=sorted([sqrt(e) for e in ev]); result=(svs==sorted([sqrt(5),3*sqrt(5)]))"}
]