MATH 133 Linear Algebra and Geometry • McGill University, Montreal

Corrected exercises: matrix algebra, transpose and the matrix product (MATH 133)

This is the corrected exercise set for the matrix algebra chapter of MATH 133, Linear Algebra and Geometry, the first-year course at McGill University, sections 2.1 and 2.3 of Nicholson. It covers equality, addition and scalar multiples of matrices, the transpose and its rules, symmetric and skew-symmetric matrices, the matrix product under its three readings, powers of a matrix and the trace. Every number is chosen to be handled by hand, since the exam allows no calculator, and every solution names the reading of the product it uses.

The thread running through the whole set: a matrix product remembers the ORDER of its factors. A row of the LEFT factor meets a column of the RIGHT factor, so the sizes decide first whether the product exists at all, and every rule of ordinary algebra that quietly swaps two factors, ab=baab = ba, (ab)T=aTbT(ab)^T = a^T b^T, ab=0ab = 0 so a=0a = 0 or b=0b = 0, a2=1a^2 = 1 so a=±1a = \pm 1, has to be re-proved before it is used. Most of them turn out to be false, and the few that survive, like the binomial expansion of two commuting matrices or tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA), survive for a reason you can name.

The traps named explicitly in the solutions: multiplying entry by entry, computing a product whose inner sizes disagree, reading the indices of an entry backwards, writing XAXA as 'the same computation' as AXAX, transposing a product without reversing it, squaring the entries of a matrix to get its square, concluding A=0A = 0 from A2=0A^2 = 0 or AB=0AB = 0, believing a product of symmetric matrices is symmetric, and treating diagonal matrices as if they commuted with everything.

10 corrected exercises • 100 points • 150 minutes

Revision sheet for this chapter → Every MATH 133 chapter →

Course recap

  • • An m×nm \times n matrix times an n×pn \times p matrix is an m×pm \times p matrix: the INNER sizes must agree, the OUTER sizes give the shape. A sum needs identical sizes.
  • • Entry (i,j)(i,j) of ABAB is row ii of AA against column jj of BB: (AB)ij=ai1b1j+ai2b2j+⋯+ainbnj(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}.
  • • Column jj of ABAB is AA times column jj of BB, a combination of the columns of AA. Row ii of ABAB is row ii of AA times BB, a combination of the rows of BB.
  • • (AB)C=A(BC)(AB)C = A(BC) and A(B+C)=AB+ACA(B + C) = AB + AC, but in general AB≠BAAB \neq BA, and AB=0AB = 0 does not force A=0A = 0 or B=0B = 0.
  • • (AT)T=A(A^T)^T = A, (A+B)T=AT+BT(A + B)^T = A^T + B^T, (kA)T=kAT(kA)^T = kA^T and (AB)T=BTAT(AB)^T = B^T A^T. Symmetric: AT=AA^T = A. Skew-symmetric: AT=−AA^T = -A. Every square A=12(A+AT)+12(A−AT)A = \frac{1}{2}(A + A^T) + \frac{1}{2}(A - A^T).
  • • Nilpotent: Ak=0A^k = 0 for some kk. Idempotent: A2=AA^2 = A. The binomial theorem holds for (A+B)n(A + B)^n only when AB=BAAB = BA.
  • • tr⁡A\operatorname{tr} A is the sum of the diagonal entries; tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA) whenever both products exist.

Part A: the basics (/50)

Exercise 1: Sizes first: when a product exists, and what shape it has

Before a single entry is computed, a product has to pass a size test. An m×nm \times n matrix can multiply an n×pn \times p matrix, because each row of the first has exactly as many entries as each column of the second, and the result is m×pm \times p. The figure shows the rule on a pair that is not in the questions: the INNER sizes must agree, the OUTER sizes give the shape.

Throughout, A=(120−131)A = \begin{pmatrix} 1 & 2 & 0 \\ -1 & 3 & 1 \end{pmatrix} and B=(210−114)B = \begin{pmatrix} 2 & 1 \\ 0 & -1 \\ 1 & 4 \end{pmatrix}.

A: 2 × 3B: 3 × 4AB: 2 × 4=3 columns3 rowsinner sizes 3 and 3 must agree, outer sizes 2 and 4 give the shape
  • a) Sizes only. AA is 2×32 \times 3, BB is 3×23 \times 2, CC is some 3×33 \times 3 matrix and uu is a column of R3\mathbb{R}^3, that is 3×13 \times 1. For each of ABAB, BABA, ACAC, CACA, BCBC, A+BTA + B^T, uTCu^T C and uCuC, say whether it exists and give its size.
  • b) Compute ABAB and BABA. What is the first thing you notice, before comparing a single entry?
  • c) With u=(1,2,−1)Tu = (1, 2, -1)^T, compute uTuu^T u and uuTu u^T.
  • d) AA is m×nm \times n. What size must a matrix XX have for both AXAX and XAXA to exist? For which mm, nn can the question whether AX=XAAX = XA even be asked?
  • e) Give the (3,1)(3,1) entry of the triple product BABBAB, choosing the bracketing that costs the fewest multiplications.
Show the solution

Answers

  • a) ABAB: 2×22 \times 2; BABA: 3×33 \times 3; ACAC: 2×32 \times 3; CACA: undefined; BCBC: undefined; A+BTA + B^T: 2×32 \times 3; uTCu^T C: 1×31 \times 3; uCuC: undefined
  • b) AB=(2−1−10)AB = \begin{pmatrix} 2 & -1 \\ -1 & 0 \end{pmatrix}, BA=(1711−3−1−3144)BA = \begin{pmatrix} 1 & 7 & 1 \\ 1 & -3 & -1 \\ -3 & 14 & 4 \end{pmatrix}: not even the same size
  • c) uTu=(6)u^T u = (6), a 1×11 \times 1; uuT=(12−124−2−1−21)u u^T = \begin{pmatrix} 1 & 2 & -1 \\ 2 & 4 & -2 \\ -1 & -2 & 1 \end{pmatrix}, a 3×33 \times 3
  • d) XX must be n×mn \times m; AX=XAAX = XA can only be asked when m=nm = n
  • e) (BAB)31=−2(BAB)_{31} = -2, computed as row 3 of BB times column 1 of ABAB

a) The test is always the same: write the two sizes side by side and look at the two numbers in the MIDDLE. ABAB is (2×3)(3×2)(2 \times 3)(3 \times 2), inner 3=33 = 3, so it exists and is 2×22 \times 2. BABA is (3×2)(2×3)(3 \times 2)(2 \times 3), inner 2=22 = 2, so it exists and is 3×33 \times 3. ACAC is (2×3)(3×3)(2 \times 3)(3 \times 3), which is 2×32 \times 3. CACA is (3×3)(2×3)(3 \times 3)(2 \times 3), inner 3≠23 \neq 2: it does not exist, even though ACAC does. BCBC is (3×2)(3×3)(3 \times 2)(3 \times 3), inner 2≠32 \neq 3: undefined. A+BTA + B^T is a sum, and a sum needs IDENTICAL sizes, not matching inner ones: BTB^T is 2×32 \times 3 like AA, so the sum exists and is 2×32 \times 3, while A+BA + B would not. uTCu^T C is (1×3)(3×3)=1×3(1 \times 3)(3 \times 3) = 1 \times 3, and uCuC is (3×1)(3×3)(3 \times 1)(3 \times 3), inner 1≠31 \neq 3, undefined. Writing out the two sizes costs three seconds and it is the only line that catches a product that does not exist before you have spent a page computing it.

b) Row ii of AA against column jj of BB. Row 1 of AA is (1,2,0)(1, 2, 0): against column 1 of BB, (2,0,1)(2, 0, 1), it gives 2+0+0=22 + 0 + 0 = 2; against column 2, (1,−1,4)(1, -1, 4), it gives 1−2+0=−11 - 2 + 0 = -1. Row 2, (−1,3,1)(-1, 3, 1), gives −2+0+1=−1-2 + 0 + 1 = -1 and −1−3+4=0-1 - 3 + 4 = 0. So AB=(2−1−10)AB = \begin{pmatrix} 2 & -1 \\ -1 & 0 \end{pmatrix}. For BABA, row 1 of BB is (2,1)(2, 1) and the columns of AA are (1,−1)(1, -1), (2,3)(2, 3), (0,1)(0, 1), giving 11, 77, 11; row 2, (0,−1)(0, -1), gives 11, −3-3, −1-1; row 3, (1,4)(1, 4), gives −3-3, 1414, 44. So BA=(1711−3−1−3144)BA = \begin{pmatrix} 1 & 7 & 1 \\ 1 & -3 & -1 \\ -3 & 14 & 4 \end{pmatrix}. The first thing to notice needs no entry at all: ABAB is 2×22 \times 2 and BABA is 3×33 \times 3. Non-commutativity starts here, in its crudest form. For non-square factors the two orders are not even comparable.

