Linear Algebra and Vector Geometry 201-SN4-RE • CEGEP, Montreal

Corrected exercises: matrices, linear systems and determinants (201-SN4-RE)

This is the corrected exercise set on matrices and systems of linear equations for Linear Algebra and Vector Geometry, 201-SN4-RE (formerly 201-NYC), the same chapter as in the linear algebra course of the Social Science mathematics profile (201-105). Part A covers the basics: matrix operations and the transpose, the matrix product and its non-commutativity, writing a system in matrix form, a complete solution by Gauss-Jordan elimination, the inverse of a 3x3 matrix by the [A ∣ I][A\,|\,I] method, the inverse matrix and determinants. Part B rises to exam level: the proof that the transpose of a product reverses the order of the factors, the singular case where the determinant vanishes, a ticket-sales problem solved by Cramer's rule with a feasibility analysis, homogeneous systems and their solution space, the complete case analysis of a system with parameters by rank (exercise 9), and the properties of the inverse of a product. Part C adds five classics: matrix equations and the side on which the inverse goes (exercise 11), triangular matrices (12), the trace of a product (13), traffic flows in a neighbourhood (14) and a bakery's production in matrices (15).

Exercises 0.1 and 0.2 open the set with eighteen direct calculations on matrices, like the drill lists of the textbooks. First ten operations: the linear combination 2A+3B2A+3B, a transpose and the product CCTCC^{T}, products 2×22\times 2, (1×3)(3×1)(1\times 3)(3\times 1) and then in the other order, (2×3)(3×2)(2\times 3)(3\times 2) and 3×33\times 3, a square, the cube of a triangular matrix and the expression P2−3P+2IP^{2}-3P+2I. Then eight inverses: by the 2×22\times 2 formula and the determinant, a non-invertible matrix to recognize, a diagonal matrix, two 3×33\times 3 inverses by the [A ∣ I][A\,|\,I] method and two systems solved by X=A−1BX=A^{-1}B. Every requested entry is checked instantly.

This set is written for CEGEP students in Science (Sciences de la nature) and in the mathematics profile of Social Science. Matrix algebra is the big new language of the course: a system of three equations in three unknowns becomes a single equation AX=BAX=B, and the whole difficulty shifts to mastering the row operations and the determinant.

The reflex to keep throughout: the matrix product is not commutative. ABAB and BABA generally have neither the same size nor the same entries, and quite often one of them does not even exist. Before each product, check that the number of columns of the first matrix equals the number of rows of the second.

17 corrected exercises • 170 points • 225 minutes

This chapter is part of 201-SN4-RE, every chapter with its set and sheet Before you start Revision sheet: the traps and the method for this chapter

Self-checking set Type your answers and check them question by question: the page tells you right or wrong before you open the solution. With an account, every answer right on the first try earns points, and your right answers stay filled in when you come back.

Course recap

  • • Sum and scalar multiple: entry by entry, between matrices of the same size. (A+B)ij=Aij+Bij(A+B)_{ij}=A_{ij}+B_{ij} and (kA)ij=kAij(kA)_{ij}=kA_{ij}. Transpose: (AT)ij=Aji(A^{T})_{ij}=A_{ji} (rows and columns are swapped).
  • • Matrix product: the entry (i, j)(i,\ j) of ABAB is the dot product of row ii of AA with column jj of BB. The number of columns of AA must equal the number of rows of BB. In general AB≠BAAB\neq BA: the product is NOT commutative.
  • • A linear system is written AX=BAX=B, where AA is the coefficient matrix, XX the column of unknowns and BB the column of constants.
  • • Gauss-Jordan elimination: write the augmented matrix [A ∣ B][A\,|\,B] and, using elementary row operations (swap two rows, multiply a row by a non-zero scalar, add a multiple of another row to a row), reduce it to the reduced row echelon form [I ∣ X][I\,|\,X]. The last column then gives the solution directly.
  • • 2×22\times 2 determinant: det⁡(abcd)=ad−bc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix}=ad-bc. 3×33\times 3 determinant: cofactor expansion along a row or a column (with alternating signs + − ++\ -\ +).
  • • Inverse of a 2×22\times 2 matrix: if det⁡A≠0\det A\neq 0, then A−1=1det⁡A(d−b−ca)A^{-1}=\dfrac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}. A matrix is invertible if and only if its determinant is non-zero.
  • • Cramer's rule: if det⁡A≠0\det A\neq 0, the unknown xix_{i} equals det⁡Aidet⁡A\dfrac{\det A_{i}}{\det A}, where AiA_{i} is the matrix AA with column ii replaced by the column BB. If det⁡A=0\det A=0, the system has no unique solution: either no solution or infinitely many.

Calculations: matrix products to compute

Exercise 0.1: Computing matrix products: ten direct calculations

For each line, carry out the requested calculation, then give the indicated entries of the result. We write MijM_{ij} for the entry in row ii and column jj of the matrix MM.

Before any product, write down the sizes: (m×n)(n×p)(m\times n)(n\times p) gives an m×pm\times p matrix, and the product exists only if the two nn match. The entry (AB)ij(AB)_{ij} is row ii of AA times column jj of BB: multiply term by term and add. A linear combination is computed entry by entry; a power is computed by successive products, never by raising each entry to the power.

  • a) A=(3−214)A=\begin{pmatrix} 3 & -2 \\ 1 & 4 \end{pmatrix} and B=(−1250)B=\begin{pmatrix} -1 & 2 \\ 5 & 0 \end{pmatrix}: compute 2A+3B2A+3B, then give (2A+3B)12(2A+3B)_{12} and (2A+3B)21(2A+3B)_{21}.
  • b) C=(1−20341)C=\begin{pmatrix} 1 & -2 \\ 0 & 3 \\ 4 & 1 \end{pmatrix}: write CTC^{T}, then compute CCTCC^{T}; give (CT)23(C^{T})_{23} and (CCT)13(CC^{T})_{13}.
  • c) (25−13)(4−126)\begin{pmatrix} 2 & 5 \\ -1 & 3 \end{pmatrix}\begin{pmatrix} 4 & -1 \\ 2 & 6 \end{pmatrix}: give entries (1,2)(1,2) and (2,1)(2,1) of the product.
  • d) (2−14)(35−2)\begin{pmatrix} 2 & -1 & 4 \end{pmatrix}\begin{pmatrix} 3 \\ 5 \\ -2 \end{pmatrix}: give the result.
  • e) (35−2)(2−14)\begin{pmatrix} 3 \\ 5 \\ -2 \end{pmatrix}\begin{pmatrix} 2 & -1 & 4 \end{pmatrix}: give entries (2,3)(2,3) and (3,2)(3,2) of the product.
  • f) (10−2312)(21−1430)\begin{pmatrix} 1 & 0 & -2 \\ 3 & 1 & 2 \end{pmatrix}\begin{pmatrix} 2 & 1 \\ -1 & 4 \\ 3 & 0 \end{pmatrix}: give entries (1,1)(1,1) and (2,2)(2,2) of the product.
  • g) (120−113201)(2−1103211−2)\begin{pmatrix} 1 & 2 & 0 \\ -1 & 1 & 3 \\ 2 & 0 & 1 \end{pmatrix}\begin{pmatrix} 2 & -1 & 1 \\ 0 & 3 & 2 \\ 1 & 1 & -2 \end{pmatrix}: give entries (2,3)(2,3) and (3,2)(3,2) of the product.
  • h) M=(1−324)M=\begin{pmatrix} 1 & -3 \\ 2 & 4 \end{pmatrix}: compute M2M^{2}, then give (M2)11(M^{2})_{11} and (M2)22(M^{2})_{22}.
  • i) N=(210−1)N=\begin{pmatrix} 2 & 1 \\ 0 & -1 \end{pmatrix}: compute N3N^{3}, then give (N3)12(N^{3})_{12} and (N3)22(N^{3})_{22}.
  • j) P=(21−13)P=\begin{pmatrix} 2 & 1 \\ -1 & 3 \end{pmatrix}: compute P2−3P+2IP^{2}-3P+2I, then give its entries (1,1)(1,1) and (1,2)(1,2).

Type your answers, the page tells you right or wrong 0/19

a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
Show the solution

Answers

  • a) 2A+3B=(32178)2A+3B=\begin{pmatrix} 3 & 2 \\ 17 & 8 \end{pmatrix}; 22 and 1717
  • b) (CT)23=1(C^{T})_{23}=1; (CCT)13=2(CC^{T})_{13}=2
  • c) (1828219)\begin{pmatrix} 18 & 28 \\ 2 & 19 \end{pmatrix}; 2828 and 22
  • d) 6−5−8=−76-5-8=-7
  • e) a 3×33\times 3 matrix; 2020 and 22
  • f) (−41117)\begin{pmatrix} -4 & 1 \\ 11 & 7 \end{pmatrix}; −4-4 and 77
  • g) (25517−55−10)\begin{pmatrix} 2 & 5 & 5 \\ 1 & 7 & -5 \\ 5 & -1 & 0 \end{pmatrix}; −5-5 and −1-1
  • h) M2=(−5−151010)M^{2}=\begin{pmatrix} -5 & -15 \\ 10 & 10 \end{pmatrix}; −5-5 and 1010
  • i) N3=(830−1)N^{3}=\begin{pmatrix} 8 & 3 \\ 0 & -1 \end{pmatrix}; 33 and −1-1
  • j) P2−3P+2I=(−12−21)P^{2}-3P+2I=\begin{pmatrix} -1 & 2 \\ -2 & 1 \end{pmatrix}; −1-1 and 22

The move that decides everything: write the sizes down BEFORE computing. They tell you whether the product exists, what shape the result has, and which row meets which column for each requested entry.

a)

2A=(6−428)2A=\begin{pmatrix} 6 & -4 \\ 2 & 8 \end{pmatrix} and 3B=(−36150)3B=\begin{pmatrix} -3 & 6 \\ 15 & 0 \end{pmatrix}, so 2A+3B=(32178)2A+3B=\begin{pmatrix} 3 & 2 \\ 17 & 8 \end{pmatrix}: (2A+3B)12=2(2A+3B)_{12}=2 and (2A+3B)21=17(2A+3B)_{21}=17. Pitfall: reading (⋅)12(\cdot)_{12} as row 2, column 1; the ROW index always comes first.

b)

The transpose swaps rows and columns: CT=(104−231)C^{T}=\begin{pmatrix} 1 & 0 & 4 \\ -2 & 3 & 1 \end{pmatrix}, so (CT)23=C32=1(C^{T})_{23}=C_{32}=1. CCTCC^{T} is a (3×2)(2×3)(3\times 2)(2\times 3) product, hence a 3×33\times 3 matrix; its entry (1,3)(1,3) is row 1 of CC times column 3 of CTC^{T}, that is, times row 3 of CC: 1×4+(−2)×1=21\times 4+(-2)\times 1=2. Pitfall: computing CTCC^{T}C, which is a 2×22\times 2 matrix and has no column 3.

