Level 5 — MasteryMatrices & Determinants — Introduction

Matrices & Determinants — Introduction

75 minutes50 marksprintable — key stays hidden on paper

LEVEL 5 — Mastery Paper (Cross-domain: Math + Physics + Coding)

Time limit: 75 minutes
Total marks: 50
Instructions: Answer all questions. Show full working. Proofs must be rigorous. Pseudocode/code may be in any clear syntax.


Question 1 — Structure, Proof & Computation (18 marks)

Let AA be any square matrix of order nn.

(a) Prove that any square matrix AA can be written uniquely as the sum of a symmetric matrix SS and a skew-symmetric matrix KK. State SS and KK explicitly in terms of AA and ATA^T. (5)

(b) For A=(251134026),A = \begin{pmatrix} 2 & 5 & -1 \\ 1 & 3 & 4 \\ 0 & 2 & 6 \end{pmatrix}, find SS and KK explicitly and verify A=S+KA = S + K. (4)

(c) Prove that for any skew-symmetric matrix KK of odd order, det(K)=0\det(K) = 0. Hence state det(K)\det(K) for the matrix KK found in part (b) without direct expansion. (5)

(d) Write pseudocode for a function decompose(A) that returns (S,K)(S, K) for an n×nn\times n input matrix, using only element-wise operations and transpose. Comment on its time complexity in terms of nn. (4)


Question 2 — Physics Application: Coupled System via Cramer & Inversion (18 marks)

Two masses on frictionless rails are connected by springs. At static equilibrium the displacements x1,x2x_1, x_2 (in metres) satisfy the stiffness equations from applied forces F1=12 NF_1 = 12\ \text{N}, F2=6 NF_2 = 6\ \text{N}:

(5224)(x1x2)=(126)\begin{pmatrix} 5 & -2 \\ -2 & 4 \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} 12 \\ 6 \end{pmatrix}

(units: stiffness in N/m).

(a) Compute the determinant of the stiffness matrix KK and explain physically why detK0\det K \neq 0 guarantees a unique equilibrium. (3)

(b) Solve for x1,x2x_1, x_2 using Cramer's rule. (4)

(c) Find K1K^{-1} (the compliance matrix) and re-solve the system by matrix inversion, confirming the answer in (b). (5)

(d) The elastic potential energy is U=12xTKxU = \tfrac{1}{2}\mathbf{x}^T K \mathbf{x} where x=(x1,x2)T\mathbf{x}=(x_1,x_2)^T. Using your solution, compute UU in joules. Also verify the identity U=12xTFU = \tfrac12 \mathbf{x}^T\mathbf{F} and explain why these agree. (6)


Question 3 — Non-commutativity & a Structural Claim (14 marks)

(a) Give an explicit pair of 2×22\times2 matrices A,BA, B with ABBAAB \neq BA, and show both products. (3)

(b) Prove the general property (AB)T=BTAT(AB)^T = B^T A^T for conformable matrices AA (m×pm\times p) and BB (p×np\times n), working from the definition of the (i,j)(i,j) entry. (6)

(c) A student claims: "For all 2×22\times2 matrices, det(A+B)=detA+detB\det(A+B) = \det A + \det B." Disprove this with a counterexample, and separately prove the correct multiplicative property det(AB)=detAdetB\det(AB)=\det A\,\det B holds for the specific matrices A=(1203)A=\begin{pmatrix}1&2\\0&3\end{pmatrix}, B=(4112)B=\begin{pmatrix}4&1\\1&2\end{pmatrix} by computing both sides. (5)

Answer keyMark scheme & solutions

Question 1