c) uTuu^T u is (1×3)(3×1)(1 \times 3)(3 \times 1), a 1×11 \times 1 matrix: 1+4+1=61 + 4 + 1 = 6. uuTu u^T is (3×1)(1×3)(3 \times 1)(1 \times 3), a 3×33 \times 3 matrix whose (i,j)(i,j) entry is uiuju_i u_j, so uuT=(12−124−2−1−21)u u^T = \begin{pmatrix} 1 & 2 & -1 \\ 2 & 4 & -2 \\ -1 & -2 & 1 \end{pmatrix}. The same two factors in the two orders give a number in one case and nine numbers in the other. A student who writes uuT=6u u^T = 6 has computed the wrong product, and nothing in the arithmetic warns them: only the sizes do. Notice also that uuTu u^T is symmetric and that its diagonal adds up to 66, a first sighting of the trace identity of exercise 7.

d) If AA is m×nm \times n, then AXAX needs XX to have nn rows and XAXA needs XX to have mm columns, so XX is n×mn \times m. Then AXAX is m×mm \times m and XAXA is n×nn \times n. The equation AX=XAAX = XA compares two matrices, so it only makes sense when they have the same size, that is m=nm = n: commuting is a question about SQUARE matrices, and exercise 6 only asks it there.

e) BABBAB is (3×2)(2×3)(3×2)(3 \times 2)(2 \times 3)(3 \times 2), a 3×23 \times 2 matrix, and associativity lets us bracket it either way. (BA)B(BA)B first builds the 3×33 \times 3 matrix BABA, nine entries; B(AB)B(AB) first builds the 2×22 \times 2 matrix ABAB, four entries, already found in b). Take the cheaper one. The (3,1)(3,1) entry of B(AB)B(AB) is row 3 of BB times column 1 of ABAB: (1,4)⋅(2,−1)=2−4=−2(1, 4) \cdot (2, -1) = 2 - 4 = -2. The check through the other bracketing, row 3 of BABA times column 1 of BB, gives (−3)(2)+14(0)+4(1)=−2(-3)(2) + 14(0) + 4(1) = -2 as well. What you may NOT do is move a factor: B(AB)=(BA)BB(AB) = (BA)B is associativity, allowed, while BAB=ABBBAB = ABB would be commutativity, forbidden.

Exercise 2: One entry, one column, one row: three readings of the same product

The product ABAB can be read three ways, and an examiner who asks for one entry, one column or one row is testing whether you know which reading to use. Entry (i,j)(i,j) is row ii of AA times column jj of BB. Column jj of ABAB is AA times column jj of BB. Row ii of ABAB is row ii of AA times BB.

Here A=(102−131210)A = \begin{pmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 2 & 1 & 0 \end{pmatrix} and B=(2130−11120)B = \begin{pmatrix} 2 & 1 & 3 \\ 0 & -1 & 1 \\ 1 & 2 & 0 \end{pmatrix}. The figure computes one entry, the (3,1)(3,1), and nothing else.

102-1312102130-11120········4ABAB=row 3 of A times column 1 of B: 2(2) + 1(0) + 0(1) = 4
  • a) Compute the (2,3)(2,3) entry of ABAB, and only that entry.
  • b) Compute the second column of ABAB as AA times the second column of BB, then write it as a combination of the columns of AA.
  • c) Compute the third row of ABAB as the third row of AA times BB, then write it as a combination of the rows of BB.
  • d) Check that the third column of BB equals twice its first column minus its second. Without any new row-times-column product, deduce the third column of ABAB from its first two, computing the first column by the reading of b).
  • e) The second row of AA is replaced by zeros. Which entries of ABAB change, and to what? Same question if instead the first column of BB is replaced by zeros.
Show the solution

Answers

  • a) (AB)23=0(AB)_{23} = 0
  • b) second column (5,−2,1)T=1 a1−1 a2+2 a3(5, -2, 1)^T = 1\,a_1 - 1\,a_2 + 2\,a_3
  • c) third row (4,1,7)=2 r1+1 r2+0 r3(4, 1, 7) = 2\,r_1 + 1\,r_2 + 0\,r_3
  • d) first column (4,−1,4)T(4, -1, 4)^T, third column 2(4,−1,4)T−(5,−2,1)T=(3,0,7)T2(4,-1,4)^T - (5,-2,1)^T = (3, 0, 7)^T
  • e) only row 2 of ABAB becomes zero; in the second case only column 1 of ABAB becomes zero

a) Row 2 of AA is (−1,3,1)(-1, 3, 1) and column 3 of BB is (3,1,0)(3, 1, 0), so (AB)23=(−1)(3)+3(1)+1(0)=−3+3+0=0(AB)_{23} = (-1)(3) + 3(1) + 1(0) = -3 + 3 + 0 = 0. Three multiplications and two additions, not twenty-seven multiplications. The classic slip is to take column 2 of AA with row 3 of BB, the indices read backwards: that gives 0(1)+3(2)+1(0)=60(1) + 3(2) + 1(0) = 6, a wrong answer that looks perfectly reasonable. Say it aloud once: the FIRST index picks a row of the LEFT factor, the SECOND index picks a column of the RIGHT factor.

b) Column 2 of BB is (1,−1,2)T(1, -1, 2)^T. Then A(1,−1,2)T=(1−0+4,  −1−3+2,  2−1+0)T=(5,−2,1)TA(1, -1, 2)^T = (1 - 0 + 4,\; -1 - 3 + 2,\; 2 - 1 + 0)^T = (5, -2, 1)^T. Read the same computation column by column: AA times a vector is the combination of the COLUMNS of AA with the entries of that vector as weights, 1⋅(1,−1,2)T−1⋅(0,3,1)T+2⋅(2,1,0)T=(5,−2,1)T1 \cdot (1, -1, 2)^T - 1 \cdot (0, 3, 1)^T + 2 \cdot (2, 1, 0)^T = (5, -2, 1)^T. This reading is the bridge to the previous chapter: every column of ABAB is a linear combination of the columns of AA, so every column of ABAB lives wherever the columns of AA live.

c) Row 3 of AA is (2,1,0)(2, 1, 0), and a row times BB is the combination of the ROWS of BB with those weights: 2(2,1,3)+1(0,−1,1)+0(1,2,0)=(4,2,6)+(0,−1,1)=(4,1,7)2(2, 1, 3) + 1(0, -1, 1) + 0(1, 2, 0) = (4, 2, 6) + (0, -1, 1) = (4, 1, 7). Its first entry, 44, is the entry the figure computed, which is the free check. The two readings are mirror images: columns of ABAB are built from the columns of the LEFT factor, rows of ABAB from the rows of the RIGHT factor. Mixing them up, combining rows of AA for instance, is the error that turns a correct method into a wrong matrix.

d) Twice column 1 of BB minus column 2 is 2(2,0,1)T−(1,−1,2)T=(3,1,0)T2(2, 0, 1)^T - (1, -1, 2)^T = (3, 1, 0)^T, which is column 3: checked. Column 1 of ABAB is A(2,0,1)T=(2+0+2,  −2+0+1,  4+0+0)T=(4,−1,4)TA(2, 0, 1)^T = (2 + 0 + 2,\; -2 + 0 + 1,\; 4 + 0 + 0)^T = (4, -1, 4)^T. Now AA times a combination is the same combination of the products, because multiplying by AA is linear: A(2b1−b2)=2Ab1−Ab2A(2b_1 - b_2) = 2Ab_1 - Ab_2. So column 3 of ABAB is 2(4,−1,4)T−(5,−2,1)T=(3,0,7)T2(4, -1, 4)^T - (5, -2, 1)^T = (3, 0, 7)^T, with no new row-times-column product. It agrees with a), whose entry 00 sits in position 2, and with c), whose row ends in 77. A relation among the columns of BB is inherited by the columns of ABAB: that is the column reading doing real work, not just giving a second route.

e) By the row reading, row 2 of ABAB is row 2 of AA times BB. If that row of AA is zero, row 2 of ABAB is zero, and the other two rows, which never used row 2 of AA, do not move: ABAB becomes (453000417)\begin{pmatrix} 4 & 5 & 3 \\ 0 & 0 & 0 \\ 4 & 1 & 7 \end{pmatrix}. By the column reading, column 1 of ABAB is AA times column 1 of BB; a zero column there gives a zero column in ABAB, and nothing else changes. So a product can acquire a zero row or a zero column without either factor being zero, and pushing the idea one step further, the whole product can vanish while both factors are non-zero. Exercise 3 builds exactly such a pair.

Exercise 3: The order is part of the product: AB is zero, BA is not

Two square matrices of the same size can always be multiplied in both orders, and the two products usually differ. This exercise pushes the difference to its extreme: one order gives the zero matrix, the other does not.

Let A=(1224)A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} and B=(2−4−12)B = \begin{pmatrix} 2 & -4 \\ -1 & 2 \end{pmatrix}.

  • a) Compute ABAB and BABA.
  • b) Explain the result AB=0AB = 0 with the column reading of the product, and say what it tells you about the columns of BB.
  • c) Without multiplying any 2×22 \times 2 matrices, show that (BA)2=0(BA)^2 = 0. Then check it by computing.
  • d) Find ALL 2×22 \times 2 matrices XX such that AX=0AX = 0.
  • e) Compute (A+B)(A−B)(A + B)(A - B) and A2−B2A^2 - B^2. Show that their difference is BA−ABBA - AB, and state when the identity (A+B)(A−B)=A2−B2(A + B)(A - B) = A^2 - B^2 holds for matrices.