c)

A (2×2)(2×2)(2\times 2)(2\times 2) product. Row 1 times column 2: 2×(−1)+5×6=282\times(-1)+5\times 6=28. Row 2 times column 1: (−1)×4+3×2=2(-1)\times 4+3\times 2=2. The full product is (1828219)\begin{pmatrix} 18 & 28 \\ 2 & 19 \end{pmatrix}. Pitfall: multiplying entry by entry, which gives (8−5−218)\begin{pmatrix} 8 & -5 \\ -2 & 18 \end{pmatrix}.

d)

A (1×3)(3×1)(1\times 3)(3\times 1) product gives a 1×11\times 1 matrix, that is, a number: 2×3+(−1)×5+4×(−2)=6−5−8=−72\times 3+(-1)\times 5+4\times(-2)=6-5-8=-7.

e)

The same factors as in d), in the other order: (3×1)(1×3)(3\times 1)(1\times 3) gives a 3×33\times 3 matrix, whose entry (i,j)(i,j) is the ii-th term of the column times the jj-th term of the row. Entry (2,3)(2,3): 5×4=205\times 4=20. Entry (3,2)(3,2): (−2)×(−1)=2(-2)\times(-1)=2. Pitfall: expecting to get −7-7 again; here, changing the order changes even the size.

f)

(2×3)(3×2)(2\times 3)(3\times 2) gives a 2×22\times 2 matrix. Row 1 times column 1: 1×2+0×(−1)+(−2)×3=−41\times 2+0\times(-1)+(-2)\times 3=-4. Row 2 times column 2: 3×1+1×4+2×0=73\times 1+1\times 4+2\times 0=7. The full product is (−41117)\begin{pmatrix} -4 & 1 \\ 11 & 7 \end{pmatrix}.

g)

Row 2 times column 3: (−1)×1+1×2+3×(−2)=−5(-1)\times 1+1\times 2+3\times(-2)=-5. Row 3 times column 2: 2×(−1)+0×3+1×1=−12\times(-1)+0\times 3+1\times 1=-1. The full product is (25517−55−10)\begin{pmatrix} 2 & 5 & 5 \\ 1 & 7 & -5 \\ 5 & -1 & 0 \end{pmatrix}. Pitfall: taking column 2 of the FIRST matrix; the first factor always supplies the row.

h)

M2=MM=(1−6−3−122+8−6+16)=(−5−151010)M^{2}=MM=\begin{pmatrix} 1-6 & -3-12 \\ 2+8 & -6+16 \end{pmatrix}=\begin{pmatrix} -5 & -15 \\ 10 & 10 \end{pmatrix}, so (M2)11=−5(M^{2})_{11}=-5 and (M2)22=10(M^{2})_{22}=10. Pitfall: squaring each entry, which gives (19416)\begin{pmatrix} 1 & 9 \\ 4 & 16 \end{pmatrix}.

i)

N2=(42−101)=(4101)N^{2}=\begin{pmatrix} 4 & 2-1 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} 4 & 1 \\ 0 & 1 \end{pmatrix}, then N3=N2N=(84−10−1)=(830−1)N^{3}=N^{2}N=\begin{pmatrix} 8 & 4-1 \\ 0 & -1 \end{pmatrix}=\begin{pmatrix} 8 & 3 \\ 0 & -1 \end{pmatrix}. The diagonal of a triangular matrix can be computed on its own, 23=82^{3}=8 and (−1)3=−1(-1)^{3}=-1, but not the off-diagonal entry. Pitfall: writing 13=11^{3}=1 in position (1,2)(1,2).

j)

P2=(4−12+3−2−3−1+9)=(35−58)P^{2}=\begin{pmatrix} 4-1 & 2+3 \\ -2-3 & -1+9 \end{pmatrix}=\begin{pmatrix} 3 & 5 \\ -5 & 8 \end{pmatrix}, −3P=(−6−33−9)-3P=\begin{pmatrix} -6 & -3 \\ 3 & -9 \end{pmatrix} and 2I=(2002)2I=\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}. The sum is (−12−21)\begin{pmatrix} -1 & 2 \\ -2 & 1 \end{pmatrix}: entries −1-1 and 22. Pitfall: adding 22 to every entry instead of 2I2I, which gives 44 in position (1,2)(1,2).

Check: the rule (m×n)(n×p)=m×p(m\times n)(n\times p)=m\times p tells you the shape of each result in advance, and an entry is cross-checked by recomputing ONE row times ONE column. In j), the trace checks the whole calculation: tr⁡(P2)−3tr⁡(P)+2tr⁡(I)=11−15+4=0\operatorname{tr}(P^{2})-3\operatorname{tr}(P)+2\operatorname{tr}(I)=11-15+4=0, and the trace found is indeed −1+1=0-1+1=0.

Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.

Calculations: inverses to compute

Exercise 0.2: Inverting a matrix: eight direct calculations

For each line, compute the requested inverse, or the solution of the system, then give the indicated entries. A matrix that is not invertible is reported as such.

For a 2×22\times 2 matrix, first compute det⁡A=ad−bc\det A=ad-bc: if it is zero, the matrix is not invertible; otherwise swap aa and dd, change the sign of bb and cc, and divide by the determinant. For a 3×33\times 3 matrix, form [A ∣ I][A\,|\,I] and apply elementary row operations until you reach [I ∣ A−1][I\,|\,A^{-1}]. For a system AX=BAX=B, write X=A−1BX=A^{-1}B, with the inverse on the LEFT.

  • a) P=(5332)P=\begin{pmatrix} 5 & 3 \\ 3 & 2 \end{pmatrix}: compute P−1P^{-1}, then give (P−1)11(P^{-1})_{11} and (P−1)12(P^{-1})_{12}.
  • b) Q=(4−231)Q=\begin{pmatrix} 4 & -2 \\ 3 & 1 \end{pmatrix}: compute Q−1Q^{-1}, then give (Q−1)12(Q^{-1})_{12} and (Q−1)21(Q^{-1})_{21}.
  • c) R=(6−4−96)R=\begin{pmatrix} 6 & -4 \\ -9 & 6 \end{pmatrix}: compute det⁡R\det R and say whether RR is invertible.
  • d) D=(−5000400013)D=\begin{pmatrix} -5 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & \frac{1}{3} \end{pmatrix}: compute D−1D^{-1}, then give (D−1)11(D^{-1})_{11} and (D−1)33(D^{-1})_{33}.
  • e) U=(12−1013001)U=\begin{pmatrix} 1 & 2 & -1 \\ 0 & 1 & 3 \\ 0 & 0 & 1 \end{pmatrix}: compute U−1U^{-1} by the [U ∣ I][U\,|\,I] method, then give (U−1)13(U^{-1})_{13} and (U−1)23(U^{-1})_{23}.
  • f) M=(121252132)M=\begin{pmatrix} 1 & 2 & 1 \\ 2 & 5 & 2 \\ 1 & 3 & 2 \end{pmatrix}: compute M−1M^{-1} by the [M ∣ I][M\,|\,I] method, then give (M−1)11(M^{-1})_{11} and (M−1)32(M^{-1})_{32}.
  • g) Write the system {3x+5y=12x+4y=−2\begin{cases} 3x+5y=1 \\ 2x+4y=-2 \end{cases} in the form AX=BAX=B, then solve it with X=A−1BX=A^{-1}B.
  • h) K=(310210111)K=\begin{pmatrix} 3 & 1 & 0 \\ 2 & 1 & 0 \\ 1 & 1 & 1 \end{pmatrix} has inverse K−1=(1−10−2301−21)K^{-1}=\begin{pmatrix} 1 & -1 & 0 \\ -2 & 3 & 0 \\ 1 & -2 & 1 \end{pmatrix}: solve KX=(534)KX=\begin{pmatrix} 5 \\ 3 \\ 4 \end{pmatrix}, then give yy and zz.

Type your answers, the page tells you right or wrong 0/16

a)
b)
c)
d)
e)
f)
g)
h)
Show the solution

Answers

  • a) P−1=(2−3−35)P^{-1}=\begin{pmatrix} 2 & -3 \\ -3 & 5 \end{pmatrix}; 22 and −3-3
  • b) Q−1=110(12−34)Q^{-1}=\frac{1}{10}\begin{pmatrix} 1 & 2 \\ -3 & 4 \end{pmatrix}; 0.20.2 and −0.3-0.3
  • c) det⁡R=0\det R=0; not invertible
  • d) D−1=diag⁡(−15,14,3)D^{-1}=\operatorname{diag}\left(-\frac{1}{5},\frac{1}{4},3\right); −0.2-0.2 and 33
  • e) U−1=(1−2701−3001)U^{-1}=\begin{pmatrix} 1 & -2 & 7 \\ 0 & 1 & -3 \\ 0 & 0 & 1 \end{pmatrix}; 77 and −3-3
  • f) M−1=(4−1−1−2101−11)M^{-1}=\begin{pmatrix} 4 & -1 & -1 \\ -2 & 1 & 0 \\ 1 & -1 & 1 \end{pmatrix}; 44 and −1-1
  • g) X=A−1B=(7−4)X=A^{-1}B=\begin{pmatrix} 7 \\ -4 \end{pmatrix}; x=7x=7, y=−4y=-4
  • h) X=(2−13)X=\begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix}; y=−1y=-1, z=3z=3

The move that decides everything: the determinant first. If it is zero, the matrix has no inverse and you stop; if not, it is the common denominator of every entry of the inverse. Each result is then checked with one row of the product AA−1=IAA^{-1}=I.

a)

det⁡P=5×2−3×3=1\det P=5\times 2-3\times 3=1. Swap 55 and 22, change the sign of both 33s: P−1=(2−3−35)P^{-1}=\begin{pmatrix} 2 & -3 \\ -3 & 5 \end{pmatrix}. Check on row 1 of PP−1PP^{-1}: 5×2+3×(−3)=15\times 2+3\times(-3)=1 and 5×(−3)+3×5=05\times(-3)+3\times 5=0.

b)

det⁡Q=4×1−(−2)×3=4+6=10\det Q=4\times 1-(-2)\times 3=4+6=10, so Q−1=110(12−34)Q^{-1}=\frac{1}{10}\begin{pmatrix} 1 & 2 \\ -3 & 4 \end{pmatrix}: (Q−1)12=210=0.2(Q^{-1})_{12}=\frac{2}{10}=0.2 and (Q−1)21=−310=−0.3(Q^{-1})_{21}=-\frac{3}{10}=-0.3. Pitfall: writing det⁡Q=4−6=−2\det Q=4-6=-2, forgetting that b=−2b=-2 is already negative.

c)

det⁡R=6×6−(−4)×(−9)=36−36=0\det R=6\times 6-(-4)\times(-9)=36-36=0: RR is not invertible. The second row is −32-\frac{3}{2} times the first, which could be seen before any calculation. Pitfall: applying the formula anyway and dividing by zero.