(a) [5 marks] Define S=12(A+AT)S = \tfrac12(A+A^T) and K=12(AAT)K = \tfrac12(A-A^T). (1) Then S+K=12(A+AT)+12(AAT)=AS + K = \tfrac12(A+A^T) + \tfrac12(A-A^T) = A. (1) ST=12(AT+A)=SS^T = \tfrac12(A^T + A) = S ⇒ symmetric. KT=12(ATA)=KK^T = \tfrac12(A^T - A) = -K ⇒ skew-symmetric. (1, why: transpose is linear and (AT)T=A(A^T)^T=A) Uniqueness: suppose A=S+KA = S'+K' with SS' symmetric, KK' skew. Take transpose: AT=SKA^T = S'-K'. Adding/subtracting gives S=12(A+AT)=SS'=\tfrac12(A+A^T)=S, K=12(AAT)=KK'=\tfrac12(A-A^T)=K. (2)

(b) [4 marks] AT=(210532146)A^T = \begin{pmatrix}2&1&0\\5&3&2\\-1&4&6\end{pmatrix}. (1) S=12(A+AT)=(23123331236)S=\tfrac12(A+A^T)=\begin{pmatrix}2&3&-\tfrac12\\3&3&3\\-\tfrac12&3&6\end{pmatrix}. (1.5) K=12(AAT)=(02122011210)K=\tfrac12(A-A^T)=\begin{pmatrix}0&2&-\tfrac12\\-2&0&1\\ \tfrac12&-1&0\end{pmatrix}. (1.5) (Sum check: S+K=AS+K=A — award full if verified.)

(c) [5 marks] For skew-symmetric KK: KT=KK^T=-K. Then det(KT)=det(K)\det(K^T)=\det(-K). (1) Left: det(KT)=detK\det(K^T)=\det K. (1) Right: det(K)=(1)ndetK\det(-K)=(-1)^n\det K for order nn. (1) So detK=(1)ndetK\det K = (-1)^n \det K. For odd nn, (1)n=1(-1)^n=-1, giving detK=detK2detK=0detK=0\det K = -\det K \Rightarrow 2\det K = 0 \Rightarrow \det K = 0. (1) Here n=3n=3 (odd), so detK=0\det K = 0. (1)

(d) [4 marks]

function decompose(A):        # A is n x n
    n = rows(A)
    AT = transpose(A)
    S = zeros(n,n); K = zeros(n,n)
    for i in 1..n:
        for j in 1..n:
            S[i][j] = 0.5*(A[i][j] + AT[i][j])
            K[i][j] = 0.5*(A[i][j] - AT[i][j])
    return (S, K)

Transpose is O(n2)O(n^2), the double loop is O(n2)O(n^2); total O(n2)O(n^2). (loop correctness 2, complexity 2)


Question 2

(a) [3 marks] detK=(5)(4)(2)(2)=204=16\det K = (5)(4)-(-2)(-2)=20-4=16. (1) detK0\det K\neq0KK invertible ⇒ system has a unique solution x=K1F\mathbf{x}=K^{-1}\mathbf F; physically a unique equilibrium configuration exists (no rigid-body zero modes / positive-definite stable equilibrium). (2)

(b) [4 marks] D=16D=16. D1=det(12264)=48(12)=60D_1=\det\begin{pmatrix}12&-2\\6&4\end{pmatrix}=48-(-12)=60; x1=60/16=15/4=3.75x_1=60/16=15/4=3.75 m. (2) D2=det(51226)=30(24)=54D_2=\det\begin{pmatrix}5&12\\-2&6\end{pmatrix}=30-(-24)=54; x2=54/16=27/8=3.375x_2=54/16=27/8=3.375 m. (2)

(c) [5 marks] K1=116(4225)K^{-1}=\tfrac1{16}\begin{pmatrix}4&2\\2&5\end{pmatrix}. (2) x=K1F=116(4225)(126)=116(48+1224+30)=116(6054)=(3.753.375)\mathbf x=K^{-1}\mathbf F=\tfrac1{16}\begin{pmatrix}4&2\\2&5\end{pmatrix}\begin{pmatrix}12\\6\end{pmatrix}=\tfrac1{16}\begin{pmatrix}48+12\\24+30\end{pmatrix}=\tfrac1{16}\begin{pmatrix}60\\54\end{pmatrix}=\begin{pmatrix}3.75\\3.375\end{pmatrix}. (2) Matches (b). (1)