Show the solution

Answers

  • a) AB=(0000)AB = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} and BA=(−6−1236)BA = \begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}
  • b) each column of BB solves Ax=0Ax = 0: both are multiples of (2,−1)T(2, -1)^T
  • c) (BA)2=B(AB)A=B 0 A=0(BA)^2 = B(AB)A = B\,0\,A = 0
  • d) X=(2s2t−s−t)X = \begin{pmatrix} 2s & 2t \\ -s & -t \end{pmatrix}, ss and tt any real numbers
  • e) (A+B)(A−B)=(−9141718)(A+B)(A-B) = \begin{pmatrix} -9 & 14 \\ 17 & 18 \end{pmatrix}, A2−B2=(−3261412)A^2 - B^2 = \begin{pmatrix} -3 & 26 \\ 14 & 12 \end{pmatrix}; the identity holds exactly when AB=BAAB = BA

a) Row 1 of AA, (1,2)(1, 2), against the columns (2,−1)(2, -1) and (−4,2)(-4, 2) of BB gives 2−2=02 - 2 = 0 and −4+4=0-4 + 4 = 0; row 2, (2,4)(2, 4), gives 4−4=04 - 4 = 0 and −8+8=0-8 + 8 = 0. So AB=0AB = 0. In the other order, row 1 of BB, (2,−4)(2, -4), against the columns (1,2)(1, 2) and (2,4)(2, 4) of AA gives 2−8=−62 - 8 = -6 and 4−16=−124 - 16 = -12; row 2, (−1,2)(-1, 2), gives −1+4=3-1 + 4 = 3 and −2+8=6-2 + 8 = 6. So BA=(−6−1236)BA = \begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}, which is not zero. Neither factor is zero, and the two orders do not even agree on whether the product is zero. Any argument that starts with 'since AB=0AB = 0, also BA=0BA = 0' is already lost.

b) Column jj of ABAB is AA times column jj of BB. Both columns of ABAB are zero, so both columns of BB are solutions of the homogeneous system Ax=0Ax = 0. That system is the single equation x1+2x2=0x_1 + 2x_2 = 0, since the second row of AA is twice the first, and its solutions are the multiples of (2,−1)T(2, -1)^T. Indeed column 1 of BB is (2,−1)T(2, -1)^T and column 2 is (−4,2)T=−2(2,−1)T(-4, 2)^T = -2(2, -1)^T. The product vanishes because BB was built entirely out of directions that AA kills. Nothing of the kind holds for BABA: its columns are BB times the columns of AA, and (1,2)T(1, 2)^T is not killed by BB.

c) By associativity, (BA)2=(BA)(BA)=B(AB)A=B⋅0⋅A=0(BA)^2 = (BA)(BA) = B(AB)A = B \cdot 0 \cdot A = 0. The brackets move, the factors do not: the four letters stay in the order B,A,B,AB, A, B, A, and the pair ABAB that sits in the middle is zero. Check: (BA)2=(−6−1236)(−6−1236)(BA)^2 = \begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}\begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}, whose (1,1)(1,1) entry is 36−36=036 - 36 = 0, (1,2)(1,2) entry 72−72=072 - 72 = 0, (2,1)(2,1) entry −18+18=0-18 + 18 = 0 and (2,2)(2,2) entry −36+36=0-36 + 36 = 0. So BABA is a non-zero matrix whose square is zero, a nilpotent matrix, obtained without a single guess.

d) By b), AX=0AX = 0 says exactly that each column of XX solves x1+2x2=0x_1 + 2x_2 = 0, so each column is a multiple of (2,−1)T(2, -1)^T, with its own multiple. The answer is X=(2s2t−s−t)X = \begin{pmatrix} 2s & 2t \\ -s & -t \end{pmatrix} for all real ss, tt: a two-parameter family, and BB is the member s=1s = 1, t=−2t = -2. The trap is to give one example and stop, or to force both columns to be the same multiple. The question says ALL, and the column reading turns a matrix equation into two independent vector equations.

e) A+B=(3−216)A + B = \begin{pmatrix} 3 & -2 \\ 1 & 6 \end{pmatrix} and A−B=(−1632)A - B = \begin{pmatrix} -1 & 6 \\ 3 & 2 \end{pmatrix}, so (A+B)(A−B)=(−9141718)(A + B)(A - B) = \begin{pmatrix} -9 & 14 \\ 17 & 18 \end{pmatrix}. Also A2=(5101020)A^2 = \begin{pmatrix} 5 & 10 \\ 10 & 20 \end{pmatrix} and B2=(8−16−48)B^2 = \begin{pmatrix} 8 & -16 \\ -4 & 8 \end{pmatrix}, so A2−B2=(−3261412)A^2 - B^2 = \begin{pmatrix} -3 & 26 \\ 14 & 12 \end{pmatrix}. Expanding while keeping every factor in its place, (A+B)(A−B)=A2−AB+BA−B2(A + B)(A - B) = A^2 - AB + BA - B^2, so the difference with A2−B2A^2 - B^2 is BA−ABBA - AB. Here AB=0AB = 0, so the difference should be BA=(−6−1236)BA = \begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}, and indeed (−9141718)−(−3261412)=(−6−1236)\begin{pmatrix} -9 & 14 \\ 17 & 18 \end{pmatrix} - \begin{pmatrix} -3 & 26 \\ 14 & 12 \end{pmatrix} = \begin{pmatrix} -6 & -12 \\ 3 & 6 \end{pmatrix}. The difference of squares survives for matrices exactly when AB=BAAB = BA, never by default.

Exercise 4: Transpose: the reversal rule, and the symmetric and skew-symmetric parts

The transpose ATA^T turns rows into columns: (AT)ij=aji(A^T)_{ij} = a_{ji}. For a square matrix it is a reflection across the main diagonal, which the figure shows on M=(14−3025713)M = \begin{pmatrix} 1 & 4 & -3 \\ 0 & 2 & 5 \\ 7 & 1 & 3 \end{pmatrix}: the diagonal stays put and each coloured pair of entries swaps places.

A square matrix is symmetric when AT=AA^T = A and skew-symmetric when AT=−AA^T = -A. In parts a) to c), A=(1−20312)A = \begin{pmatrix} 1 & -2 & 0 \\ 3 & 1 & 2 \end{pmatrix} and B=(21−1)B = \begin{pmatrix} 2 \\ 1 \\ -1 \end{pmatrix}.

14-3025713the main diagonal is the mirrorthe transpose swapseach coloured pairM
  • a) Compute (AB)T(AB)^T and BTATB^T A^T. Then give the sizes of ATA^T and BTB^T and explain why ATBTA^T B^T cannot be the transpose of ABAB here.
  • b) Prove that (AB)T=BTAT(AB)^T = B^T A^T for any AA of size m×nm \times n and BB of size n×pn \times p, by comparing the (i,j)(i,j) entries of both sides.
  • c) Show that AATAA^T and ATAA^T A are symmetric for every matrix AA, give their sizes for the AA above, and compute AATAA^T.
  • d) Write MM as S+KS + K with SS symmetric and KK skew-symmetric.
  • e) Prove that the diagonal entries of a skew-symmetric matrix are all zero, and that the decomposition of d) is the only one possible.
Show the solution

Answers

  • a) (AB)T=BTAT=(0    5)(AB)^T = B^T A^T = (0 \;\; 5); ATBTA^T B^T would be (3×2)(1×3)(3 \times 2)(1 \times 3), which does not exist
  • b) ((AB)T)ij=(AB)ji=∑kajkbki=∑k(BT)ik(AT)kj=(BTAT)ij((AB)^T)_{ij} = (AB)_{ji} = \sum_k a_{jk} b_{ki} = \sum_k (B^T)_{ik} (A^T)_{kj} = (B^T A^T)_{ij}
  • c) (AAT)T=AAT(AA^T)^T = AA^T, (ATA)T=ATA(A^TA)^T = A^TA; sizes 2×22 \times 2 and 3×33 \times 3; AAT=(51114)AA^T = \begin{pmatrix} 5 & 1 \\ 1 & 14 \end{pmatrix}
  • d) S=(122223233)S = \begin{pmatrix} 1 & 2 & 2 \\ 2 & 2 & 3 \\ 2 & 3 & 3 \end{pmatrix}, K=(02−5−2025−20)K = \begin{pmatrix} 0 & 2 & -5 \\ -2 & 0 & 2 \\ 5 & -2 & 0 \end{pmatrix}
  • e) kii=−kiik_{ii} = -k_{ii} forces kii=0k_{ii} = 0; SS and KK are forced to be 12(M+MT)\frac{1}{2}(M + M^T) and 12(M−MT)\frac{1}{2}(M - M^T)