d)

A diagonal matrix is inverted entry by entry: D−1=(−15000140003)D^{-1}=\begin{pmatrix} -\frac{1}{5} & 0 & 0 \\ 0 & \frac{1}{4} & 0 \\ 0 & 0 & 3 \end{pmatrix}, so (D−1)11=−15=−0.2(D^{-1})_{11}=-\frac{1}{5}=-0.2 and (D−1)33=3(D^{-1})_{33}=3. Pitfall: losing the sign, when 1−5\frac{1}{-5} stays negative.

e)

Start from [U ∣ I][U\,|\,I] and work upward. R2→R2−3R3R_{2}\to R_{2}-3R_{3} gives (0  1  0 ∣ 0  1  −3)(0\ \ 1\ \ 0\,|\,0\ \ 1\ \ -3); R1→R1+R3R_{1}\to R_{1}+R_{3} gives (1  2  0 ∣ 1  0  1)(1\ \ 2\ \ 0\,|\,1\ \ 0\ \ 1); R1→R1−2R2R_{1}\to R_{1}-2R_{2} gives (1  0  0 ∣ 1  −2  7)(1\ \ 0\ \ 0\,|\,1\ \ -2\ \ 7). So U−1=(1−2701−3001)U^{-1}=\begin{pmatrix} 1 & -2 & 7 \\ 0 & 1 & -3 \\ 0 & 0 & 1 \end{pmatrix}: (U−1)13=7(U^{-1})_{13}=7 and (U−1)23=−3(U^{-1})_{23}=-3. Pitfall: only changing the off-diagonal signs, which puts 11 in position (1,3)(1,3); the 7=2×3+17=2\times 3+1 mixes the two other entries.

f)

[M ∣ I][M\,|\,I], then R2→R2−2R1R_{2}\to R_{2}-2R_{1}: (0  1  0 ∣ −2  1  0)(0\ \ 1\ \ 0\,|\,-2\ \ 1\ \ 0); R3→R3−R1R_{3}\to R_{3}-R_{1}: (0  1  1 ∣ −1  0  1)(0\ \ 1\ \ 1\,|\,-1\ \ 0\ \ 1); R3→R3−R2R_{3}\to R_{3}-R_{2}: (0  0  1 ∣ 1  −1  1)(0\ \ 0\ \ 1\,|\,1\ \ -1\ \ 1). Now work upward: R1→R1−2R2R_{1}\to R_{1}-2R_{2} gives (1  0  1 ∣ 5  −2  0)(1\ \ 0\ \ 1\,|\,5\ \ -2\ \ 0), then R1→R1−R3R_{1}\to R_{1}-R_{3} gives (1  0  0 ∣ 4  −1  −1)(1\ \ 0\ \ 0\,|\,4\ \ -1\ \ -1). So M−1=(4−1−1−2101−11)M^{-1}=\begin{pmatrix} 4 & -1 & -1 \\ -2 & 1 & 0 \\ 1 & -1 & 1 \end{pmatrix}: (M−1)11=4(M^{-1})_{11}=4 and (M−1)32=−1(M^{-1})_{32}=-1. Check, row 1 of MM times column 1 of M−1M^{-1}: 4−4+1=14-4+1=1.

g)

A=(3524)A=\begin{pmatrix} 3 & 5 \\ 2 & 4 \end{pmatrix}, X=(xy)X=\begin{pmatrix} x \\ y \end{pmatrix}, B=(1−2)B=\begin{pmatrix} 1 \\ -2 \end{pmatrix}. det⁡A=12−10=2\det A=12-10=2, so A−1=12(4−5−23)A^{-1}=\frac{1}{2}\begin{pmatrix} 4 & -5 \\ -2 & 3 \end{pmatrix} and X=12(4×1+(−5)×(−2)−2×1+3×(−2))=12(14−8)=(7−4)X=\frac{1}{2}\begin{pmatrix} 4\times 1+(-5)\times(-2) \\ -2\times 1+3\times(-2) \end{pmatrix}=\frac{1}{2}\begin{pmatrix} 14 \\ -8 \end{pmatrix}=\begin{pmatrix} 7 \\ -4 \end{pmatrix}. Check: 3×7+5×(−4)=13\times 7+5\times(-4)=1 and 2×7+4×(−4)=−22\times 7+4\times(-4)=-2.

h)

X=K−1(534)X=K^{-1}\begin{pmatrix} 5 \\ 3 \\ 4 \end{pmatrix}, row by row: x=5−3+0=2x=5-3+0=2, y=−10+9+0=−1y=-10+9+0=-1, z=5−6+4=3z=5-6+4=3. Check in KK: 3×2−1=53\times 2-1=5, 2×2−1=32\times 2-1=3 and 2−1+3=42-1+3=4. Pitfall: writing X=BK−1X=BK^{-1}, a (3×1)(3×3)(3\times 1)(3\times 3) product that does not even exist.

Check: each inverse is verified with one row of AA−1AA^{-1}, which must give back a row of II, and each solution is substituted into the original system. A 2×22\times 2 inverse whose entries are not all divided by the determinant is wrong from the start.

Part A: Operations and systems (/50)

Exercise 1: Matrix operations and non-commutativity

Consider the matrices A=(2−130)A=\begin{pmatrix} 2 & -1 \\ 3 & 0 \end{pmatrix} and B=(14−25)B=\begin{pmatrix} 1 & 4 \\ -2 & 5 \end{pmatrix}.

  • a) Compute A+BA+B and 3A−2B3A-2B.
  • b) Find the transpose ATA^{T}.
  • c) Compute both products ABAB and BABA.
  • d) Compare ABAB and BABA. What can you conclude about the commutativity of the matrix product?

Type your answers, the page tells you right or wrong 0/9

a)
b)
c)
d)
Show the solution

Answers

  • a) A+B=(3315)A+B=\begin{pmatrix}3&3\\1&5\end{pmatrix}, 3A−2B=(4−1113−10)3A-2B=\begin{pmatrix}4&-11\\13&-10\end{pmatrix}
  • b) AT=(23−10)A^T=\begin{pmatrix}2&3\\-1&0\end{pmatrix}
  • c) AB=(43312)AB=\begin{pmatrix}4&3\\3&12\end{pmatrix}, BA=(14−1112)BA=\begin{pmatrix}14&-1\\11&2\end{pmatrix}
  • d) AB≠BAAB\neq BA: not commutative
a)

A+B=(2+1−1+43−20+5)=(3315)A+B=\begin{pmatrix} 2+1 & -1+4 \\ 3-2 & 0+5 \end{pmatrix}=\begin{pmatrix} 3 & 3 \\ 1 & 5 \end{pmatrix}. For 3A−2B3A-2B: 3A=(6−390)3A=\begin{pmatrix} 6 & -3 \\ 9 & 0 \end{pmatrix} and 2B=(28−410)2B=\begin{pmatrix} 2 & 8 \\ -4 & 10 \end{pmatrix}, so 3A−2B=(4−1113−10)3A-2B=\begin{pmatrix} 4 & -11 \\ 13 & -10 \end{pmatrix}.

b)

AT=(23−10)A^{T}=\begin{pmatrix} 2 & 3 \\ -1 & 0 \end{pmatrix}: the first row of AA becomes the first column.

c)

AB=((2)(1)+(−1)(−2)(2)(4)+(−1)(5)(3)(1)+(0)(−2)(3)(4)+(0)(5))=(43312)AB=\begin{pmatrix} (2)(1)+(-1)(-2) & (2)(4)+(-1)(5) \\ (3)(1)+(0)(-2) & (3)(4)+(0)(5) \end{pmatrix}=\begin{pmatrix} 4 & 3 \\ 3 & 12 \end{pmatrix}. And BA=((1)(2)+(4)(3)(1)(−1)+(4)(0)(−2)(2)+(5)(3)(−2)(−1)+(5)(0))=(14−1112)BA=\begin{pmatrix} (1)(2)+(4)(3) & (1)(-1)+(4)(0) \\ (-2)(2)+(5)(3) & (-2)(-1)+(5)(0) \end{pmatrix}=\begin{pmatrix} 14 & -1 \\ 11 & 2 \end{pmatrix}.

d)

AB=(43312)≠(14−1112)=BAAB=\begin{pmatrix} 4 & 3 \\ 3 & 12 \end{pmatrix}\neq\begin{pmatrix} 14 & -1 \\ 11 & 2 \end{pmatrix}=BA. The matrix product is therefore NOT commutative: the order of the factors changes the result. This is the most important difference from the product of real numbers, and the number one source of errors in this chapter.

Exercise 2: The matrix product and writing a system

Consider the matrix A=(21−11−32321)A=\begin{pmatrix} 2 & 1 & -1 \\ 1 & -3 & 2 \\ 3 & 2 & 1 \end{pmatrix} and the matrix C=(102103)C=\begin{pmatrix} 1 & 0 \\ 2 & 1 \\ 0 & 3 \end{pmatrix}.

  • a) Is the product ACAC defined? If so, give its size, then compute it.
  • b) Is the product CACA defined? Justify.
  • c) Write the system {2x+y−z=1x−3y+2z=13x+2y+z=10\begin{cases} 2x+y-z=1 \\ x-3y+2z=1 \\ 3x+2y+z=10 \end{cases} in the matrix form AX=BAX=B, specifying XX and BB.
  • d) By computing the product AXAX, check that X=(123)X=\begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} is a solution of the system.

Type your answers, the page tells you right or wrong 0/7

a)
b)
c)
d)
Show the solution

Answers

  • a) 3×23\times 2: (4−2−5375)\begin{pmatrix}4&-2\\-5&3\\7&5\end{pmatrix}
  • b) No: 2 columns, 3 rows
  • c) X=(x,y,z)X=(x,y,z), B=(1,1,10)B=(1,1,10)
  • d) AX=BAX=B: a solution
a)

AA is 3×33\times 3 and CC is 3×23\times 2: the number of columns of AA (3) equals the number of rows of CC (3), so ACAC is defined and has size 3×23\times 2. AC=((2)(1)+(1)(2)+(−1)(0)(2)(0)+(1)(1)+(−1)(3)(1)(1)+(−3)(2)+(2)(0)(1)(0)+(−3)(1)+(2)(3)(3)(1)+(2)(2)+(1)(0)(3)(0)+(2)(1)+(1)(3))=(4−2−5375)AC=\begin{pmatrix} (2)(1)+(1)(2)+(-1)(0) & (2)(0)+(1)(1)+(-1)(3) \\ (1)(1)+(-3)(2)+(2)(0) & (1)(0)+(-3)(1)+(2)(3) \\ (3)(1)+(2)(2)+(1)(0) & (3)(0)+(2)(1)+(1)(3) \end{pmatrix}=\begin{pmatrix} 4 & -2 \\ -5 & 3 \\ 7 & 5 \end{pmatrix}.