(d) [6 marks] Kx=F=(12,6)TK\mathbf x=\mathbf F=(12,6)^T by construction, so U=12xTKx=12xTFU=\tfrac12\mathbf x^T K\mathbf x = \tfrac12 \mathbf x^T\mathbf F. (identity, 2) U=12(x112+x26)=12(3.7512+3.3756)=12(45+20.25)=12(65.25)=32.625U=\tfrac12(x_1\cdot12+x_2\cdot6)=\tfrac12(3.75\cdot12+3.375\cdot6)=\tfrac12(45+20.25)=\tfrac12(65.25)=32.625 J. (3) They agree because Kx=FK\mathbf x=\mathbf F substituted into 12xTKx\tfrac12\mathbf x^TK\mathbf x directly yields 12xTF\tfrac12\mathbf x^T\mathbf F. (1)


Question 3

(a) [3 marks] Take A=(1101)A=\begin{pmatrix}1&1\\0&1\end{pmatrix}, B=(1011)B=\begin{pmatrix}1&0\\1&1\end{pmatrix}. AB=(2111)AB=\begin{pmatrix}2&1\\1&1\end{pmatrix}, BA=(1112)BA=\begin{pmatrix}1&1\\1&2\end{pmatrix}. ABBAAB\neq BA. (3)

(b) [6 marks] (AB)ij=k=1pAikBkj(AB)_{ij}=\sum_{k=1}^p A_{ik}B_{kj}. (1) ((AB)T)ij=(AB)ji=kAjkBki((AB)^T)_{ij}=(AB)_{ji}=\sum_k A_{jk}B_{ki}. (2) (BTAT)ij=k(BT)ik(AT)kj=kBkiAjk=kAjkBki(B^TA^T)_{ij}=\sum_k (B^T)_{ik}(A^T)_{kj}=\sum_k B_{ki}A_{jk}=\sum_k A_{jk}B_{ki}. (2) Both equal the same scalar sum for every (i,j)(i,j); orders match (n×mn\times m), so (AB)T=BTAT(AB)^T=B^TA^T. (1)

(c) [5 marks] Counterexample: A=IA=I, B=IB=I: det(A+B)=det(2I)=4\det(A+B)=\det(2I)=4 but detA+detB=1+1=24\det A+\det B=1+1=2\neq4. Claim false. (2) Multiplicative check: detA=3\det A=3, detB=81=7\det B=8-1=7, product =21=21. (1) AB=(1203)(4112)=(6536)AB=\begin{pmatrix}1&2\\0&3\end{pmatrix}\begin{pmatrix}4&1\\1&2\end{pmatrix}=\begin{pmatrix}6&5\\3&6\end{pmatrix}, det(AB)=3615=21\det(AB)=36-15=21. (2) Equal ✓.

[
{"claim":"Q1(c): odd-order skew matrix has zero determinant (n=3 example)","code":"K=Matrix([[0,2,Rational(-1,2)],[-2,0,1],[Rational(1,2),-1,0]]); result = (K.det()==0)"},
{"claim":"Q2(b): Cramer solution x1=15/4, x2=27/8","code":"K=Matrix([[5,-2],[-2,4]]); F=Matrix([12,6]); x=K.solve(F); result = (x[0]==Rational(15,4) and x[1]==Rational(27,8))"},
{"claim":"Q2(d): U=32.625 J via both formulas","code":"K=Matrix([[5,-2],[-2,4]]); F=Matrix([12,6]); x=K.solve(F); U1=(x.T*K*x)[0]/2; U2=(x.T*F)[0]/2; result = (U1==U2 and U1==Rational(261,8))"},
{"claim":"Q3(c): det(AB)=detA*detB=21 and det(A+B)!=detA+detB for A=B=I","code":"A=Matrix([[1,2],[0,3]]); B=Matrix([[4,1],[1,2]]); prod=(A.det()*B.det()); I=eye(2); result = ((A*B).det()==21 and prod==21 and (I+I).det()!=I.det()+I.det())"}
]