a) ABAB is (2×3)(3×1)=2×1(2 \times 3)(3 \times 1) = 2 \times 1: row 1 of AA gives 2−2+0=02 - 2 + 0 = 0 and row 2 gives 6+1−2=56 + 1 - 2 = 5, so AB=(0,5)TAB = (0, 5)^T and (AB)T=(0    5)(AB)^T = (0 \;\; 5), a 1×21 \times 2 row. On the other side BT=(2    1    −1)B^T = (2 \;\; 1 \;\; -1) is 1×31 \times 3 and ATA^T is 3×23 \times 2, so BTATB^T A^T is 1×21 \times 2: against the columns of ATA^T, which are the rows of AA, it gives 2−2+0=02 - 2 + 0 = 0 and 6+1−2=56 + 1 - 2 = 5. The two agree. Now try the order a student writes by reflex: ATBTA^T B^T is (3×2)(1×3)(3 \times 2)(1 \times 3), inner 2≠12 \neq 1, so it does not exist at all. The size test settles the question before any entry is computed, and it is the fastest way to remember that the transpose REVERSES the order.

b) Take 1≤i≤p1 \le i \le p and 1≤j≤m1 \le j \le m. On the left, ((AB)T)ij=(AB)ji=∑k=1najkbki((AB)^T)_{ij} = (AB)_{ji} = \sum_{k=1}^{n} a_{jk} b_{ki}. On the right, (BTAT)ij=∑k=1n(BT)ik(AT)kj=∑k=1nbkiajk(B^T A^T)_{ij} = \sum_{k=1}^{n} (B^T)_{ik} (A^T)_{kj} = \sum_{k=1}^{n} b_{ki} a_{jk}. Each term is a product of two NUMBERS, bkiajk=ajkbkib_{ki} a_{jk} = a_{jk} b_{ki}, so the two sums are equal term by term. Note where commutativity was used: between numbers, inside one term, never between the matrices. That is exactly why the matrices come out in the reverse order. A proof on one 2×22 \times 2 example proves nothing; the marker wants the general (i,j)(i,j) entry.

c) By the rule of b) and (AT)T=A(A^T)^T = A: (AAT)T=(AT)TAT=AAT(AA^T)^T = (A^T)^T A^T = AA^T, and (ATA)T=AT(AT)T=ATA(A^T A)^T = A^T (A^T)^T = A^T A. Both are symmetric, for every AA, square or not. For our 2×32 \times 3 matrix AA, AATAA^T is 2×22 \times 2 and ATAA^T A is 3×33 \times 3. Entry (i,j)(i,j) of AATAA^T is row ii of AA against row jj of AA: 1+4+0=51 + 4 + 0 = 5, 3−2+0=13 - 2 + 0 = 1, and 9+1+4=149 + 1 + 4 = 14, so AAT=(51114)AA^T = \begin{pmatrix} 5 & 1 \\ 1 & 14 \end{pmatrix}. The two off-diagonal entries come out equal, which is the built-in check: an AATAA^T that is not symmetric contains an arithmetic error, found before the marker finds it.

d) Put S=12(M+MT)S = \frac{1}{2}(M + M^T) and K=12(M−MT)K = \frac{1}{2}(M - M^T). Reading MTM^T off the figure, each coloured pair swapped: MT=(107421−353)M^T = \begin{pmatrix} 1 & 0 & 7 \\ 4 & 2 & 1 \\ -3 & 5 & 3 \end{pmatrix}. Then M+MT=(244446466)M + M^T = \begin{pmatrix} 2 & 4 & 4 \\ 4 & 4 & 6 \\ 4 & 6 & 6 \end{pmatrix} and M−MT=(04−10−40410−40)M - M^T = \begin{pmatrix} 0 & 4 & -10 \\ -4 & 0 & 4 \\ 10 & -4 & 0 \end{pmatrix}, which halve to S=(122223233)S = \begin{pmatrix} 1 & 2 & 2 \\ 2 & 2 & 3 \\ 2 & 3 & 3 \end{pmatrix} and K=(02−5−2025−20)K = \begin{pmatrix} 0 & 2 & -5 \\ -2 & 0 & 2 \\ 5 & -2 & 0 \end{pmatrix}. Checks in five seconds: SS is symmetric, KK has a zero diagonal and opposite mirror pairs, and S+KS + K gives back MM, for instance 2+2=42 + 2 = 4 and 2−2=02 - 2 = 0 in the first coloured pair. SS averages each pair, KK takes half their difference.

e) If KT=−KK^T = -K, the diagonal entries satisfy kii=(KT)ii=−kiik_{ii} = (K^T)_{ii} = -k_{ii}, so 2kii=02k_{ii} = 0 and kii=0k_{ii} = 0: the diagonal is the mirror, and a number equal to its own opposite is zero. Uniqueness: suppose M=S+KM = S + K with SS symmetric and KK skew-symmetric. Transposing, MT=ST+KT=S−KM^T = S^T + K^T = S - K. Adding and subtracting the two equations gives M+MT=2SM + M^T = 2S and M−MT=2KM - M^T = 2K, so SS and KK have no choice: they are the matrices of d). The proof does not guess a formula, it DERIVES it from the two conditions, which is what makes it a proof of uniqueness rather than a verification of one example.

Exercise 5: Powers of a matrix: nilpotent, idempotent, and the pattern behind the n-th power

For a square matrix, A2=AAA^2 = AA, A3=AAAA^3 = AAA, and so on; associativity makes the bracketing irrelevant, and A0=IA^0 = I. Powers of a matrix are NOT the powers of its entries, and the whole exercise is about spotting a structure that makes AnA^n computable without nn multiplications.

Let N=(021003000)N = \begin{pmatrix} 0 & 2 & 1 \\ 0 & 0 & 3 \\ 0 & 0 & 0 \end{pmatrix}, P=(2−21−1)P = \begin{pmatrix} 2 & -2 \\ 1 & -1 \end{pmatrix}, A=(2302)A = \begin{pmatrix} 2 & 3 \\ 0 & 2 \end{pmatrix} and E=(0100)E = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}.

  • a) Compute N2N^2 and N3N^3. What is NkN^k for every k≥3k \ge 3?
  • b) Compute P2P^2 and deduce P50P^{50}. Show that (I−P)2=I−P(I - P)^2 = I - P and that P(I−P)=0P(I - P) = 0.
  • c) Compute A2A^2 and A3A^3, conjecture a formula for AnA^n, and prove it by induction on nn.
  • d) Write A=2I+3EA = 2I + 3E. Explain why the binomial expansion of (2I+3E)n(2I + 3E)^n is legitimate here, and use it to recover the formula of c) in one line.
  • e) Give DnD^n for D=(2000−10003)D = \begin{pmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 3 \end{pmatrix}. Then compare P2P^2 with the matrix obtained by squaring each entry of PP, and conclude.
Show the solution

Answers

  • a) N2=(006000000)N^2 = \begin{pmatrix} 0 & 0 & 6 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}, N3=0N^3 = 0, so Nk=0N^k = 0 for all k≥3k \ge 3
  • b) P2=PP^2 = P, hence P50=PP^{50} = P; (I−P)2=I−P(I - P)^2 = I - P and P(I−P)=0P(I - P) = 0
  • c) A2=(41204)A^2 = \begin{pmatrix} 4 & 12 \\ 0 & 4 \end{pmatrix}, A3=(83608)A^3 = \begin{pmatrix} 8 & 36 \\ 0 & 8 \end{pmatrix}, An=(2n3n 2n−102n)A^n = \begin{pmatrix} 2^{n} & 3n\,2^{n-1} \\ 0 & 2^{n} \end{pmatrix}
  • d) 2I2I and 3E3E commute and E2=0E^2 = 0, so (2I+3E)n=2nI+n 2n−1 3E(2I + 3E)^n = 2^n I + n\,2^{n-1}\,3E
  • e) Dn=(2n000(−1)n0003n)D^n = \begin{pmatrix} 2^{n} & 0 & 0 \\ 0 & (-1)^{n} & 0 \\ 0 & 0 & 3^{n} \end{pmatrix}; squaring the entries of PP gives (4411)≠P2\begin{pmatrix} 4 & 4 \\ 1 & 1 \end{pmatrix} \neq P^2

a) Row 1 of NN, (0,2,1)(0, 2, 1), against the columns of NN gives 00, 00 and 0+6+0=60 + 6 + 0 = 6; row 2, (0,0,3)(0, 0, 3), meets columns whose third entry is always 00, so it gives zeros; row 3 is zero. So N2=(006000000)N^2 = \begin{pmatrix} 0 & 0 & 6 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}. Then N3=N2NN^3 = N^2 N: the only non-zero row of N2N^2 is (0,0,6)(0, 0, 6), and the third row of NN is zero, so N3=0N^3 = 0 and every higher power is N3Nk−3=0N^3 N^{k-3} = 0. The figure of the correction shows the mechanism: the non-zero entries sit above the diagonal, and each multiplication pushes them one diagonal further up until they fall off the corner. A strictly upper triangular n×nn \times n matrix always dies by the power nn. So N3=0N^3 = 0 although N≠0N \neq 0 and N2≠0N^2 \neq 0: writing 'N3=0N^3 = 0, so N=0N = 0' copies a rule of real numbers that matrices do not obey.