b)

CC is 3×23\times 2 and AA is 3×33\times 3: the number of columns of CC (2) differs from the number of rows of AA (3), so CACA is NOT defined. One more illustration that order matters: ACAC exists but CACA does not.

c)

A=(21−11−32321)A=\begin{pmatrix} 2 & 1 & -1 \\ 1 & -3 & 2 \\ 3 & 2 & 1 \end{pmatrix}, X=(xyz)X=\begin{pmatrix} x \\ y \\ z \end{pmatrix} and B=(1110)B=\begin{pmatrix} 1 \\ 1 \\ 10 \end{pmatrix}. The system reads AX=BAX=B.

d)

AX=((2)(1)+(1)(2)+(−1)(3)(1)(1)+(−3)(2)+(2)(3)(3)(1)+(2)(2)+(1)(3))=(2+2−31−6+63+4+3)=(1110)=BAX=\begin{pmatrix} (2)(1)+(1)(2)+(-1)(3) \\ (1)(1)+(-3)(2)+(2)(3) \\ (3)(1)+(2)(2)+(1)(3) \end{pmatrix}=\begin{pmatrix} 2+2-3 \\ 1-6+6 \\ 3+4+3 \end{pmatrix}=\begin{pmatrix} 1 \\ 1 \\ 10 \end{pmatrix}=B. The product gives back exactly BB, so X=(1, 2, 3)X=(1,\ 2,\ 3) is indeed a solution.

Exercise 3: Solving by Gauss-Jordan elimination

We return to the system of the previous exercise, but this time we solve it without knowing the answer in advance:

{2x+y−z=1x−3y+2z=13x+2y+z=10\begin{cases} 2x+y-z=1 \\ x-3y+2z=1 \\ 3x+2y+z=10 \end{cases}

  • a) Write the augmented matrix [A ∣ B][A\,|\,B] of the system.
  • b) Using Gauss-Jordan elimination, reduce this matrix to reduced row echelon form. State the elementary row operations used at each step.
  • c) Deduce the solution of the system.

Type your answers, the page tells you right or wrong 0/4

b)
c)
Show the solution

Answers

  • a) A 3×43\times 4 matrix
  • b) Reduced form [I ∣ X][I\,|\,X]
  • c) (1, 2, 3)(1,\ 2,\ 3)
a)

[A ∣ B]=(21−111−32132110)[A\,|\,B]=\left(\begin{array}{ccc|c} 2 & 1 & -1 & 1 \\ 1 & -3 & 2 & 1 \\ 3 & 2 & 1 & 10 \end{array}\right).

b)

First swap R1R_{1} and R2R_{2} to put a 1 in the top left corner: (1−32121−1132110)\left(\begin{array}{ccc|c} 1 & -3 & 2 & 1 \\ 2 & 1 & -1 & 1 \\ 3 & 2 & 1 & 10 \end{array}\right). Then R2→R2−2R1R_{2}\to R_{2}-2R_{1} and R3→R3−3R1R_{3}\to R_{3}-3R_{1}: (1−32107−5−1011−57)\left(\begin{array}{ccc|c} 1 & -3 & 2 & 1 \\ 0 & 7 & -5 & -1 \\ 0 & 11 & -5 & 7 \end{array}\right).

b, continued) R2→17R2R_{2}\to \tfrac{1}{7}R_{2} gives the row (0, 1, −57 ∣ −17)(0,\ 1,\ -\tfrac{5}{7}\,|\,-\tfrac{1}{7}). Clear column 2 everywhere else: R1→R1+3R2R_{1}\to R_{1}+3R_{2} and R3→R3−11R2R_{3}\to R_{3}-11R_{2}. The third row becomes (0, 0, 207 ∣ 607)(0,\ 0,\ \tfrac{20}{7}\,|\,\tfrac{60}{7}), which after R3→720R3R_{3}\to \tfrac{7}{20}R_{3} is the row (0, 0, 1 ∣ 3)(0,\ 0,\ 1\,|\,3): so z=3z=3.

c)

Working back up (or finishing the reduction): row 2 gives y−57z=−17y-\tfrac{5}{7}z=-\tfrac{1}{7}, hence y=−1+5(3)7=147=2y=\tfrac{-1+5(3)}{7}=\tfrac{14}{7}=2. Row 1 gives x−3y+2z=1x-3y+2z=1, hence x=1+3(2)−2(3)=1x=1+3(2)-2(3)=1. The reduced row echelon form is therefore [I ∣ X][I\,|\,X] with X=(1, 2, 3)X=(1,\ 2,\ 3). The system has the unique solution x=1, y=2, z=3x=1,\ y=2,\ z=3, which confirms the check made in exercise 2.

100101020013x = 1, y = 2, z = 3

Exercise 4: Determinants and the inverse matrix

Consider M=(2−130)M=\begin{pmatrix} 2 & -1 \\ 3 & 0 \end{pmatrix} and A=(21−11−32321)A=\begin{pmatrix} 2 & 1 & -1 \\ 1 & -3 & 2 \\ 3 & 2 & 1 \end{pmatrix}.

  • a) Compute det⁡M\det M.
  • b) Is MM invertible? If so, find M−1M^{-1}, then check that M M−1=IM\,M^{-1}=I.
  • c) Compute det⁡A\det A by cofactor expansion along the first row.
  • d) Using det⁡A\det A, what can you conclude about the number of solutions of the system AX=BAX=B of exercise 3, without solving it?

Type your answers, the page tells you right or wrong 0/6

a)
b)
c)
d)
Show the solution

Answers

  • a) det⁡M=3\det M=3
  • b) M−1=(013−123)M^{-1}=\begin{pmatrix}0&\frac13\\-1&\frac23\end{pmatrix}
  • c) det⁡A=−20\det A=-20
  • d) Unique solution
a)

det⁡M=(2)(0)−(−1)(3)=0+3=3\det M=(2)(0)-(-1)(3)=0+3=3.

b)

det⁡M=3≠0\det M=3\neq 0, so MM is invertible. M−1=13(01−32)=(013−123)M^{-1}=\dfrac{1}{3}\begin{pmatrix} 0 & 1 \\ -3 & 2 \end{pmatrix}=\begin{pmatrix} 0 & \frac{1}{3} \\ -1 & \frac{2}{3} \end{pmatrix}. Check: M M−1=(2−130)(013−123)=(0+123−230+01+0)=(1001)=IM\,M^{-1}=\begin{pmatrix} 2 & -1 \\ 3 & 0 \end{pmatrix}\begin{pmatrix} 0 & \frac{1}{3} \\ -1 & \frac{2}{3} \end{pmatrix}=\begin{pmatrix} 0+1 & \frac{2}{3}-\frac{2}{3} \\ 0+0 & 1+0 \end{pmatrix}=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}=I.

c)

det⁡A=2 det⁡(−3221)−1 det⁡(1231)+(−1) det⁡(1−332)\det A=2\,\det\begin{pmatrix} -3 & 2 \\ 2 & 1 \end{pmatrix}-1\,\det\begin{pmatrix} 1 & 2 \\ 3 & 1 \end{pmatrix}+(-1)\,\det\begin{pmatrix} 1 & -3 \\ 3 & 2 \end{pmatrix}. Now det⁡(−3221)=−3−4=−7\det\begin{pmatrix} -3 & 2 \\ 2 & 1 \end{pmatrix}=-3-4=-7, det⁡(1231)=1−6=−5\det\begin{pmatrix} 1 & 2 \\ 3 & 1 \end{pmatrix}=1-6=-5 and det⁡(1−332)=2+9=11\det\begin{pmatrix} 1 & -3 \\ 3 & 2 \end{pmatrix}=2+9=11. Therefore det⁡A=2(−7)−1(−5)−1(11)=−14+5−11=−20\det A=2(-7)-1(-5)-1(11)=-14+5-11=-20.

d)

det⁡A=−20≠0\det A=-20\neq 0, so AA is invertible and the system AX=BAX=B has a unique solution, whatever the column BB. We know this without solving: it is consistent with the unique solution (1, 2, 3)(1,\ 2,\ 3) found in exercise 3.

-2-1123-11234(2, 3)(−1, 0)area 3

Exercise 5: Inverse of a 3x3 matrix by Gauss-Jordan elimination

Consider the matrix A=(1022−13418)A=\begin{pmatrix} 1 & 0 & 2 \\ 2 & -1 & 3 \\ 4 & 1 & 8 \end{pmatrix}. We want its inverse by the method [A ∣ I]→[I ∣ A−1][A\,|\,I]\to[I\,|\,A^{-1}], which is different from the cofactor formula.

  • a) Write the augmented matrix [A ∣ I3][A\,|\,I_{3}], then apply Gauss-Jordan elimination, stating the elementary row operations. Deduce A−1A^{-1}.
  • b) Check your result by computing the product A A−1A\,A^{-1}.
  • c) Use A−1A^{-1} to solve the system AX=BAX=B with B=(123)B=\begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix}, by writing X=A−1BX=A^{-1}B.
  • d) Explain in one sentence why this method becomes especially worthwhile when several systems AX=BAX=B must be solved with the same matrix AA but different columns BB.

Type your answers, the page tells you right or wrong 0/8

a)
c)
d)
Show the solution

Answers

  • a) A−1=(−1122−4016−1−1)A^{-1}=\begin{pmatrix}-11&2&2\\-4&0&1\\6&-1&-1\end{pmatrix}
  • b) AA−1=I3AA^{-1}=I_3
  • c) (−1, −1, 1)(-1,\ -1,\ 1)
  • d) Inversion done once
a)

Start from [A ∣ I]=(1021002−13010418001)[A\,|\,I]=\left(\begin{array}{ccc|ccc} 1 & 0 & 2 & 1 & 0 & 0 \\ 2 & -1 & 3 & 0 & 1 & 0 \\ 4 & 1 & 8 & 0 & 0 & 1 \end{array}\right). Clear the first column below the pivot: R2→R2−2R1R_{2}\to R_{2}-2R_{1} and R3→R3−4R1R_{3}\to R_{3}-4R_{1} give (1021000−1−1−210010−401)\left(\begin{array}{ccc|ccc} 1 & 0 & 2 & 1 & 0 & 0 \\ 0 & -1 & -1 & -2 & 1 & 0 \\ 0 & 1 & 0 & -4 & 0 & 1 \end{array}\right).

Make the pivot of the second row equal to 11 with R2→−R2R_{2}\to -R_{2}: row (0, 1, 1 ∣ 2, −1, 0)(0,\ 1,\ 1\,|\,2,\ -1,\ 0). Then R3→R3−R2R_{3}\to R_{3}-R_{2} gives (0, 0, −1 ∣ −6, 1, 1)(0,\ 0,\ -1\,|\,-6,\ 1,\ 1), and R3→−R3R_{3}\to -R_{3} gives (0, 0, 1 ∣ 6, −1, −1)(0,\ 0,\ 1\,|\,6,\ -1,\ -1): the pivot of the third row is 11.

