Blog
Linear Algebra Past Paper 2015 – BSCS 4th Term UOS (Math-3215)
University of Sargodha BS Computer Science 4th term Linear Algebra (Math-3215) paper, 2015 exam (80 marks, 2:30 hours). The paper is retyped below, followed by step-by-step solutions for all 16 short questions and all six subjective questions: spanning P3, consistency of a system depending on a, eigenvalues, Gauss-Jordan elimination, det(A) = det(Aᵀ), and the adjoint and inverse. All answers were checked with SymPy.
Solved answers
Q1 – Short answers (16 × 2)
i. c1, c2, c3. Components: −c1 + 2c2 + c3 = −6, 2c2 − 2c3 = 12, 2c1 − 2c2 + c3 = 4. Solving: c1 = 6, c2 = 2, c3 = −4.
ii. u·v. (2)(0) + (1)(−1) + (−2)(−3) + (4)(1) = 0 − 1 + 6 + 4 = 9.
iii. Subspaces of R³. {(a, 0, 0)} is a subspace (contains 0 and is closed under addition and scalar multiplication). {(a, 1, 0)} is not a subspace: it does not contain (0, 0, 0), and (a, 1, 0) + (b, 1, 0) = (a + b, 2, 0) is not of the form.
iv. Standard matrix of T. Columns are T(e1), T(e2), T(e3): [1 2 1; 1 5 0; 0 0 1].
v. Eigen values. A scalar λ is an eigenvalue of a square matrix A if Ax = λx for some non-zero vector x (the eigenvector); the eigenvalues are the roots of det(A − λI) = 0.
vi. Cauchy-Schwarz inequality. For vectors u, v in an inner product space: |⟨u, v⟩| ≤ ‖u‖ ‖v‖ (in Rⁿ: |u·v| ≤ ‖u‖ ‖v‖), with equality if and only if u and v are linearly dependent.
vii. Inner product. A function ⟨u, v⟩ giving a real number for each pair of vectors such that: ⟨u, v⟩ = ⟨v, u⟩; ⟨u + v, w⟩ = ⟨u, w⟩ + ⟨v, w⟩; ⟨ku, v⟩ = k⟨u, v⟩; ⟨v, v⟩ ≥ 0 and = 0 only for v = 0. Example: the dot product in Rⁿ.
viii. ‖u‖ for u = (5, −1, 2). √(25 + 1 + 4) = √30 ≈ 5.477.
ix. Orthonormal basis. A basis whose vectors are mutually orthogonal (dot product 0) and each has length 1. Example: {(1, 0, 0), (0, 1, 0), (0, 0, 1)} in R³, or {(1/√2, 1/√2), (1/√2, −1/√2)} in R².
x. (AB)T = BTAT. Let A be m×n, B be n×p. The (i, j) entry of (AB)T is the (j, i) entry of AB = Σk ajkbki. The (i, j) entry of BTAT = Σk (BT)ik(AT)kj = Σk bkiajk. They are equal for all i, j, so (AB)T = BTAT.
xi. ‖u‖ for u = (5, −1, 2). Same as (viii): √30.
xii. Symmetric matrix. A square matrix with AT = A, i.e. aij = aji; e.g. [1 2; 2 3].
xiii. Diagonal matrix. A square matrix whose entries off the main diagonal are all zero, e.g. [2 0 0; 0 −1 0; 0 0 5].
xiv. Is A = diag(−1, 2, 5) singular? det A = (−1)(2)(5) = −10 ≠ 0, so A is non-singular (invertible).
xv. Characteristic equation. det(λI − A) = 0 (or det(A − λI) = 0); its roots are the eigenvalues of A.
xvi. Similar matrices. A and B are similar if B = P−1AP for some invertible matrix P. Similar matrices have the same determinant, rank, trace, characteristic polynomial and eigenvalues.
Q2 – Do the polynomials span P3?
Write each polynomial as a coefficient vector (constant, t, t², t³): p1 = (1, 2, 0, 1), p2 = (2, −1, 1, 0), p3 = (2, 0, 0, 1), p4 = (2, −5, 1, −1). P3 has dimension 4, so the four polynomials span P3 only if they are linearly independent, i.e. the matrix with these columns has non-zero determinant.
p1 p2 p3 p4
1 [ 1 2 2 2 ]
t [ 2 -1 0 -5 ]
t^2 [ 0 1 0 1 ]
t^3 [ 1 0 1 -1 ]Its determinant is 0 and its rank is 3. In fact p4 = p2 + p3 − 2p1: (2 + 2 − 2) + (−1 + 0 − 4)t + (1 + 0 − 0)t² + (0 + 1 − 2)t³ = 2 − 5t + t² − t³ = p4. So only three of them are independent and the polynomials do not span P3 (they span a 3-dimensional subspace).
Q3 – Values of a
Augmented matrix and elimination: R2 − 3R1, R3 − 4R1:
[ 1 2 -3 | 4 ]
[ 0 -7 14 | -10 ]
[ 0 -7 a^2+10 | a - 12 ]
R3 - R2:
[ 1 2 -3 | 4 ]
[ 0 -7 14 | -10 ]
[ 0 0 a^2-4 | a - 2 ]The last row is (a² − 4)z = a − 2, i.e. (a − 2)(a + 2)z = a − 2.
- a = −2: 0·z = −4 – impossible, so no solution.
- a = 2: 0·z = 0 – z is free, so infinitely many solutions.
- a ≠ ±2: z = 1/(a + 2) – exactly one solution.
Q4 – Eigenvalues and eigenvectors of [1 −2 3; 6 7 −1; −3 1 4]
Characteristic equation: det(A − λI) = 0. Expanding: (1 − λ)[(7 − λ)(4 − λ) + 1] + 2[6(4 − λ) − 3] + 3[6 + 3(7 − λ)] = 0, which gives
λ³ − 12λ² + 61λ − 152 = 0 (trace = 12, det A = 152).
This cubic has no rational root (±1, ±2, ±4, ±8, ±19, … do not satisfy it). It has one real root and a pair of complex roots: λ1 ≈ 6.0785, λ2,3 ≈ 2.9607 ± 4.0299 i (check: 6.0785 + 2 × 2.9607 = 12).
Eigenvectors from (A − λI)v = 0 with v3 = 1: for λ1 ≈ 6.0785, v1 ≈ (−0.104, 1.765, 1); for λ2,3, v ≈ (0.100 ∓ 1.063 i, −0.740 ± 0.841 i, 1). (Values computed with NumPy/SymPy; the matrix as printed does not have “nice” eigenvalues, so the question may have a printing error.)
Q5 – Gauss-Jordan elimination
[ 0 -2 3 | 1 ] R1 <-> R2, then R1/3:
[ 3 6 3 | -2 ] -> [ 1 2 1 | -2/3 ]
[ 6 -6 3 | 5 ] [ 0 -2 3 | 1 ]
[ 6 -6 3 | 5 ]
R3 - 6R1: [ 0 -18 -3 | 9 ]
R2/(-2): [ 0 1 -3/2 | -1/2 ]
R3 + 18R2: [ 0 0 -30 | 0 ] -> x3 = 0
back-substitute: R2 + (3/2)R3, R1 - R3, R1 - 2R2:
[ 1 0 0 | 1/3 ]
[ 0 1 0 | -1/2 ]
[ 0 0 1 | 0 ]x1 = 1/3, x2 = −1/2, x3 = 0. Check: −2(−1/2) + 0 = 1 ✓; 3(1/3) + 6(−1/2) + 0 = −2 ✓; 6(1/3) − 6(−1/2) + 0 = 5 ✓.
Q6 – det(A) = det(AT)
A = [3 1 −2; 1 0 4; 5 −3 6]. det A = 3(0·6 − 4·(−3)) − 1(1·6 − 4·5) + (−2)(1·(−3) − 0·5) = 3(12) − 1(−14) − 2(−3) = 36 + 14 + 6 = 56.
AT = [3 1 5; 1 0 −3; −2 4 6]. det AT = 3(0·6 − (−3)·4) − 1(1·6 − (−3)(−2)) + 5(1·4 − 0·(−2)) = 3(12) − 1(0) + 5(4) = 36 + 0 + 20 = 56. Hence det(A) = det(AT).
Q7 – Adjoint and inverse
A = [3 −2 1; 5 6 2; 1 0 −3]. det A = 3(6·(−3) − 2·0) + 2(5·(−3) − 2·1) + 1(5·0 − 6·1) = 3(−18) + 2(−17) − 6 = −54 − 34 − 6 = −94.
Cofactors: C11 = −18, C12 = 17, C13 = −6; C21 = −6, C22 = −10, C23 = −2; C31 = −10, C32 = −1, C33 = 28.
adj A = (cofactor matrix)T = [−18 −6 −10; 17 −10 −1; −6 −2 28].
A−1 = adj A / det A = (−1/94)·adj A = [9/47 3/47 5/47; −17/94 5/47 1/94; 3/47 1/47 −14/47].
All results were checked with SymPy.