b) P2P^2: row 1, (2,−2)(2, -2), against the columns (2,1)(2, 1) and (−2,−1)(-2, -1) gives 4−2=24 - 2 = 2 and −4+2=−2-4 + 2 = -2; row 2, (1,−1)(1, -1), gives 2−1=12 - 1 = 1 and −2+1=−1-2 + 1 = -1. So P2=PP^2 = P: PP is idempotent. Then P3=P2P=PP=PP^3 = P^2 P = PP = P, and by the same step P50=PP^{50} = P, with no further multiplication. Next, (I−P)2=I−IP−PI+P2=I−2P+P=I−P(I - P)^2 = I - IP - PI + P^2 = I - 2P + P = I - P: the expansion is legal because II commutes with everything, so the two middle terms really do combine. Directly, I−P=(−12−12)I - P = \begin{pmatrix} -1 & 2 \\ -1 & 2 \end{pmatrix} and its square has entries 1−2=−11 - 2 = -1, −2+4=2-2 + 4 = 2, 1−2=−11 - 2 = -1, −2+4=2-2 + 4 = 2. Finally P(I−P)=P−P2=0P(I - P) = P - P^2 = 0: two non-zero matrices with product zero once again, and this time they commute.

c) A2=(2302)(2302)=(41204)A^2 = \begin{pmatrix} 2 & 3 \\ 0 & 2 \end{pmatrix}\begin{pmatrix} 2 & 3 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 4 & 12 \\ 0 & 4 \end{pmatrix} and A3=A2A=(83608)A^3 = A^2 A = \begin{pmatrix} 8 & 36 \\ 0 & 8 \end{pmatrix}, since 4⋅3+12⋅2=364 \cdot 3 + 12 \cdot 2 = 36. The diagonal is 2n2^n, and the corner reads 3=3⋅1⋅203 = 3 \cdot 1 \cdot 2^0, 12=3⋅2⋅2112 = 3 \cdot 2 \cdot 2^1, 36=3⋅3⋅2236 = 3 \cdot 3 \cdot 2^2, which suggests An=(2n3n 2n−102n)A^n = \begin{pmatrix} 2^{n} & 3n\,2^{n-1} \\ 0 & 2^{n} \end{pmatrix}. Proof by induction. For n=1n = 1 the formula gives AA. If it holds for nn, then An+1=AnAA^{n+1} = A^n A has corner entry 2n⋅3+3n 2n−1⋅2=3⋅2n+3n 2n=3(n+1) 2n2^n \cdot 3 + 3n\,2^{n-1} \cdot 2 = 3 \cdot 2^n + 3n\,2^n = 3(n+1)\,2^{n}, which is the formula at n+1n + 1, and diagonal entries 2n⋅2=2n+12^n \cdot 2 = 2^{n+1}. A pattern read off three powers is a conjecture; the marks are in the induction step.

d) E2=0E^2 = 0, and 2I2I commutes with 3E3E because a multiple of II commutes with every matrix. For two COMMUTING matrices the binomial theorem holds exactly as for numbers, since every product of factors can be reordered. So (2I+3E)n=(2I)n+n(2I)n−1(3E)+(terms with E2=0)=2nI+3n 2n−1E(2I + 3E)^n = (2I)^n + n(2I)^{n-1}(3E) + (\text{terms with } E^2 = 0) = 2^n I + 3n\,2^{n-1} E, which is the formula of c). For a general sum X+YX + Y the binomial theorem is false, because (X+Y)2(X + Y)^2 already contains XY+YXXY + YX and not 2XY2XY. The expansion is not a formula about sums, it is a formula about sums of commuting matrices.

e) A diagonal matrix multiplies each coordinate separately, so Dn=(2n000(−1)n0003n)D^n = \begin{pmatrix} 2^{n} & 0 & 0 \\ 0 & (-1)^{n} & 0 \\ 0 & 0 & 3^{n} \end{pmatrix}: for diagonal matrices, and only for them, powers are taken entry by entry. Try it on PP: squaring each entry gives (4411)\begin{pmatrix} 4 & 4 \\ 1 & 1 \end{pmatrix}, while P2=P=(2−21−1)P^2 = P = \begin{pmatrix} 2 & -2 \\ 1 & -1 \end{pmatrix}. The entries of AnA^n mix all the entries of AA through sums of products; the diagonal case is the one case where no mixing happens because every off-diagonal term is zero. Before raising a matrix to a power, look for one of the four structures of this exercise: diagonal, nilpotent, idempotent, or scalar plus nilpotent. If none is there, compute A2A^2 and A3A^3 and look for a pattern to prove.

021003000N006000000N²000000000N³the non-zero entries climb one diagonal per power, then fall off the corner

Part B: problems and reasoning (/50)

Exercise 6: Every matrix that commutes with a given one

Two square matrices commute when AX=XAAX = XA. Since that is rare, a classic midterm question asks for ALL the matrices that commute with a given one. The method is always the same: write an unknown X=(abcd)X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, compute BOTH products, AXAX and XAXA, as two separate computations, and equate them entry by entry. The result is a homogeneous linear system in aa, bb, cc, dd.

Throughout, A=(1203)A = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix}.

  • a) Find all 2×22 \times 2 matrices XX such that AX=XAAX = XA.
  • b) Show that every matrix found in a) can be written αI+βA\alpha I + \beta A for some real α\alpha, β\beta.
  • c) Find all XX that commute with D=(2005)D = \begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix}. Use the answer to show that diagonal matrices do not commute with everything.
  • d) Prove that if XX commutes with a square matrix AA, then XX commutes with A2A^2 and with A+3IA + 3I.
  • e) Find all 2×22 \times 2 matrices XX that commute with EVERY 2×22 \times 2 matrix.
Show the solution

Answers

  • a) X=(ab0a+b)X = \begin{pmatrix} a & b \\ 0 & a+b \end{pmatrix}, aa and bb any real numbers
  • b) X=(a−b2) I+b2 AX = (a - \frac{b}{2})\,I + \frac{b}{2}\,A
  • c) exactly the diagonal matrices; E=(0100)E = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} gives DE≠EDDE \neq ED
  • d) XA2=(XA)A=(AX)A=A(XA)=A(AX)=A2XXA^2 = (XA)A = (AX)A = A(XA) = A(AX) = A^2X, and X(A+3I)=XA+3X=AX+3X=(A+3I)XX(A + 3I) = XA + 3X = AX + 3X = (A + 3I)X
  • e) only the scalar matrices X=cIX = cI

a) AX=(1203)(abcd)=(a+2cb+2d3c3d)AX = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} a & b \\ c & d \end{pmatrix} = \begin{pmatrix} a + 2c & b + 2d \\ 3c & 3d \end{pmatrix} and, as a SEPARATE computation, XA=(abcd)(1203)=(a2a+3bc2c+3d)XA = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} a & 2a + 3b \\ c & 2c + 3d \end{pmatrix}. Equating entry by entry: (1,1)(1,1) gives a+2c=aa + 2c = a, so c=0c = 0; (2,1)(2,1) gives 3c=c3c = c, so c=0c = 0 again; (2,2)(2,2) gives 3d=2c+3d3d = 2c + 3d, so c=0c = 0 a third time; (1,2)(1,2) gives b+2d=2a+3bb + 2d = 2a + 3b, that is d=a+bd = a + b. Two free parameters remain, aa and bb, and X=(ab0a+b)X = \begin{pmatrix} a & b \\ 0 & a+b \end{pmatrix}. The standard loss of marks is to compute AXAX once and then write XAXA as 'the same thing': the whole question is that it is not.

b) Try αI+βA=(α+β2β0α+3β)\alpha I + \beta A = \begin{pmatrix} \alpha + \beta & 2\beta \\ 0 & \alpha + 3\beta \end{pmatrix}. Matching the (1,2)(1,2) entry gives 2β=b2\beta = b, so β=b2\beta = \frac{b}{2}; matching the (1,1)(1,1) entry gives α=a−b2\alpha = a - \frac{b}{2}; the (2,2)(2,2) entry is then a−b2+3b2=a+ba - \frac{b}{2} + \frac{3b}{2} = a + b, as required. So X=(a−b2)I+b2AX = (a - \frac{b}{2})I + \frac{b}{2}A. Check on a=1a = 1, b=2b = 2: X=(1203)X = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix}, which is AA itself, and AA certainly commutes with AA. The commuting matrices are exactly the combinations of II and AA here, which is why the answer to a) had two parameters and not four.

c) DX=(2a2b5c5d)DX = \begin{pmatrix} 2a & 2b \\ 5c & 5d \end{pmatrix}, because multiplying by a diagonal matrix on the LEFT scales the ROWS, and XD=(2a5b2c5d)XD = \begin{pmatrix} 2a & 5b \\ 2c & 5d \end{pmatrix}, because on the RIGHT it scales the COLUMNS. Equality forces 2b=5b2b = 5b and 5c=2c5c = 2c, so b=c=0b = c = 0: the matrices commuting with DD are exactly the diagonal ones. In particular E=(0100)E = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} does not commute with DD: DE=(0200)DE = \begin{pmatrix} 0 & 2 \\ 0 & 0 \end{pmatrix} while ED=(0500)ED = \begin{pmatrix} 0 & 5 \\ 0 & 0 \end{pmatrix}. Diagonal matrices commute with EACH OTHER, not with everything; the distinct diagonal entries 2≠52 \neq 5 are what break it.