It remains to clear the third column above the last pivot: R2→R2−R3R_{2}\to R_{2}-R_{3} gives (0, 1, 0 ∣ −4, 0, 1)(0,\ 1,\ 0\,|\,-4,\ 0,\ 1), and R1→R1−2R3R_{1}\to R_{1}-2R_{3} gives (1, 0, 0 ∣ −11, 2, 2)(1,\ 0,\ 0\,|\,-11,\ 2,\ 2). The left block is now I3I_{3}, so A−1=(−1122−4016−1−1)A^{-1}=\begin{pmatrix} -11 & 2 & 2 \\ -4 & 0 & 1 \\ 6 & -1 & -1 \end{pmatrix}.

b)

A A−1=(1022−13418)(−1122−4016−1−1)A\,A^{-1}=\begin{pmatrix} 1 & 0 & 2 \\ 2 & -1 & 3 \\ 4 & 1 & 8 \end{pmatrix}\begin{pmatrix} -11 & 2 & 2 \\ -4 & 0 & 1 \\ 6 & -1 & -1 \end{pmatrix}. First row: (1)(−11)+(0)(−4)+(2)(6)=1(1)(-11)+(0)(-4)+(2)(6)=1, (1)(2)+(0)(0)+(2)(−1)=0(1)(2)+(0)(0)+(2)(-1)=0, (1)(2)+(0)(1)+(2)(−1)=0(1)(2)+(0)(1)+(2)(-1)=0. Continuing with the other two rows gives I3I_{3}, which confirms the inverse.

c)

X=A−1B=(−1122−4016−1−1)(123)=(−11+4+6−4+0+36−2−3)=(−1−11)X=A^{-1}B=\begin{pmatrix} -11 & 2 & 2 \\ -4 & 0 & 1 \\ 6 & -1 & -1 \end{pmatrix}\begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix}=\begin{pmatrix} -11+4+6 \\ -4+0+3 \\ 6-2-3 \end{pmatrix}=\begin{pmatrix} -1 \\ -1 \\ 1 \end{pmatrix}. The solution is x=−1x=-1, y=−1y=-1, z=1z=1. Check in the first equation x+2z=1x+2z=1: −1+2(1)=1-1+2(1)=1, as required.

d)

Once A−1A^{-1} is known, each new system with the same matrix is solved by a simple product A−1BA^{-1}B, without redoing the reduction: the expensive work, the inversion, is done only once.

Part B: Exam level (/50)

Exercise 6: A proof, and the singular case

This exercise combines a general proof and the study of a system that depends on a parameter.

  • a) Let A=(1203)A=\begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} and B=(4125)B=\begin{pmatrix} 4 & 1 \\ 2 & 5 \end{pmatrix}. Compute (AB)T(AB)^{T} and BTATB^{T}A^{T}, and check that they are equal. The general property is (AB)T=BTAT(AB)^{T}=B^{T}A^{T}: transposition reverses the order of the factors.
  • b) Consider the matrix Ak=(123k)A_{k}=\begin{pmatrix} 1 & 2 \\ 3 & k \end{pmatrix}. For which value of kk is AkA_{k} not invertible?
  • c) Depending on the value of cc, determine the number of solutions of the system {x+2y=33x+6y=c\begin{cases} x+2y=3 \\ 3x+6y=c \end{cases}. Relate your answer to the fact that the determinant of the coefficient matrix is zero.

Type your answers, the page tells you right or wrong 0/5

a)
b)
c)
Show the solution

Answers

  • a) (AB)T=BTAT=(861115)(AB)^T=B^TA^T=\begin{pmatrix}8&6\\11&15\end{pmatrix}
  • b) k=6k=6
  • c) c=9c=9: infinitely many; otherwise none
a)

AB=((1)(4)+(2)(2)(1)(1)+(2)(5)(0)(4)+(3)(2)(0)(1)+(3)(5))=(811615)AB=\begin{pmatrix} (1)(4)+(2)(2) & (1)(1)+(2)(5) \\ (0)(4)+(3)(2) & (0)(1)+(3)(5) \end{pmatrix}=\begin{pmatrix} 8 & 11 \\ 6 & 15 \end{pmatrix}, so (AB)T=(861115)(AB)^{T}=\begin{pmatrix} 8 & 6 \\ 11 & 15 \end{pmatrix}. Also BT=(4215)B^{T}=\begin{pmatrix} 4 & 2 \\ 1 & 5 \end{pmatrix} and AT=(1023)A^{T}=\begin{pmatrix} 1 & 0 \\ 2 & 3 \end{pmatrix}, so BTAT=((4)(1)+(2)(2)(4)(0)+(2)(3)(1)(1)+(5)(2)(1)(0)+(5)(3))=(861115)B^{T}A^{T}=\begin{pmatrix} (4)(1)+(2)(2) & (4)(0)+(2)(3) \\ (1)(1)+(5)(2) & (1)(0)+(5)(3) \end{pmatrix}=\begin{pmatrix} 8 & 6 \\ 11 & 15 \end{pmatrix}. The two results agree: (AB)T=BTAT(AB)^{T}=B^{T}A^{T}. Note that ATBTA^{T}B^{T}, in the wrong order, would give something else: the reversed order is indeed the correct one.

b)

det⁡Ak=(1)(k)−(2)(3)=k−6\det A_{k}=(1)(k)-(2)(3)=k-6. The matrix is not invertible when its determinant is zero, that is, for k=6k=6.

c)

The coefficient matrix is (1236)\begin{pmatrix} 1 & 2 \\ 3 & 6 \end{pmatrix}, with determinant (1)(6)−(2)(3)=0(1)(6)-(2)(3)=0: so the system does not have a unique solution. In detail, the second equation is 3x+6y=c3x+6y=c, that is 3(x+2y)=c3(x+2y)=c. Since the first equation forces x+2y=3x+2y=3, we would need 3(3)=c3(3)=c, that is c=9c=9. So: if c=9c=9, the two equations are proportional and the system has infinitely many solutions (the whole line x+2y=3x+2y=3); if c≠9c\neq 9, the two lines are distinct parallel lines and the system has no solution. The zero determinant signals exactly this switch between infinitely many solutions and none.

Exercise 7: Problem: ticket sales, by Cramer's rule

A concert hall sells three types of tickets, student, regular and VIP, at 15 dollars, 25 dollars and 40 dollars respectively. For one show, let ee, rr and vv be the numbers of student, regular and VIP tickets sold. We know that:

380 tickets were sold in all; the total revenue was 8400 dollars; twice as many regular tickets as VIP tickets were sold.

  • a) Translate the three conditions into a system of three equations in the unknowns ee, rr and vv, then write the coefficient matrix AA and compute det⁡A\det A.
  • b) Solve the system by Cramer's rule, that is, by computing e=det⁡Aedet⁡Ae=\dfrac{\det A_{e}}{\det A}, r=det⁡Ardet⁡Ar=\dfrac{\det A_{r}}{\det A} and v=det⁡Avdet⁡Av=\dfrac{\det A_{v}}{\det A}.
  • c) Synthesis question: keep the same 380 tickets sold and the same condition r=2vr=2v, but replace the revenue by a target value SS. Treating ee, rr and vv as real numbers for now, for which values of SS is there a valid distribution, that is, one with e≥0e\geq 0, r≥0r\geq 0 and v≥0v\geq 0? Interpret the two bounds.
  • d) Tickets are sold one at a time: ee, rr and vv are whole numbers. What is the largest revenue actually possible, and for which distribution?

Type your answers, the page tells you right or wrong 0/7

a)
b)
c)
d)
Show the solution

Answers

  • a) det⁡A=−45\det A=-45
  • b) 200, 120, 60
  • c) 5 700≤S≤11 4005\,700\leq S\leq 11\,400
  • d) 11 37011\,370 dollars, with e=2e=2, r=252r=252 and v=126v=126
a)

The conditions give {e+r+v=38015e+25r+40v=8400r−2v=0\begin{cases} e+r+v=380 \\ 15e+25r+40v=8400 \\ r-2v=0 \end{cases}. The coefficient matrix is A=(11115254001−2)A=\begin{pmatrix} 1 & 1 & 1 \\ 15 & 25 & 40 \\ 0 & 1 & -2 \end{pmatrix}. By cofactor expansion along the first column: det⁡A=1 det⁡(25401−2)−15 det⁡(111−2)+0=1(−50−40)−15(−2−1)=−90+45=−45\det A=1\,\det\begin{pmatrix} 25 & 40 \\ 1 & -2 \end{pmatrix}-15\,\det\begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}+0=1(-50-40)-15(-2-1)=-90+45=-45. Since det⁡A=−45≠0\det A=-45\neq 0, the solution is unique.

b)

Replace each column in turn by B=(38084000)B=\begin{pmatrix} 380 \\ 8400 \\ 0 \end{pmatrix}. This gives det⁡Ae=−9000\det A_{e}=-9000, det⁡Ar=−5400\det A_{r}=-5400 and det⁡Av=−2700\det A_{v}=-2700. Hence e=−9000−45=200e=\dfrac{-9000}{-45}=200, r=−5400−45=120r=\dfrac{-5400}{-45}=120 and v=−2700−45=60v=\dfrac{-2700}{-45}=60. Check: 200+120+60=380200+120+60=380, 15(200)+25(120)+40(60)=3000+3000+2400=840015(200)+25(120)+40(60)=3000+3000+2400=8400 and 120=2(60)120=2(60). The hall sold 200 student tickets, 120 regular tickets and 60 VIP tickets.

c)

With r=2vr=2v, the first equation gives e+2v+v=380e+2v+v=380, so e=380−3ve=380-3v. The revenue becomes S=15(380−3v)+25(2v)+40v=5700+45vS=15(380-3v)+25(2v)+40v=5700+45v, hence v=S−570045v=\dfrac{S-5700}{45}. The constraint v≥0v\geq 0 forces S≥5700S\geq 5700: this is the minimum revenue, reached when v=0v=0 (no regular or VIP tickets, 380 student tickets, revenue 15×380=570015\times 380=5700 dollars). The constraint e=380−3v≥0e=380-3v\geq 0 forces v≤3803v\leq \dfrac{380}{3}, so S≤5700+45⋅3803=5700+5700=11400S\leq 5700+45\cdot\dfrac{380}{3}=5700+5700=11400: this is the upper bound, the revenue the hall would make if the student tickets disappeared entirely in favour of regular and VIP tickets. A valid distribution therefore exists if and only if 5700≤S≤114005700\leq S\leq 11400 dollars. The actual revenue of 8400 dollars is indeed in this interval, which is consistent with the solution found in b).

d)