d) Only associativity and the hypothesis are allowed, one swap at a time: XA2=(XA)A=(AX)A=A(XA)=A(AX)=A2XXA^2 = (XA)A = (AX)A = A(XA) = A(AX) = A^2X. Each equality either moves a bracket or uses XA=AXXA = AX once. For the second, distributivity and the fact that II commutes with XX: X(A+3I)=XA+3XI=AX+3IX=(A+3I)XX(A + 3I) = XA + 3XI = AX + 3IX = (A + 3I)X. By the same steps XX commutes with every polynomial in AA, which explains b) from the other side: II and AA are the simplest such polynomials.

e) If X=(abcd)X = \begin{pmatrix} a & b \\ c & d \end{pmatrix} commutes with every matrix, it commutes in particular with F=(1000)F = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} and with E=(0100)E = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}. XF=(a0c0)XF = \begin{pmatrix} a & 0 \\ c & 0 \end{pmatrix} and FX=(ab00)FX = \begin{pmatrix} a & b \\ 0 & 0 \end{pmatrix}, so b=c=0b = c = 0. Then XE=(0a00)XE = \begin{pmatrix} 0 & a \\ 0 & 0 \end{pmatrix} and EX=(0d00)EX = \begin{pmatrix} 0 & d \\ 0 & 0 \end{pmatrix} with b=c=0b = c = 0, so a=da = d. Hence X=aIX = aI. Conversely every cIcI commutes with everything, so the answer is exactly the scalar matrices. Testing two well-chosen matrices is enough to find the candidates; the converse sentence is what makes the answer complete.

Exercise 7: The trace, and why AB minus BA can never be the identity

The trace of a square matrix is the sum of its diagonal entries, tr⁡A=a11+a22+⋯+ann\operatorname{tr} A = a_{11} + a_{22} + \cdots + a_{nn}. It is additive, tr⁡(A+B)=tr⁡A+tr⁡B\operatorname{tr}(A + B) = \operatorname{tr} A + \operatorname{tr} B, but NOT multiplicative. Its one deep property is that it forgets the order of a product of two factors: tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA) whenever both products exist, even when they are not the same size.

Let A=(12−1013)A = \begin{pmatrix} 1 & 2 & -1 \\ 0 & 1 & 3 \end{pmatrix} and B=(102−111)B = \begin{pmatrix} 1 & 0 \\ 2 & -1 \\ 1 & 1 \end{pmatrix}.

  • a) Compute tr⁡(AB)\operatorname{tr}(AB) and tr⁡(BA)\operatorname{tr}(BA), computing only the entries you actually need.
  • b) Prove that tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA) for any m×nm \times n matrix AA and n×mn \times m matrix BB.
  • c) Prove that there are no n×nn \times n matrices XX, YY with XY−YX=IXY - YX = I.
  • d) With F=(1000)F = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, G=(0100)G = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} and H=(0010)H = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}, compute tr⁡(FGH)\operatorname{tr}(FGH), tr⁡(HFG)\operatorname{tr}(HFG) and tr⁡(FHG)\operatorname{tr}(FHG). Which reorderings does the trace forgive?
  • e) Show that tr⁡(ATA)\operatorname{tr}(A^T A) is the sum of the squares of all the entries of AA, check it on the AA above, and deduce that ATA=0A^T A = 0 forces A=0A = 0.
Show the solution

Answers

  • a) tr⁡(AB)=4+2=6\operatorname{tr}(AB) = 4 + 2 = 6 and tr⁡(BA)=1+3+2=6\operatorname{tr}(BA) = 1 + 3 + 2 = 6
  • b) both equal ∑i=1m∑k=1naikbki\sum_{i=1}^{m} \sum_{k=1}^{n} a_{ik} b_{ki}
  • c) tr⁡(XY−YX)=0\operatorname{tr}(XY - YX) = 0 while tr⁡I=n≠0\operatorname{tr} I = n \neq 0
  • d) tr⁡(FGH)=tr⁡(HFG)=1\operatorname{tr}(FGH) = \operatorname{tr}(HFG) = 1 but tr⁡(FHG)=0\operatorname{tr}(FHG) = 0: only cyclic reorderings
  • e) tr⁡(ATA)=∑i,jaij2=16\operatorname{tr}(A^TA) = \sum_{i,j} a_{ij}^2 = 16; a sum of squares is zero only if every entry is zero

a) The trace only reads the diagonal, so only the diagonal entries of each product are needed. (AB)11(AB)_{11} is row 1 of AA against column 1 of BB: 1+4−1=41 + 4 - 1 = 4; (AB)22(AB)_{22} is row 2 against column 2: 0−1+3=20 - 1 + 3 = 2. So tr⁡(AB)=6\operatorname{tr}(AB) = 6, from two entries out of four. BABA is 3×33 \times 3 and we need three of its nine entries: (BA)11=(1,0)⋅(1,0)=1(BA)_{11} = (1, 0) \cdot (1, 0) = 1, (BA)22=(2,−1)⋅(2,1)=4−1=3(BA)_{22} = (2, -1) \cdot (2, 1) = 4 - 1 = 3, (BA)33=(1,1)⋅(−1,3)=2(BA)_{33} = (1, 1) \cdot (-1, 3) = 2. So tr⁡(BA)=6\operatorname{tr}(BA) = 6. Same trace, although ABAB is 2×22 \times 2 and BABA is 3×33 \times 3. Computing the whole of BABA to read its diagonal is the time loss the question is designed to catch.

b) tr⁡(AB)=∑i=1m(AB)ii=∑i=1m∑k=1naikbki\operatorname{tr}(AB) = \sum_{i=1}^{m} (AB)_{ii} = \sum_{i=1}^{m} \sum_{k=1}^{n} a_{ik} b_{ki}. Likewise tr⁡(BA)=∑k=1n(BA)kk=∑k=1n∑i=1mbkiaik\operatorname{tr}(BA) = \sum_{k=1}^{n} (BA)_{kk} = \sum_{k=1}^{n} \sum_{i=1}^{m} b_{ki} a_{ik}. The two double sums run over the same mnmn pairs (i,k)(i, k), and each term is a product of two numbers, bkiaik=aikbkib_{ki} a_{ik} = a_{ik} b_{ki}. A finite double sum can be summed in either order, so the two traces are equal. Note that the proof never claims AB=BAAB = BA: the matrices differ, and only the sum of their diagonals coincides.

c) Suppose XY−YX=IXY - YX = I. Take the trace of both sides. The trace is additive, so the left side gives tr⁡(XY)−tr⁡(YX)=0\operatorname{tr}(XY) - \operatorname{tr}(YX) = 0 by b), while the right side gives tr⁡I=n\operatorname{tr} I = n. Since n≥1n \ge 1, 0=n0 = n is impossible, so no such XX, YY exist. This is the model of a trace argument: an equation between matrices implies an equation between their traces, and a contradiction in the NUMBERS kills the matrix equation without solving anything. The same argument shows XY−YXXY - YX can never equal cIcI with c≠0c \neq 0.

d) FG=GFG = G and GH=FGH = F, so FGH=(FG)H=GH=FFGH = (FG)H = GH = F, and tr⁡(FGH)=1\operatorname{tr}(FGH) = 1. HF=HHF = H, so HFG=HGHFG = HG, which has a single 11 in position (2,2)(2,2): tr⁡(HFG)=1\operatorname{tr}(HFG) = 1. But FH=0FH = 0, because the first row of HH is zero, so FHG=0FHG = 0 and tr⁡(FHG)=0\operatorname{tr}(FHG) = 0. Moving the LAST factor to the FRONT, FGH→HFGFGH \to HFG, is a cyclic shift, and it is tr⁡(XY)=tr⁡(YX)\operatorname{tr}(XY) = \operatorname{tr}(YX) applied with X=FGX = FG, Y=HY = H. Swapping two factors in the middle is not a cyclic shift, and here it changes the trace from 11 to 00. The trace forgives rotations of the word, never arbitrary shuffles.

e) (ATA)jj(A^T A)_{jj} is column jj of AA against itself, ∑iaij2\sum_i a_{ij}^2, so tr⁡(ATA)=∑j∑iaij2\operatorname{tr}(A^T A) = \sum_j \sum_i a_{ij}^2, the sum of the squares of all the entries. Here the columns of AA are (1,0)(1, 0), (2,1)(2, 1) and (−1,3)(-1, 3), giving 1+5+10=161 + 5 + 10 = 16, and directly 1+4+1+0+1+9=161 + 4 + 1 + 0 + 1 + 9 = 16. If ATA=0A^T A = 0, its trace is 00, so a sum of squares of real numbers is 00, which forces every aij=0a_{ij} = 0. Compare with exercise 3: AB=0AB = 0 is possible with A≠0A \neq 0, but ATA=0A^T A = 0 is not. The difference is that ATAA^T A pairs each column with ITSELF, and squares cannot cancel.

Exercise 8: Five statements to correct

Each statement below was written by a student revising for a MATH 133 midterm, and each is false as stated. Say what is wrong, give the smallest counterexample that settles it, and write the correct statement. Every counterexample here is a 2×22 \times 2 matrix with small integer entries: a counterexample you can check in your head is worth more than a general discussion.

  • a) "The transpose of a product is the product of the transposes: (AB)T=ATBT(AB)^T = A^T B^T."
  • b) "If A2=0A^2 = 0, then A=0A = 0."
  • c) "To multiply two matrices of the same size, multiply the entries in the same position."
  • d) "If AA and BB are symmetric, then ABAB is symmetric."
  • e) "If A2=IA^2 = I, then A=IA = I or A=−IA = -I."
Show the solution

Answers

  • a) false: A=(1100)A = \begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}, B=(1010)B = \begin{pmatrix} 1 & 0 \\ 1 & 0 \end{pmatrix} give (AB)T=(2000)≠ATBT=(1111)(AB)^T = \begin{pmatrix} 2 & 0 \\ 0 & 0 \end{pmatrix} \neq A^TB^T = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}; correct: (AB)T=BTAT(AB)^T = B^TA^T
  • b) false: (2−41−2)2=0\begin{pmatrix} 2 & -4 \\ 1 & -2 \end{pmatrix}^2 = 0; correct: A2=0A^2 = 0 is possible with A≠0A \neq 0
  • c) false: (1111)2=(2222)\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}^2 = \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix}; correct: entry (i,j)(i,j) is row ii times column jj
  • d) false: (1002)(0110)=(0120)\begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 2 & 0 \end{pmatrix}; correct: ABAB is symmetric exactly when AB=BAAB = BA
  • e) false: (120−1)2=I\begin{pmatrix} 1 & 2 \\ 0 & -1 \end{pmatrix}^2 = I; correct: (A−I)(A+I)=0(A - I)(A + I) = 0, which does not force either factor to be zero

a) FALSE, the order is backwards. With A=(1100)A = \begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix} and B=(1010)B = \begin{pmatrix} 1 & 0 \\ 1 & 0 \end{pmatrix}, AB=(2000)AB = \begin{pmatrix} 2 & 0 \\ 0 & 0 \end{pmatrix}, which is its own transpose, while ATBT=(1010)(1100)=(1111)A^T B^T = \begin{pmatrix} 1 & 0 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}. The correct order gives BTAT=(1100)(1010)=(2000)B^T A^T = \begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 0 \end{pmatrix}, as it should. Correct statement: (AB)T=BTAT(AB)^T = B^T A^T. For non-square factors the wrong version usually does not even exist, as exercise 4 showed; for square ones it exists and is simply wrong, which is the more dangerous case.

b) FALSE. N=(2−41−2)N = \begin{pmatrix} 2 & -4 \\ 1 & -2 \end{pmatrix} is not zero, and N2N^2 has entries 4−4=04 - 4 = 0, −8+8=0-8 + 8 = 0, 2−2=02 - 2 = 0 and −4+4=0-4 + 4 = 0. The rule 'a2=0⇒a=0a^2 = 0 \Rightarrow a = 0' is true for numbers because a product of two non-zero numbers is non-zero, and exercise 3 showed that this fails for matrices. Here the columns of NN are both multiples of (2,1)T(2, 1)^T, and N(2,1)T=(0,0)TN(2, 1)^T = (0, 0)^T: NN kills the very direction its columns point in. Correct statement: A2=0A^2 = 0 is possible with A≠0A \neq 0, and such a matrix is called nilpotent. What IS true, by exercise 7 e), is that a SYMMETRIC AA with A2=ATA=0A^2 = A^T A = 0 must be zero.

c) FALSE. The entry-by-entry product exists as an operation, but it is not the matrix product. With J=(1111)J = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}, the entrywise square is JJ itself, while the matrix product gives J2=(2222)J^2 = \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix}: every entry is a row against a column, 1⋅1+1⋅1=21 \cdot 1 + 1 \cdot 1 = 2. Correct statement: (AB)ij=∑kaikbkj(AB)_{ij} = \sum_k a_{ik} b_{kj}, row ii of AA against column jj of BB, and the sizes must satisfy the inner-size rule, not be equal. The entrywise rule only agrees with the product for diagonal matrices, which is why students who first met matrices through diagonal examples carry it for so long.

d) FALSE. A=(1002)A = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix} and B=(0110)B = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} are both symmetric, but AB=(0120)AB = \begin{pmatrix} 0 & 1 \\ 2 & 0 \end{pmatrix} is not. The reason is one line: (AB)T=BTAT=BA(AB)^T = B^T A^T = BA, so ABAB is symmetric if and only if AB=BAAB = BA. Here BA=(0210)≠ABBA = \begin{pmatrix} 0 & 2 \\ 1 & 0 \end{pmatrix} \neq AB. Correct statement: the product of two symmetric matrices is symmetric exactly when they commute. The sum of two symmetric matrices, by contrast, is always symmetric, and so is A2A^2 for symmetric AA, since AA commutes with itself.

e) FALSE. R=(120−1)R = \begin{pmatrix} 1 & 2 \\ 0 & -1 \end{pmatrix} has R2R^2 with entries 1+0=11 + 0 = 1, 2−2=02 - 2 = 0, 0+0=00 + 0 = 0 and 0+1=10 + 1 = 1, so R2=IR^2 = I, yet R≠±IR \neq \pm I. Simpler examples are (100−1)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} and (0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. The student's argument is the factorisation A2−I=(A−I)(A+I)=0A^2 - I = (A - I)(A + I) = 0, and the factorisation itself is valid, because AA commutes with II. The false step is the next one, concluding that one factor is zero: here R−I=(020−2)R - I = \begin{pmatrix} 0 & 2 \\ 0 & -2 \end{pmatrix} and R+I=(2200)R + I = \begin{pmatrix} 2 & 2 \\ 0 & 0 \end{pmatrix} are both non-zero with product zero. Correct statement: A2=IA^2 = I means (A−I)(A+I)=0(A - I)(A + I) = 0, and there are infinitely many such 2×22 \times 2 matrices besides ±I\pm I.

Exercise 9: Prices times quantities: a matrix product with units

A small company runs three campus kiosks, K1K_1, K2K_2 and K3K_3, selling coffee, muffins, sandwiches and juice. The table gives the units sold on one day; it is the 3×43 \times 4 matrix QQ, one row per kiosk and one column per product.

The 4×24 \times 2 matrix P=(31217442)P = \begin{pmatrix} 3 & 1 \\ 2 & 1 \\ 7 & 4 \\ 4 & 2 \end{pmatrix} gives, for each product in the same order, its selling price (column 1) and its cost to the company (column 2), in dollars per unit.

kioskcoffeemuffinsandwichjuice
K1K_1120804030
K2K_290605020
K3K_31501003040
  • a) Which of the products QPQP and PQPQ exists? Give its size, and say what its (i,j)(i,j) entry means, with its unit.
  • b) Compute QPQP.
  • c) Using one more matrix product each time, find the profit of each kiosk, then the total revenue and total cost of the company.
  • d) The company raises the price of coffee and of sandwiches by 11 dollar each, costs unchanged. Find the new revenue of each kiosk by computing only the CHANGE.
  • e) The accountant wants the same figures as in b) but with one COLUMN per kiosk. Which product of the given matrices, or of their transposes, produces it directly? Justify with the transpose rule.
Show the solution

Answers

  • a) only QPQP exists, 3×23 \times 2; entry (i,1)(i,1) is the revenue and (i,2)(i,2) the cost of kiosk ii, in dollars
  • b) QP=(9204208203901020450)QP = \begin{pmatrix} 920 & 420 \\ 820 & 390 \\ 1020 & 450 \end{pmatrix}
  • c) profits QP (1,−1)T=(500,430,570)TQP\,(1,-1)^T = (500, 430, 570)^T dollars; (1  1  1) QP=(2760    1260)(1\;1\;1)\,QP = (2760 \;\; 1260), total revenue 2760 and cost 1260 dollars
  • d) change Q (1,0,1,0)T=(160,140,180)TQ\,(1,0,1,0)^T = (160, 140, 180)^T; new revenues 1080, 960 and 1200 dollars
  • e) PTQT=(QP)TP^TQ^T = (QP)^T, a 2×32 \times 3 matrix

a) QQ is 3×43 \times 4 and PP is 4×24 \times 2. QPQP has inner sizes 44 and 44, so it exists and is 3×23 \times 2. PQPQ would be (4×2)(3×4)(4 \times 2)(3 \times 4), inner 2≠32 \neq 3: it does not exist. The sizes are not a formality here, they are the units speaking. Entry (i,1)(i,1) of QPQP is row ii of QQ against column 1 of PP: units of each product times dollars per unit of that product, summed over the four products, so it is the REVENUE of kiosk ii in dollars. Entry (i,2)(i,2) is, the same way, the COST of kiosk ii. The inner index is the product being summed over, and that is why the inner sizes must agree: both matrices must list the same four products in the same order.