With whole tickets, vv is a whole number and e=380−3v≥0e=380-3v\geq 0 forces v≤126v\leq 126, since 3×127=381>3803\times 127=381>380. The revenue S=5700+45vS=5700+45v increases with vv, so it is largest for v=126v=126: r=252r=252, e=380−378=2e=380-378=2 and S=5700+45×126=11370S=5700+45\times 126=11370 dollars. The bound 1140011400 from question c) is not reached, because it would take v=3803v=\dfrac{380}{3} VIP tickets. More generally, a revenue SS matches an exact ticket count only if S−570045\dfrac{S-5700}{45} is a whole number between 00 and 126126.

Exercise 8: Homogeneous system, non-trivial solutions and the solution space

Consider the homogeneous system {x+2y−z=02x−y+3z=03x+y+2z=0\begin{cases} x+2y-z=0 \\ 2x-y+3z=0 \\ 3x+y+2z=0 \end{cases}, whose coefficient matrix is A=(12−12−13312)A=\begin{pmatrix} 1 & 2 & -1 \\ 2 & -1 & 3 \\ 3 & 1 & 2 \end{pmatrix}.

  • a) Compute det⁡A\det A. What can you deduce about the existence of solutions other than the zero solution?
  • b) Solve the system by Gaussian elimination and give its general solution in parametric form.
  • c) Interpret the solution set geometrically in space.
  • d) Show that every homogeneous linear system has at least one solution, and state the exact condition for it to have infinitely many.

Type your answers, the page tells you right or wrong 0/6

a)
b)
c)
d)
Show the solution

Answers

  • a) det⁡A=0\det A=0: non-trivial solutions
  • b) t(−1, 1, 1)t(-1,\ 1,\ 1)
  • c) Line through the origin
  • d) Infinitely many if det⁡A=0\det A=0
a)

By cofactor expansion along the first row: det⁡A=1((−1)(2)−(3)(1))−2((2)(2)−(3)(3))+(−1)((2)(1)−(−1)(3))=1(−5)−2(−5)−1(5)=−5+10−5=0\det A=1\big((-1)(2)-(3)(1)\big)-2\big((2)(2)-(3)(3)\big)+(-1)\big((2)(1)-(-1)(3)\big)=1(-5)-2(-5)-1(5)=-5+10-5=0. The determinant is zero, so the matrix is singular: the homogeneous system has non-trivial solutions, that is, solutions other than (0, 0, 0)(0,\ 0,\ 0). One remark speeds everything up: the third row is the sum of the first two, R3=R1+R2R_{3}=R_{1}+R_{2}, which made the dependence visible without any calculation.

b)

Keep the first two equations, the third being redundant. From x+2y−z=0x+2y-z=0 and 2x−y+3z=02x-y+3z=0, eliminate xx: R2→R2−2R1R_{2}\to R_{2}-2R_{1} gives −5y+5z=0-5y+5z=0, so y=zy=z. Substituting into the first: x=z−2y=z−2z=−zx=z-2y=z-2z=-z. Setting z=tz=t as a free parameter, the general solution is (x, y, z)=(−t, t, t)=t(−1, 1, 1)(x,\ y,\ z)=(-t,\ t,\ t)=t(-1,\ 1,\ 1). The direction (1, −1, −1)(1,\ -1,\ -1) works just as well, by changing the sign of the parameter.

c)

The solution set is a line through the origin, with direction vector (−1, 1, 1)(-1,\ 1,\ 1). This is consistent with the geometry: each homogeneous equation represents a plane through the origin, and since the system has rank 22 (the third equation adds nothing), the three planes do not meet at the origin alone but along a whole line.

d)

A homogeneous system reads AX=0⃗AX=\vec{0}. The zero vector X=0⃗X=\vec{0} always satisfies it, since A0⃗=0⃗A\vec{0}=\vec{0}: so there is always at least the trivial solution. The system also has non-trivial solutions, hence infinitely many, if and only if det⁡A=0\det A=0 (the matrix is singular, its columns are linearly dependent). If det⁡A≠0\det A\neq 0, the only solution is the zero solution. Our system is in the first case, with det⁡A=0\det A=0 and a whole line of solutions. This set is closed under addition and scalar multiplication: it is a subspace.

-4-3-2-11234-4-3-2-112345a whole LINEof solutions0 is alwaysa solution

Exercise 9: A system with two parameters: case analysis by rank

Consider the system {x+y+z=2x+2y+3z=52x+3y+az=b\begin{cases} x+y+z=2 \\ x+2y+3z=5 \\ 2x+3y+az=b \end{cases}, where aa and bb are two real parameters.

  • a) Compute the determinant of the coefficient matrix as a function of aa. For which value of aa can the system fail to have a unique solution?
  • b) For a≠4a\neq 4, what can you say about the number of solutions, without computing them?
  • c) Take the case a=4a=4. Using Gaussian elimination, determine the number of solutions depending on the value of bb.
  • d) For a=4a=4 and the value of bb that gives infinitely many solutions, write the general solution in parametric form.

Type your answers, the page tells you right or wrong 0/6

a)
b)
c)
d)
Show the solution

Answers

  • a) det⁡=a−4\det=a-4: a=4a=4
  • b) Unique solution
  • c) b=7b=7: infinitely many; otherwise none
  • d) (−1, 3, 0)+t(1, −2, 1)(-1,\ 3,\ 0)+t(1,\ -2,\ 1)
a)

The determinant of (11112323a)\begin{pmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 2 & 3 & a \end{pmatrix}, expanded along the first row, is 1(2a−9)−1(a−6)+1(3−4)=2a−9−a+6−1=a−41(2a-9)-1(a-6)+1(3-4)=2a-9-a+6-1=a-4. It vanishes for a=4a=4: this is the only value for which the system can fail to have a unique solution.

b)

For a≠4a\neq 4, det⁡≠0\det\neq 0, the matrix is invertible and the system has a unique solution, whatever the value of bb. Cramer's rule or the inverse apply without restriction.

c)

For a=4a=4, the coefficient matrix becomes (111123234)\begin{pmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 2 & 3 & 4 \end{pmatrix}, and we notice that R3=R1+R2R_{3}=R_{1}+R_{2}. Consistency therefore depends on the same test applied to the right-hand side: we need b=2+5=7b=2+5=7. Row reduction shows it: R2→R2−R1R_{2}\to R_{2}-R_{1} and R3→R3−2R1R_{3}\to R_{3}-2R_{1} give the rows (0, 1, 2 ∣ 3)(0,\ 1,\ 2\,|\,3) and (0, 1, 2 ∣ b−4)(0,\ 1,\ 2\,|\,b-4); then R3→R3−R2R_{3}\to R_{3}-R_{2} gives (0, 0, 0 ∣ b−7)(0,\ 0,\ 0\,|\,b-7). If b≠7b\neq 7, this row says 0=b−7≠00=b-7\neq 0, a contradiction: the system has no solution. If b=7b=7, the row becomes 0=00=0: the system has infinitely many solutions.

d)

For a=4a=4 and b=7b=7, two independent equations remain: x+y+z=2x+y+z=2 and y+2z=3y+2z=3. Take z=tz=t as the free parameter: y=3−2ty=3-2t and x=2−y−z=2−(3−2t)−t=−1+tx=2-y-z=2-(3-2t)-t=-1+t. The general solution is (x, y, z)=(−1+t, 3−2t, t)=(−1, 3, 0)+t(1, −2, 1)(x,\ y,\ z)=(-1+t,\ 3-2t,\ t)=(-1,\ 3,\ 0)+t(1,\ -2,\ 1). It is a line of solutions, consistent with the rank 22 of the matrix when a=4a=4.

a ≠ 4a = 4, b = 7a = 4, b ≠ 7

Exercise 10: Proofs: properties of the inverse and special matrices

Questions a) to c) are general proofs about invertible square matrices of order nn. Question d) illustrates the result of a) on an example.

  • a) Let AA and BB be two invertible matrices of the same order. Prove that ABAB is invertible and that (AB)−1=B−1A−1(AB)^{-1}=B^{-1}A^{-1}, paying close attention to the order of the factors.
  • b) Prove that if AA is invertible, then so is ATA^{T}, and (AT)−1=(A−1)T(A^{T})^{-1}=(A^{-1})^{T}.
  • c) Prove that if a matrix AA satisfies A2=AA^{2}=A and is invertible, then A=IA=I.
  • d) Illustrate a) with A=(2001)A=\begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix} and B=(1101)B=\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}: compute (AB)−1(AB)^{-1} and B−1A−1B^{-1}A^{-1}, and check that they are equal but that A−1B−1A^{-1}B^{-1} is different.

Type your answers, the page tells you right or wrong 0/2

d)
Show the solution

Answers

  • a) (AB)−1=B−1A−1(AB)^{-1}=B^{-1}A^{-1}
  • b) (AT)−1=(A−1)T(A^T)^{-1}=(A^{-1})^T
  • c) A−1A2=A−1AA^{-1}A^2=A^{-1}A: A=IA=I
  • d) (12−101)\begin{pmatrix}\frac12&-1\\0&1\end{pmatrix}; A−1B−1A^{-1}B^{-1} is different
a)

It is enough to exhibit a matrix which, multiplied by ABAB, gives the identity on both sides. Let C=B−1A−1C=B^{-1}A^{-1}. Then (AB)C=(AB)(B−1A−1)=A(BB−1)A−1=A I A−1=AA−1=I(AB)C=(AB)(B^{-1}A^{-1})=A(BB^{-1})A^{-1}=A\,I\,A^{-1}=AA^{-1}=I, using the associativity of the product. Likewise C(AB)=B−1(A−1A)B=B−1IB=B−1B=IC(AB)=B^{-1}(A^{-1}A)B=B^{-1}IB=B^{-1}B=I. So ABAB is invertible and its inverse is B−1A−1B^{-1}A^{-1}. The order is reversed: writing A−1B−1A^{-1}B^{-1} would be wrong, because the inner factors would no longer cancel. It is the same reversal as for the transpose, (AB)T=BTAT(AB)^{T}=B^{T}A^{T}.

b)

Transpose the identity AA−1=IAA^{-1}=I. Since (XY)T=YTXT(XY)^{T}=Y^{T}X^{T} and IT=II^{T}=I, we get (A−1)TAT=I(A^{-1})^{T}A^{T}=I. Likewise, transposing A−1A=IA^{-1}A=I gives AT(A−1)T=IA^{T}(A^{-1})^{T}=I. The matrix (A−1)T(A^{-1})^{T} is therefore the inverse of ATA^{T} on both sides: ATA^{T} is invertible and (AT)−1=(A−1)T(A^{T})^{-1}=(A^{-1})^{T}.

c)

Start from A2=AA^{2}=A. Since AA is invertible, we can multiply both sides on the left by A−1A^{-1}: A−1A2=A−1AA^{-1}A^{2}=A^{-1}A. The left side is A−1(AA)=(A−1A)A=IA=AA^{-1}(AA)=(A^{-1}A)A=IA=A, and the right side is II. So A=IA=I. In other words, the only invertible idempotent matrix is the identity: the other matrices satisfying A2=AA^{2}=A (the non-trivial projections) are all singular.