b) Row 1: revenue 120(3)+80(2)+40(7)+30(4)=360+160+280+120=920120(3) + 80(2) + 40(7) + 30(4) = 360 + 160 + 280 + 120 = 920, cost 120+80+160+60=420120 + 80 + 160 + 60 = 420. Row 2: 270+120+350+80=820270 + 120 + 350 + 80 = 820 and 90+60+200+40=39090 + 60 + 200 + 40 = 390. Row 3: 450+200+210+160=1020450 + 200 + 210 + 160 = 1020 and 150+100+120+80=450150 + 100 + 120 + 80 = 450. So QP=(9204208203901020450)QP = \begin{pmatrix} 920 & 420 \\ 820 & 390 \\ 1020 & 450 \end{pmatrix}. A quick plausibility check: kiosk 3 sells the most coffee and muffins, but fewer sandwiches, the most expensive item, and still comes out on top, which the row totals confirm.

c) Profit is revenue minus cost, that is column 1 minus column 2, that is QPQP times the column (1,−1)T(1, -1)^T: (920−420,  820−390,  1020−450)T=(500,430,570)T(920 - 420,\; 820 - 390,\; 1020 - 450)^T = (500, 430, 570)^T dollars. Totals over the three kiosks add the ROWS, which is the row (1  1  1)(1 \; 1 \; 1) times QPQP on the LEFT: (920+820+1020    420+390+450)=(2760    1260)(920 + 820 + 1020 \;\; 420 + 390 + 450) = (2760 \;\; 1260). So the company takes in 2760 dollars, spends 1260 and keeps 15001500. The side matters: multiplying on the right combines columns, on the left combines rows, which is the row and column reading of exercise 2 used as a tool.

d) The new price column is p+Δpp + \Delta p with Δp=(1,0,1,0)T\Delta p = (1, 0, 1, 0)^T. By distributivity Q(p+Δp)=Qp+QΔpQ(p + \Delta p) = Qp + Q\Delta p, and QpQp is the first column of QPQP, already known. So only QΔpQ\Delta p is needed: it adds the coffee and sandwich columns of the table, (120+40,  90+50,  150+30)T=(160,140,180)T(120 + 40,\; 90 + 50,\; 150 + 30)^T = (160, 140, 180)^T. The new revenues are 920+160=1080920 + 160 = 1080, 820+140=960820 + 140 = 960 and 1020+180=12001020 + 180 = 1200 dollars. Recomputing the whole product with the new prices gives the same result with four times the arithmetic, and four times the chances of a slip.

e) The wanted matrix is (QP)T(QP)^T, 2×32 \times 3, revenue in row 1 and cost in row 2, one column per kiosk. By the reversal rule (QP)T=PTQT(QP)^T = P^T Q^T, a (2×4)(4×3)(2 \times 4)(4 \times 3) product, which exists and has the right size. The tempting QTPTQ^T P^T is (4×3)(2×4)(4 \times 3)(2 \times 4), inner 3≠23 \neq 2, and does not exist. So the transpose rule is not an abstract identity: it is what an accountant uses without knowing it when a spreadsheet is turned sideways, and the sizes check it in three seconds.

Exercise 10: Flight routes and paths of length two: the adjacency matrix

A regional airline serves four airports, numbered 1 to 4. Every arrow on the figure is a direct flight, and every flight is one-way: there is a flight from 1 to 3 and another from 3 to 1, but only from 4 to 2 and never back.

The adjacency matrix of the network is the 4×44 \times 4 matrix MM with mij=1m_{ij} = 1 if there is a direct flight from airport ii to airport jj, and mij=0m_{ij} = 0 otherwise.

1234
  • a) Write MM. Is it symmetric? What would it mean for it to be?
  • b) Compute M2M^2. Explain why its (i,j)(i,j) entry is the number of trips from ii to jj with exactly two flights, and list the trips counted by the entry (3,2)(3,2).
  • c) Compute M+M2M + M^2. Which airport cannot be reached from which other airport in at most two flights?
  • d) Compute tr⁡(M2)\operatorname{tr}(M^2) and interpret it.
  • e) What network does MTM^T describe? Show that (M2)T=(MT)2(M^2)^T = (M^T)^2 and use it to give, without new computation, the number of two-flight trips from 2 to 3 in that network.
Show the solution

Answers

  • a) M=(0110001010010100)M = \begin{pmatrix} 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix}, not symmetric; symmetric would mean every route runs both ways
  • b) M2=(1011100102100010)M^2 = \begin{pmatrix} 1 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 \\ 0 & 2 & 1 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}; (M2)32=2(M^2)_{32} = 2: 3→1→23 \to 1 \to 2 and 3→4→23 \to 4 \to 2
  • c) M+M2=(1121101112110110)M + M^2 = \begin{pmatrix} 1 & 1 & 2 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 2 & 1 & 1 \\ 0 & 1 & 1 & 0 \end{pmatrix}; airport 1 cannot be reached from airport 4 in at most two flights
  • d) tr⁡(M2)=2\operatorname{tr}(M^2) = 2: the round trips 1→3→11 \to 3 \to 1 and 3→1→33 \to 1 \to 3
  • e) MTM^T is the network with every flight reversed; ((MT)2)23=(M2)32=2((M^T)^2)_{23} = (M^2)_{32} = 2

a) Row ii lists the departures from airport ii. From 1 there are flights to 2 and 3; from 2, to 3; from 3, to 1 and 4; from 4, to 2. So M=(0110001010010100)M = \begin{pmatrix} 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix}. It is not symmetric: m12=1m_{12} = 1 but m21=0m_{21} = 0, because the flight 1→21 \to 2 has no return. The matrix would be symmetric exactly when every route is served in both directions, which is the case for the pair 1,31, 3 and for no other pair. Row sums count departures and column sums count arrivals: airport 2 has one departure and two arrivals.

b) Row by row, using the row reading: row ii of M2M^2 is row ii of MM times MM, that is the sum of the rows of MM for the airports reachable from ii. Row 1 is row 2 plus row 3, (0,0,1,0)+(1,0,0,1)=(1,0,1,1)(0,0,1,0) + (1,0,0,1) = (1, 0, 1, 1); row 2 is row 3; row 3 is row 1 plus row 4, (0,2,1,0)(0, 2, 1, 0); row 4 is row 2. So M2=(1011100102100010)M^2 = \begin{pmatrix} 1 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 \\ 0 & 2 & 1 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}. Why it counts trips: (M2)ij=∑kmikmkj(M^2)_{ij} = \sum_k m_{ik} m_{kj}, and the term mikmkjm_{ik} m_{kj} equals 11 exactly when there is a flight i→ki \to k AND a flight k→jk \to j, that is a two-flight trip through kk, and 00 otherwise. Summing over the stopover kk counts every such trip once. For (3,2)(3,2): k=1k = 1 gives 3→1→23 \to 1 \to 2 and k=4k = 4 gives 3→4→23 \to 4 \to 2, total 22. The row-times-column formula IS the counting argument.

c) M+M2=(1121101112110110)M + M^2 = \begin{pmatrix} 1 & 1 & 2 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 2 & 1 & 1 \\ 0 & 1 & 1 & 0 \end{pmatrix} counts the trips with one OR two flights. Off the diagonal, the only zero is in position (4,1)(4,1): from airport 4, airport 1 cannot be reached in at most two flights. Indeed from 4 the only flight goes to 2, and from 2 the only flight goes to 3. It takes three flights, 4→2→3→14 \to 2 \to 3 \to 1, and M3M^3 would detect it. The diagonal zeros at (2,2)(2,2) and (4,4)(4,4) say that no passenger can leave 2 or 4 and be back within two flights. Note the 22 in position (1,3)(1,3): one direct flight plus the two-flight trip 1→2→31 \to 2 \to 3.

d) tr⁡(M2)=1+0+1+0=2\operatorname{tr}(M^2) = 1 + 0 + 1 + 0 = 2. A diagonal entry (M2)ii(M^2)_{ii} counts the two-flight trips that start and end at ii, that is the round trips out and back. There is one at airport 1, 1→3→11 \to 3 \to 1, and one at airport 3, 3→1→33 \to 1 \to 3: the same pair of routes seen from its two ends. In general tr⁡(M2)\operatorname{tr}(M^2) is twice the number of pairs of airports connected in both directions, which is a quick way to read two-way service off the matrix with no picture.

e) (MT)ij=mji(M^T)_{ij} = m_{ji}, so MTM^T has a flight i→ji \to j exactly when MM has j→ij \to i: it is the same network with every arrow reversed. By the reversal rule, (M2)T=(MM)T=MTMT=(MT)2(M^2)^T = (MM)^T = M^T M^T = (M^T)^2; here the two factors are equal, so the reversal of the order is invisible, which is the one case where (XY)T=XTYT(XY)^T = X^T Y^T happens to be true. In words: a two-flight trip 3→k→23 \to k \to 2 read backwards is a two-flight trip 2→k→32 \to k \to 3 in the reversed network. So the number of such trips from 2 to 3 is ((MT)2)23=(M2)32=2((M^T)^2)_{23} = (M^2)_{32} = 2, namely 2→1→32 \to 1 \to 3 and 2→4→32 \to 4 \to 3 with every arrow reversed.

See also

Struggling with MATH 133?

I tutor first-year linear algebra at McGill and Concordia, in English or in French, in Montreal or online. Get in touch for a first session.

Site by Studio Squalli