d)

AB=(2001)(1101)=(2201)AB=\begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} 2 & 2 \\ 0 & 1 \end{pmatrix}, with determinant 22, so (AB)−1=12(1−202)=(12−101)(AB)^{-1}=\dfrac{1}{2}\begin{pmatrix} 1 & -2 \\ 0 & 2 \end{pmatrix}=\begin{pmatrix} \frac{1}{2} & -1 \\ 0 & 1 \end{pmatrix}. Also A−1=(12001)A^{-1}=\begin{pmatrix} \frac{1}{2} & 0 \\ 0 & 1 \end{pmatrix} and B−1=(1−101)B^{-1}=\begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}, so B−1A−1=(1−101)(12001)=(12−101)=(AB)−1B^{-1}A^{-1}=\begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} \frac{1}{2} & 0 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} \frac{1}{2} & -1 \\ 0 & 1 \end{pmatrix}=(AB)^{-1}. On the other hand A−1B−1=(12001)(1−101)=(12−1201)≠(AB)−1A^{-1}B^{-1}=\begin{pmatrix} \frac{1}{2} & 0 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} \frac{1}{2} & -\frac{1}{2} \\ 0 & 1 \end{pmatrix}\neq(AB)^{-1}: the wrong order does give a different result.

Part C: the classics (/50)

Exercise 11: Matrix equations: where to put the inverse

Consider A=(2153)A=\begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix} and B=(1021)B=\begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}. We are looking for matrices XX of order 2.

  • a) Show that AA is invertible and compute A−1A^{-1}.
  • b) Solve AX=BAX=B.
  • c) Solve XA=BXA=B. Is the solution the same as in b)?
  • d) Solve AX+X=BAX+X=B.
  • e) For b), a student writes “X=BAX=\frac{B}{A}”. What should you tell them?

Type your answers, the page tells you right or wrong 0/9

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) A−1=(3−1−52)A^{-1}=\begin{pmatrix}3&-1\\-5&2\end{pmatrix}
  • b) X=(1−1−12)X=\begin{pmatrix}1&-1\\-1&2\end{pmatrix}
  • c) X=(3−110)X=\begin{pmatrix}3&-1\\1&0\end{pmatrix}: different
  • d) X=17(2−113)X=\frac17\begin{pmatrix}2&-1\\1&3\end{pmatrix}
  • e) No matrix division
a)

det⁡A=6−5=1≠0\det A=6-5=1\neq 0, so AA is invertible and A−1=11(3−1−52)=(3−1−52)A^{-1}=\frac{1}{1}\begin{pmatrix} 3 & -1 \\ -5 & 2 \end{pmatrix}=\begin{pmatrix} 3 & -1 \\ -5 & 2 \end{pmatrix}.

b)

Multiply ON THE LEFT by A−1A^{-1}: X=A−1B=(3−2−1−5+42)=(1−1−12)X=A^{-1}B=\begin{pmatrix} 3-2 & -1 \\ -5+4 & 2 \end{pmatrix}=\begin{pmatrix} 1 & -1 \\ -1 & 2 \end{pmatrix}. Check: AX=(2−1−2+25−3−5+6)=BAX=\begin{pmatrix} 2-1 & -2+2 \\ 5-3 & -5+6 \end{pmatrix}=B.

c)

Multiply ON THE RIGHT by A−1A^{-1}: X=BA−1=(3−16−5−2+2)=(3−110)X=BA^{-1}=\begin{pmatrix} 3 & -1 \\ 6-5 & -2+2 \end{pmatrix}=\begin{pmatrix} 3 & -1 \\ 1 & 0 \end{pmatrix}. Check: XA=(6−53−321)=BXA=\begin{pmatrix} 6-5 & 3-3 \\ 2 & 1 \end{pmatrix}=B. The solution differs from that of b): since the product is not commutative, the side on which XX sits decides the side on which A−1A^{-1} goes.

d)

Factor XX out on the right: AX+X=AX+IX=(A+I)X=BAX+X=AX+IX=(A+I)X=B. Writing (A+1)X(A+1)X would make no sense: you do not add a number to a matrix. A+I=(3154)A+I=\begin{pmatrix} 3 & 1 \\ 5 & 4 \end{pmatrix}, with determinant 77 and inverse 17(4−1−53)\frac{1}{7}\begin{pmatrix} 4 & -1 \\ -5 & 3 \end{pmatrix}. So X=17(4−2−1−5+63)=17(2−113)X=\frac{1}{7}\begin{pmatrix} 4-2 & -1 \\ -5+6 & 3 \end{pmatrix}=\frac{1}{7}\begin{pmatrix} 2 & -1 \\ 1 & 3 \end{pmatrix}.

e)

Division by a matrix does not exist: BA\frac{B}{A} does not say whether to multiply by A−1A^{-1} on the left or on the right, and that is exactly what changes the answer between b) and c). Always write A−1BA^{-1}B or BA−1BA^{-1}, never a fraction.

The thread: to isolate XX, multiply by the inverse on the same side as the factor to remove; XX is factored out with II, not with 11.

Exercise 12: Triangular matrices: products, powers and inverse

Consider the upper triangular matrices T=(1203)T=\begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} and U=(2−101)U=\begin{pmatrix} 2 & -1 \\ 0 & 1 \end{pmatrix}, and the diagonal matrix D=(2000−10003)D=\begin{pmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 3 \end{pmatrix}.

  • a) Compute TUTU. What shape does the product have, and what are its diagonal entries?
  • b) Compute T2T^{2} and T3T^{3}, conjecture a formula for TnT^{n}, then prove it by induction.
  • c) Compute T−1T^{-1}. Is it still triangular?
  • d) Compute D5D^{5} and D−1D^{-1}.
  • e) Under what condition is a triangular matrix invertible? Is the matrix (145006002)\begin{pmatrix} 1 & 4 & 5 \\ 0 & 0 & 6 \\ 0 & 0 & 2 \end{pmatrix} invertible?

Type your answers, the page tells you right or wrong 0/10

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) TU=(2103)TU=\begin{pmatrix}2&1\\0&3\end{pmatrix}
  • b) Tn=(13n−103n)T^n=\begin{pmatrix}1&3^n-1\\0&3^n\end{pmatrix}
  • c) T−1=(1−23013)T^{-1}=\begin{pmatrix}1&-\frac23\\0&\frac13\end{pmatrix}
  • d) diag(32,−1,243)\text{diag}(32,-1,243); diag(12,−1,13)\text{diag}\left(\frac12,-1,\frac13\right)
  • e) No zero on the diagonal; here, not invertible
a)

TU=(2−1+203)=(2103)TU=\begin{pmatrix} 2 & -1+2 \\ 0 & 3 \end{pmatrix}=\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}: still upper triangular, and its diagonal is the term-by-term product of the diagonals, 1×21\times 2 and 3×13\times 1.

b)

T2=(12+609)=(1809)T^{2}=\begin{pmatrix} 1 & 2+6 \\ 0 & 9 \end{pmatrix}=\begin{pmatrix} 1 & 8 \\ 0 & 9 \end{pmatrix} and T3=T2T=(12+24027)=(126027)T^{3}=T^{2}T=\begin{pmatrix} 1 & 2+24 \\ 0 & 27 \end{pmatrix}=\begin{pmatrix} 1 & 26 \\ 0 & 27 \end{pmatrix}. Conjecture: Tn=(13n−103n)T^{n}=\begin{pmatrix} 1 & 3^{n}-1 \\ 0 & 3^{n} \end{pmatrix}, true for n=1n=1. If it holds for nn, then Tn+1=TnT=(12+3(3n−1)03n+1)=(13n+1−103n+1)T^{n+1}=T^{n}T=\begin{pmatrix} 1 & 2+3(3^{n}-1) \\ 0 & 3^{n+1} \end{pmatrix}=\begin{pmatrix} 1 & 3^{n+1}-1 \\ 0 & 3^{n+1} \end{pmatrix}: the inductive step holds.

c)

det⁡T=3\det T=3 and T−1=13(3−201)=(1−23013)T^{-1}=\frac{1}{3}\begin{pmatrix} 3 & -2 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} 1 & -\frac{2}{3} \\ 0 & \frac{1}{3} \end{pmatrix}: upper triangular, with a diagonal made of the reciprocals 11 and 13\frac{1}{3}.

d)

For a diagonal matrix, raise each diagonal entry to the power: D5=diag(32, −1, 243)D^{5}=\text{diag}(32,\ -1,\ 243), and invert each one: D−1=diag(12, −1, 13)D^{-1}=\text{diag}\left(\frac{1}{2},\ -1,\ \frac{1}{3}\right).

e)

The determinant of a triangular matrix is the product of its diagonal entries: the matrix is invertible if and only if none of them is zero. The given matrix has a 00 on the diagonal, so its determinant is 1×0×2=01\times 0\times 2=0: it is not invertible, despite its large off-diagonal entries.

The thread: products, powers and inverses of triangular matrices stay triangular, and their diagonal is computed term by term.

Exercise 13: The trace of a product

The trace of a square matrix, written tr⁡\operatorname{tr}, is the sum of its diagonal entries. Consider A=(1234)A=\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(015−2)B=\begin{pmatrix} 0 & 1 \\ 5 & -2 \end{pmatrix}.

  • a) Compute ABAB and BABA, then their traces. Are the two products equal?
  • b) Prove that tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB)=\operatorname{tr}(BA) for all square matrices AA and BB of order 2.
  • c) Are there two square matrices of order 2 such that AB−BA=IAB-BA=I? Justify.
  • d) With E=(1000)E=\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, F=(0100)F=\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} and G=(0010)G=\begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}, compute tr⁡(EFG)\operatorname{tr}(EFG) and tr⁡(FEG)\operatorname{tr}(FEG). What do you conclude?
  • e) Show that tr⁡(P−1AP)=tr⁡(A)\operatorname{tr}(P^{-1}AP)=\operatorname{tr}(A) for every invertible matrix PP, and check it with P=(1101)P=\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}.

Type your answers, the page tells you right or wrong 0/7

a)
c)
d)
e)
Show the solution

Answers

  • a) Both traces equal 5, the products differ
  • b) The same four products
  • c) No: 0≠20\neq 2
  • d) 1 and 0: the trace is only cyclic
  • e) Trace 5 preserved
a)

AB=(10−320−5)AB=\begin{pmatrix} 10 & -3 \\ 20 & -5 \end{pmatrix} and BA=(34−12)BA=\begin{pmatrix} 3 & 4 \\ -1 & 2 \end{pmatrix}. The products are different, but tr⁡(AB)=10−5=5\operatorname{tr}(AB)=10-5=5 and tr⁡(BA)=3+2=5\operatorname{tr}(BA)=3+2=5.

b)

With A=(aij)A=(a_{ij}) and B=(bij)B=(b_{ij}): tr⁡(AB)=(a11b11+a12b21)+(a21b12+a22b22)\operatorname{tr}(AB)=(a_{11}b_{11}+a_{12}b_{21})+(a_{21}b_{12}+a_{22}b_{22}) and tr⁡(BA)=(b11a11+b12a21)+(b21a12+b22a22)\operatorname{tr}(BA)=(b_{11}a_{11}+b_{12}a_{21})+(b_{21}a_{12}+b_{22}a_{22}). These are the same four products of numbers, arranged differently: the two traces are equal. The same calculation, ∑i,jaijbji\sum_{i,j}a_{ij}b_{ji}, works for any order nn.

c)

No. The trace is linear, so tr⁡(AB−BA)=tr⁡(AB)−tr⁡(BA)=0\operatorname{tr}(AB-BA)=\operatorname{tr}(AB)-\operatorname{tr}(BA)=0, whereas tr⁡(I)=2\operatorname{tr}(I)=2. No pair of matrices can satisfy this equality, in any finite order.

d)

EF=(0100)EF=\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, then EFG=(1000)EFG=\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, with trace 11. FE=(0000)FE=\begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}, so FEGFEG is zero, with trace 00. The factors can be rotated, tr⁡(EFG)=tr⁡(GEF)\operatorname{tr}(EFG)=\operatorname{tr}(GEF), but not permuted freely: the property is CYCLIC, not commutative.

e)

By b) applied to P−1AP^{-1}A and PP: tr⁡((P−1A)P)=tr⁡(P(P−1A))=tr⁡(A)\operatorname{tr}\big((P^{-1}A)P\big)=\operatorname{tr}\big(P(P^{-1}A)\big)=\operatorname{tr}(A). With P−1=(1−101)P^{-1}=\begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}: P−1A=(−2−234)P^{-1}A=\begin{pmatrix} -2 & -2 \\ 3 & 4 \end{pmatrix} and P−1AP=(−2−437)P^{-1}AP=\begin{pmatrix} -2 & -4 \\ 3 & 7 \end{pmatrix}, with trace 5=tr⁡(A)5=\operatorname{tr}(A). Two similar matrices have the same trace, which will be useful for eigenvalues.

The thread: the trace does not see the order of a product of two factors; that is what rules out AB−BA=IAB-BA=I and makes the trace invariant under a change of basis.

Exercise 14: Problem: traffic flows in a neighbourhood

Four intersections AA, BB, CC and DD form a square of one-way streets: x1x_{1} cars per hour go from AA to BB, x2x_{2} from BB to CC, x3x_{3} from CC to DD and x4x_{4} from DD to AA.

Outside streets bring traffic in and take it out, in cars per hour: at AA, 500500 enter and 200200 leave; at BB, 300300 enter and 400400 leave; at CC, 200200 enter and 600600 leave; at DD, 400400 enter and 200200 leave. At each intersection, as many cars enter as leave.

In the figure, the green arrows come into the neighbourhood and the orange arrows leave it.

x₁x₂x₃x₄500200A300400B200600C400200D
  • a) Write the four conservation equations.
  • b) Find the rank of the system. Why is one equation redundant?
  • c) Express x2x_{2}, x3x_{3} and x4x_{4} in terms of x1=tx_{1}=t, then compute them for t=600t=600.
  • d) No flow can be negative, since the streets are one-way. What is the smallest possible value of x1x_{1}?
  • e) Roadwork closes the street from CC to DD. What are the other flows? Could the street from BB to CC also be limited to 300300 cars per hour?

Type your answers, the page tells you right or wrong 0/8

b)
c)
d)
e)
Show the solution

Answers

  • a) x1−x4=300x_1-x_4=300, x1−x2=100x_1-x_2=100, x2−x3=400x_2-x_3=400, x3−x4=−200x_3-x_4=-200
  • b) Rank 3
  • c) t−100t-100, t−500t-500, t−300t-300; 500, 100, 300
  • d) x1≥500x_1\geq 500
  • e) x2=400x_2=400, x4=200x_4=200; the limit is impossible
a)

At AA: 500+x4=x1+200500+x_{4}=x_{1}+200, that is x1−x4=300x_{1}-x_{4}=300. At BB: x1+300=x2+400x_{1}+300=x_{2}+400, that is x1−x2=100x_{1}-x_{2}=100. At CC: x2+200=x3+600x_{2}+200=x_{3}+600, that is x2−x3=400x_{2}-x_{3}=400. At DD: x3+400=x4+200x_{3}+400=x_{4}+200, that is x3−x4=−200x_{3}-x_{4}=-200.

b)

The equations at BB, CC and DD, added together, give x1−x4=300x_{1}-x_{4}=300, the equation at AA. The rank is 33: four unknowns and three independent equations, hence one free parameter. The redundancy comes from the overall balance: 1 4001\,400 cars per hour enter the neighbourhood and 1 4001\,400 leave it, so the last intersection is balanced as soon as the other three are.

c)

x2=t−100x_{2}=t-100, x3=x2−400=t−500x_{3}=x_{2}-400=t-500 and x4=x3+200=t−300x_{4}=x_{3}+200=t-300. For t=600t=600: x2=500x_{2}=500, x3=100x_{3}=100 and x4=300x_{4}=300. Check at AA: 600−300=300600-300=300.

d)

We need t−100≥0t-100\geq 0, t−500≥0t-500\geq 0 and t−300≥0t-300\geq 0: the strongest constraint is t≥500t\geq 500. At the minimum, 500500 cars per hour go from AA to BB, and the street from CC to DD is then empty.

e)

x3=0x_{3}=0 forces t=500t=500, so x1=500x_{1}=500, x2=400x_{2}=400 and x4=200x_{4}=200: only one distribution is possible. Limiting x2x_{2} to 300300 would require t≤400t\leq 400, which is incompatible with t≥500t\geq 500: it is impossible without changing the inflows and outflows, the neighbourhood would be saturated.

The thread: a flow network translates into a system whose rank gives the number of degrees of freedom; the physical constraints then cut out the interval of acceptable solutions.

Exercise 15: Problem: a bakery's production in matrices

A bakery makes croissants, pains au chocolat and brioches. The matrix MM gives, in grams, the flour, butter and sugar (rows) used for one piece of each product (columns): M=(50556025251551015)M=\begin{pmatrix} 50 & 55 & 60 \\ 25 & 25 & 15 \\ 5 & 10 & 15 \end{pmatrix}.

The purchase price of the ingredients, in dollars per gram, is given by the row matrix p=(0.0020.0120.003)p=\begin{pmatrix} 0.002 & 0.012 & 0.003 \end{pmatrix}.

  • a) An order consists of 100100 croissants, 8080 pains au chocolat and 5050 brioches, written q=(1008050)q=\begin{pmatrix} 100 \\ 80 \\ 50 \end{pmatrix}. Compute MqMq and interpret it.
  • b) Compute pMpM and interpret each of its entries.
  • c) Compute the ingredient cost of the order in two ways, p(Mq)p(Mq) and (pM)q(pM)q.
  • d) Today's stock is 11 90011\,900 grams of flour, 5 1005\,100 grams of butter and 2 0002\,000 grams of sugar. Compute det⁡M\det M, then find the production that uses up exactly all the stock.
  • e) Why does question d) require det⁡M≠0\det M\neq 0, and what would a solution with a negative component mean?

Type your answers, the page tells you right or wrong 0/10

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 12 40012\,400 g, 5 2505\,250 g, 2 0502\,050 g
  • b) 0.4150.415; 0.440.44; 0.3450.345 dollar
  • c) 93.9593.95 dollars
  • d) det⁡M=2 250\det M=2\,250; 80, 100, 40
  • e) Unique solution; negative: impossible
a)

Mq=(5 000+4 400+3 0002 500+2 000+750500+800+750)=(12 4005 2502 050)Mq=\begin{pmatrix} 5\,000+4\,400+3\,000 \\ 2\,500+2\,000+750 \\ 500+800+750 \end{pmatrix}=\begin{pmatrix} 12\,400 \\ 5\,250 \\ 2\,050 \end{pmatrix}: the order needs 12 40012\,400 grams of flour, 5 2505\,250 of butter and 2 0502\,050 of sugar. The product is defined because MM has three columns, one per product, just as qq has three rows.

b)

pM=(0.1+0.3+0.0150.11+0.3+0.030.12+0.18+0.045)=(0.4150.440.345)pM=\begin{pmatrix} 0.1+0.3+0.015 & 0.11+0.3+0.03 & 0.12+0.18+0.045 \end{pmatrix}=\begin{pmatrix} 0.415 & 0.44 & 0.345 \end{pmatrix}: the ingredient cost of one croissant, one pain au chocolat and one brioche, in dollars.

c)

p(Mq)=0.002×12 400+0.012×5 250+0.003×2 050=24.80+63.00+6.15=93.95p(Mq)=0.002\times 12\,400+0.012\times 5\,250+0.003\times 2\,050=24.80+63.00+6.15=93.95 dollars. (pM)q=0.415×100+0.44×80+0.345×50=41.50+35.20+17.25=93.95(pM)q=0.415\times 100+0.44\times 80+0.345\times 50=41.50+35.20+17.25=93.95 dollars. Same result: this is the associativity of the matrix product, read first by ingredients, then by products.

d)

det⁡M=50(375−150)−55(375−75)+60(250−125)=11 250−16 500+7 500=2 250≠0\det M=50(375-150)-55(375-75)+60(250-125)=11\,250-16\,500+7\,500=2\,250\neq 0. The system Mq=sMq=s has a unique solution; check that q=(8010040)q=\begin{pmatrix} 80 \\ 100 \\ 40 \end{pmatrix} works: 4 000+5 500+2 400=11 9004\,000+5\,500+2\,400=11\,900, 2 000+2 500+600=5 1002\,000+2\,500+600=5\,100 and 400+1 000+600=2 000400+1\,000+600=2\,000. The bakery can make 8080 croissants, 100100 pains au chocolat and 4040 brioches.

e)

If det⁡M=0\det M=0, the recipes would be linked, for example one recipe a combination of the other two: the system would have infinitely many solutions or none, never a unique production. A negative component would be a mathematical solution with no physical meaning: to use up the stock exactly, you would have to “unmake” pastries, and you would then have to give up using everything.

The thread: the rows and columns of a matrix carry a meaning; a matrix product is defined only if those meanings link up, and a solution is acceptable only if it respects reality.

Something missing from this set? A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous chapter Lines and planes in space, 201-SN4-RE Next chapter Linear systems, Gauss and Gauss-Jordan, 201-SN4-RE

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/cegep-sn4-matrices-and-determinants. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a linear algebra tutor in Montreal?

Get in touch for a first session. We work on 201-SN4-RE at the real level of CEGEP evaluations, from matrix operations to Cramer's rule and the analysis of singular cases.

Site by Studio Squalli