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] 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+3B, a transpose and the product CCT, products 2×2, (1×3)(3×1) and then in the other order, (2×3)(3×2) and 3×3, a square, the cube of a triangular matrix and the expression P2−3P+2I. Then eight inverses: by the 2×2 formula and the determinant, a non-invertible matrix to recognize, a diagonal matrix, two 3×3 inverses by the [A∣I] method and two systems solved by X=A−1B. 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=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. AB and BA 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.
Self-checking setType 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.
•Sum and scalar multiple: entry by entry, between matrices of the same size. (A+B)ij=Aij+Bij and (kA)ij=kAij. Transpose: (AT)ij=Aji (rows and columns are swapped).
•Matrix product: the entry (i,j) of AB is the dot product of row i of A with column j of B. The number of columns of A must equal the number of rows of B. In general AB=BA: the product is NOT commutative.
•A linear system is written AX=B, where A is the coefficient matrix, X the column of unknowns and B the column of constants.
•Gauss-Jordan elimination: write the augmented matrix [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]. The last column then gives the solution directly.
•2×2 determinant: det(acbd)=ad−bc. 3×3 determinant: cofactor expansion along a row or a column (with alternating signs +−+).
•Inverse of a 2×2 matrix: if detA=0, then A−1=detA1(d−c−ba). A matrix is invertible if and only if its determinant is non-zero.
•Cramer's rule: if detA=0, the unknown xi equals detAdetAi, where Ai is the matrix A with column i replaced by the column B. If detA=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 Mij for the entry in row i and column j of the matrix M.
Before any product, write down the sizes: (m×n)(n×p) gives an m×p matrix, and the product exists only if the two n match. The entry (AB)ij is row i of A times column j of B: 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=(31−24) and B=(−1520): compute 2A+3B, then give (2A+3B)12 and (2A+3B)21.
b) C=104−231: write CT, then compute CCT; give (CT)23 and (CCT)13.
c) (2−153)(42−16): give entries (1,2) and (2,1) of the product.
d) (2−14)35−2: give the result.
e) 35−2(2−14): give entries (2,3) and (3,2) of the product.
f) (1301−22)2−13140: give entries (1,1) and (2,2) of the product.
g) 1−12210031201−13112−2: give entries (2,3) and (3,2) of the product.
h) M=(12−34): compute M2, then give (M2)11 and (M2)22.
i) N=(201−1): compute N3, then give (N3)12 and (N3)22.
j) P=(2−113): compute P2−3P+2I, then give its entries (1,1) and (1,2).
Show the solution
Answers
a)2A+3B=(31728); 2 and 17
b)(CT)23=1; (CCT)13=2
c)(1822819); 28 and 2
d)6−5−8=−7
e)a 3×3 matrix; 20 and 2
f)(−41117); −4 and 7
g)21557−15−50; −5 and −1
h)M2=(−510−1510); −5 and 10
i)N3=(803−1); 3 and −1
j)P2−3P+2I=(−1−221); −1 and 2
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=(62−48) and 3B=(−31560), so 2A+3B=(31728): (2A+3B)12=2 and (2A+3B)21=17. Pitfall: reading (⋅)12 as row 2, column 1; the ROW index always comes first.
b)
The transpose swaps rows and columns: CT=(1−20341), so (CT)23=C32=1. CCT is a (3×2)(2×3) product, hence a 3×3 matrix; its entry (1,3) is row 1 of C times column 3 of CT, that is, times row 3 of C: 1×4+(−2)×1=2. Pitfall: computing CTC, which is a 2×2 matrix and has no column 3.
c)
A (2×2)(2×2) product. Row 1 times column 2: 2×(−1)+5×6=28. Row 2 times column 1: (−1)×4+3×2=2. The full product is (1822819). Pitfall: multiplying entry by entry, which gives (8−2−518).
d)
A (1×3)(3×1) product gives a 1×1 matrix, that is, a number: 2×3+(−1)×5+4×(−2)=6−5−8=−7.
e)
The same factors as in d), in the other order: (3×1)(1×3) gives a 3×3 matrix, whose entry (i,j) is the i-th term of the column times the j-th term of the row. Entry (2,3): 5×4=20. Entry (3,2): (−2)×(−1)=2. Pitfall: expecting to get −7 again; here, changing the order changes even the size.
f)
(2×3)(3×2) gives a 2×2 matrix. Row 1 times column 1: 1×2+0×(−1)+(−2)×3=−4. Row 2 times column 2: 3×1+1×4+2×0=7. The full product is (−41117).
g)
Row 2 times column 3: (−1)×1+1×2+3×(−2)=−5. Row 3 times column 2: 2×(−1)+0×3+1×1=−1. The full product is 21557−15−50. Pitfall: taking column 2 of the FIRST matrix; the first factor always supplies the row.
h)
M2=MM=(1−62+8−3−12−6+16)=(−510−1510), so (M2)11=−5 and (M2)22=10. Pitfall: squaring each entry, which gives (14916).
i)
N2=(402−11)=(4011), then N3=N2N=(804−1−1)=(803−1). The diagonal of a triangular matrix can be computed on its own, 23=8 and (−1)3=−1, but not the off-diagonal entry. Pitfall: writing 13=1 in position (1,2).
j)
P2=(4−1−2−32+3−1+9)=(3−558), −3P=(−63−3−9) and 2I=(2002). The sum is (−1−221): entries −1 and 2. Pitfall: adding 2 to every entry instead of 2I, which gives 4 in position (1,2).
Check: the rule (m×n)(n×p)=m×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, and the trace found is indeed −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×2 matrix, first compute detA=ad−bc: if it is zero, the matrix is not invertible; otherwise swap a and d, change the sign of b and c, and divide by the determinant. For a 3×3 matrix, form [A∣I] and apply elementary row operations until you reach [I∣A−1]. For a system AX=B, write X=A−1B, with the inverse on the LEFT.
a) P=(5332): compute P−1, then give (P−1)11 and (P−1)12.
b) Q=(43−21): compute Q−1, then give (Q−1)12 and (Q−1)21.
c) R=(6−9−46): compute detR and say whether R is invertible.
d) D=−5000400031: compute D−1, then give (D−1)11 and (D−1)33.
e) U=100210−131: compute U−1 by the [U∣I] method, then give (U−1)13 and (U−1)23.
f) M=121253122: compute M−1 by the [M∣I] method, then give (M−1)11 and (M−1)32.
g) Write the system {3x+5y=12x+4y=−2 in the form AX=B, then solve it with X=A−1B.
h) K=321111001 has inverse K−1=1−21−13−2001: solve KX=534, then give y and z.
Show the solution
Answers
a)P−1=(2−3−35); 2 and −3
b)Q−1=101(1−324); 0.2 and −0.3
c)detR=0; not invertible
d)D−1=diag(−51,41,3); −0.2 and 3
e)U−1=100−2107−31; 7 and −3
f)M−1=4−21−11−1−101; 4 and −1
g)X=A−1B=(7−4); x=7, y=−4
h)X=2−13; y=−1, z=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=I.
a)
detP=5×2−3×3=1. Swap 5 and 2, change the sign of both 3s: P−1=(2−3−35). Check on row 1 of PP−1: 5×2+3×(−3)=1 and 5×(−3)+3×5=0.
b)
detQ=4×1−(−2)×3=4+6=10, so Q−1=101(1−324): (Q−1)12=102=0.2 and (Q−1)21=−103=−0.3. Pitfall: writing detQ=4−6=−2, forgetting that b=−2 is already negative.
c)
detR=6×6−(−4)×(−9)=36−36=0: R is not invertible. The second row is −23 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=−51000410003, so (D−1)11=−51=−0.2 and (D−1)33=3. Pitfall: losing the sign, when −51 stays negative.
e)
Start from [U∣I] and work upward. R2→R2−3R3 gives (010∣01−3); R1→R1+R3 gives (120∣101); R1→R1−2R2 gives (100∣1−27). So U−1=100−2107−31: (U−1)13=7 and (U−1)23=−3. Pitfall: only changing the off-diagonal signs, which puts 1 in position (1,3); the 7=2×3+1 mixes the two other entries.
f)
[M∣I], then R2→R2−2R1: (010∣−210); R3→R3−R1: (011∣−101); R3→R3−R2: (001∣1−11). Now work upward: R1→R1−2R2 gives (101∣5−20), then R1→R1−R3 gives (100∣4−1−1). So M−1=4−21−11−1−101: (M−1)11=4 and (M−1)32=−1. Check, row 1 of M times column 1 of M−1: 4−4+1=1.
g)
A=(3254), X=(xy), B=(1−2). detA=12−10=2, so A−1=21(4−2−53) and X=21(4×1+(−5)×(−2)−2×1+3×(−2))=21(14−8)=(7−4). Check: 3×7+5×(−4)=1 and 2×7+4×(−4)=−2.
h)
X=K−1534, row by row: x=5−3+0=2, y=−10+9+0=−1, z=5−6+4=3. Check in K: 3×2−1=5, 2×2−1=3 and 2−1+3=4. Pitfall: writing X=BK−1, a (3×1)(3×3) product that does not even exist.
Check: each inverse is verified with one row of AA−1, which must give back a row of I, and each solution is substituted into the original system. A 2×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=(23−10) and B=(1−245).
a) Compute A+B and 3A−2B.
b) Find the transpose AT.
c) Compute both products AB and BA.
d) Compare AB and BA. What can you conclude about the commutativity of the matrix product?
Show the solution
Answers
a)A+B=(3135), 3A−2B=(413−11−10)
b)AT=(2−130)
c)AB=(43312), BA=(1411−12)
d)AB=BA: not commutative
a)
A+B=(2+13−2−1+40+5)=(3135). For 3A−2B: 3A=(69−30) and 2B=(2−4810), so 3A−2B=(413−11−10).
b)
AT=(2−130): the first row of A becomes the first column.
c)
AB=((2)(1)+(−1)(−2)(3)(1)+(0)(−2)(2)(4)+(−1)(5)(3)(4)+(0)(5))=(43312). And BA=((1)(2)+(4)(3)(−2)(2)+(5)(3)(1)(−1)+(4)(0)(−2)(−1)+(5)(0))=(1411−12).
d)
AB=(43312)=(1411−12)=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=2131−32−121 and the matrix C=120013.
a) Is the product AC defined? If so, give its size, then compute it.
b) Is the product CA defined? Justify.
c) Write the system ⎩⎨⎧2x+y−z=1x−3y+2z=13x+2y+z=10 in the matrix form AX=B, specifying X and B.
d) By computing the product AX, check that X=123 is a solution of the system.
Show the solution
Answers
a)3×2: 4−57−235
b)No: 2 columns, 3 rows
c)X=(x,y,z), B=(1,1,10)
d)AX=B: a solution
a)
A is 3×3 and C is 3×2: the number of columns of A (3) equals the number of rows of C (3), so AC is defined and has size 3×2. AC=(2)(1)+(1)(2)+(−1)(0)(1)(1)+(−3)(2)+(2)(0)(3)(1)+(2)(2)+(1)(0)(2)(0)+(1)(1)+(−1)(3)(1)(0)+(−3)(1)+(2)(3)(3)(0)+(2)(1)+(1)(3)=4−57−235.
b)
C is 3×2 and A is 3×3: the number of columns of C (2) differs from the number of rows of A (3), so CA is NOT defined. One more illustration that order matters: AC exists but CA does not.
c)
A=2131−32−121, X=xyz and B=1110. The system reads AX=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=B. The product gives back exactly B, so 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
a) Write the augmented matrix [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.
Show the solution
Answers
a)A 3×4 matrix
b)Reduced form [I∣X]
c)(1,2,3)
a)
[A∣B]=2131−32−1211110.
b)
First swap R1 and R2 to put a 1 in the top left corner: 123−3122−111110. Then R2→R2−2R1 and R3→R3−3R1: 100−37112−5−51−17.
b, continued) R2→71R2 gives the row (0,1,−75∣−71). Clear column 2 everywhere else: R1→R1+3R2 and R3→R3−11R2. The third row becomes (0,0,720∣760), which after R3→207R3 is the row (0,0,1∣3): so z=3.
c)
Working back up (or finishing the reduction): row 2 gives y−75z=−71, hence y=7−1+5(3)=714=2. Row 1 gives x−3y+2z=1, hence x=1+3(2)−2(3)=1. The reduced row echelon form is therefore [I∣X] with X=(1,2,3). The system has the unique solution x=1,y=2,z=3, which confirms the check made in exercise 2.
Exercise 4: Determinants and the inverse matrix
Consider M=(23−10) and A=2131−32−121.
a) Compute detM.
b) Is M invertible? If so, find M−1, then check that MM−1=I.
c) Compute detA by cofactor expansion along the first row.
d) Using detA, what can you conclude about the number of solutions of the system AX=B of exercise 3, without solving it?
Show the solution
Answers
a)detM=3
b)M−1=(0−13132)
c)detA=−20
d)Unique solution
a)
detM=(2)(0)−(−1)(3)=0+3=3.
b)
detM=3=0, so M is invertible. M−1=31(0−312)=(0−13132). Check: MM−1=(23−10)(0−13132)=(0+10+032−321+0)=(1001)=I.
c)
detA=2det(−3221)−1det(1321)+(−1)det(13−32). Now det(−3221)=−3−4=−7, det(1321)=1−6=−5 and det(13−32)=2+9=11. Therefore detA=2(−7)−1(−5)−1(11)=−14+5−11=−20.
d)
detA=−20=0, so A is invertible and the system AX=B has a unique solution, whatever the column B. We know this without solving: it is consistent with the unique solution (1,2,3) found in exercise 3.
Exercise 5: Inverse of a 3x3 matrix by Gauss-Jordan elimination
Consider the matrix A=1240−11238. We want its inverse by the method [A∣I]→[I∣A−1], which is different from the cofactor formula.
a) Write the augmented matrix [A∣I3], then apply Gauss-Jordan elimination, stating the elementary row operations. Deduce A−1.
b) Check your result by computing the product AA−1.
c) Use A−1 to solve the system AX=B with B=123, by writing X=A−1B.
d) Explain in one sentence why this method becomes especially worthwhile when several systems AX=B must be solved with the same matrix A but different columns B.
Show the solution
Answers
a)A−1=−11−4620−121−1
b)AA−1=I3
c)(−1,−1,1)
d)Inversion done once
a)
Start from [A∣I]=1240−11238100010001. Clear the first column below the pivot: R2→R2−2R1 and R3→R3−4R1 give 1000−112−101−2−4010001.
Make the pivot of the second row equal to 1 with R2→−R2: row (0,1,1∣2,−1,0). Then R3→R3−R2 gives (0,0,−1∣−6,1,1), and R3→−R3 gives (0,0,1∣6,−1,−1): the pivot of the third row is 1.
It remains to clear the third column above the last pivot: R2→R2−R3 gives (0,1,0∣−4,0,1), and R1→R1−2R3 gives (1,0,0∣−11,2,2). The left block is now I3, so A−1=−11−4620−121−1.
b)
AA−1=1240−11238−11−4620−121−1. First row: (1)(−11)+(0)(−4)+(2)(6)=1, (1)(2)+(0)(0)+(2)(−1)=0, (1)(2)+(0)(1)+(2)(−1)=0. Continuing with the other two rows gives I3, which confirms the inverse.
c)
X=A−1B=−11−4620−121−1123=−11+4+6−4+0+36−2−3=−1−11. The solution is x=−1, y=−1, z=1. Check in the first equation x+2z=1: −1+2(1)=1, as required.
d)
Once A−1 is known, each new system with the same matrix is solved by a simple product A−1B, 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=(1023) and B=(4215). Compute (AB)T and BTAT, and check that they are equal. The general property is (AB)T=BTAT: transposition reverses the order of the factors.
b) Consider the matrix Ak=(132k). For which value of k is Ak not invertible?
c) Depending on the value of c, determine the number of solutions of the system {x+2y=33x+6y=c. Relate your answer to the fact that the determinant of the coefficient matrix is zero.
Show the solution
Answers
a)(AB)T=BTAT=(811615)
b)k=6
c)c=9: infinitely many; otherwise none
a)
AB=((1)(4)+(2)(2)(0)(4)+(3)(2)(1)(1)+(2)(5)(0)(1)+(3)(5))=(861115), so (AB)T=(811615). Also BT=(4125) and AT=(1203), so BTAT=((4)(1)+(2)(2)(1)(1)+(5)(2)(4)(0)+(2)(3)(1)(0)+(5)(3))=(811615). The two results agree: (AB)T=BTAT. Note that ATBT, in the wrong order, would give something else: the reversed order is indeed the correct one.
b)
detAk=(1)(k)−(2)(3)=k−6. The matrix is not invertible when its determinant is zero, that is, for k=6.
c)
The coefficient matrix is (1326), with determinant (1)(6)−(2)(3)=0: so the system does not have a unique solution. In detail, the second equation is 3x+6y=c, that is 3(x+2y)=c. Since the first equation forces x+2y=3, we would need 3(3)=c, that is c=9. So: if c=9, the two equations are proportional and the system has infinitely many solutions (the whole line x+2y=3); if c=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 e, r and v 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 e, r and v, then write the coefficient matrix A and compute detA.
b) Solve the system by Cramer's rule, that is, by computing e=detAdetAe, r=detAdetAr and v=detAdetAv.
c) Synthesis question: keep the same 380 tickets sold and the same condition r=2v, but replace the revenue by a target value S. Treating e, r and v as real numbers for now, for which values of S is there a valid distribution, that is, one with e≥0, r≥0 and v≥0? Interpret the two bounds.
d) Tickets are sold one at a time: e, r and v are whole numbers. What is the largest revenue actually possible, and for which distribution?
Show the solution
Answers
a)detA=−45
b)200, 120, 60
c)5700≤S≤11400
d)11370 dollars, with e=2, r=252 and v=126
a)
The conditions give ⎩⎨⎧e+r+v=38015e+25r+40v=8400r−2v=0. The coefficient matrix is A=11501251140−2. By cofactor expansion along the first column: detA=1det(25140−2)−15det(111−2)+0=1(−50−40)−15(−2−1)=−90+45=−45. Since detA=−45=0, the solution is unique.
b)
Replace each column in turn by B=38084000. This gives detAe=−9000, detAr=−5400 and detAv=−2700. Hence e=−45−9000=200, r=−45−5400=120 and v=−45−2700=60. Check: 200+120+60=380, 15(200)+25(120)+40(60)=3000+3000+2400=8400 and 120=2(60). The hall sold 200 student tickets, 120 regular tickets and 60 VIP tickets.
c)
With r=2v, the first equation gives e+2v+v=380, so e=380−3v. The revenue becomes S=15(380−3v)+25(2v)+40v=5700+45v, hence v=45S−5700. The constraint v≥0 forces S≥5700: this is the minimum revenue, reached when v=0 (no regular or VIP tickets, 380 student tickets, revenue 15×380=5700 dollars). The constraint e=380−3v≥0 forces v≤3380, so S≤5700+45⋅3380=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≤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, v is a whole number and e=380−3v≥0 forces v≤126, since 3×127=381>380. The revenue S=5700+45v increases with v, so it is largest for v=126: r=252, e=380−378=2 and S=5700+45×126=11370 dollars. The bound 11400 from question c) is not reached, because it would take v=3380 VIP tickets. More generally, a revenue S matches an exact ticket count only if 45S−5700 is a whole number between 0 and 126.
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, whose coefficient matrix is A=1232−11−132.
a) Compute detA. 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.
Show the solution
Answers
a)detA=0: non-trivial solutions
b)t(−1,1,1)
c)Line through the origin
d)Infinitely many if detA=0
a)
By cofactor expansion along the first row: detA=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. The determinant is zero, so the matrix is singular: the homogeneous system has non-trivial solutions, that is, solutions other than (0,0,0). One remark speeds everything up: the third row is the sum of the first two, R3=R1+R2, which made the dependence visible without any calculation.
b)
Keep the first two equations, the third being redundant. From x+2y−z=0 and 2x−y+3z=0, eliminate x: R2→R2−2R1 gives −5y+5z=0, so y=z. Substituting into the first: x=z−2y=z−2z=−z. Setting z=t as a free parameter, the general solution is (x,y,z)=(−t,t,t)=t(−1,1,1). The direction (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). This is consistent with the geometry: each homogeneous equation represents a plane through the origin, and since the system has rank 2 (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. The zero vector X=0 always satisfies it, since A0=0: so there is always at least the trivial solution. The system also has non-trivial solutions, hence infinitely many, if and only if detA=0 (the matrix is singular, its columns are linearly dependent). If detA=0, the only solution is the zero solution. Our system is in the first case, with detA=0 and a whole line of solutions. This set is closed under addition and scalar multiplication: it is a subspace.
Exercise 9: A system with two parameters: case analysis by rank
Consider the system ⎩⎨⎧x+y+z=2x+2y+3z=52x+3y+az=b, where a and b are two real parameters.
a) Compute the determinant of the coefficient matrix as a function of a. For which value of a can the system fail to have a unique solution?
b) For a=4, what can you say about the number of solutions, without computing them?
c) Take the case a=4. Using Gaussian elimination, determine the number of solutions depending on the value of b.
d) For a=4 and the value of b that gives infinitely many solutions, write the general solution in parametric form.
Show the solution
Answers
a)det=a−4: a=4
b)Unique solution
c)b=7: infinitely many; otherwise none
d)(−1,3,0)+t(1,−2,1)
a)
The determinant of 11212313a, expanded along the first row, is 1(2a−9)−1(a−6)+1(3−4)=2a−9−a+6−1=a−4. It vanishes for a=4: this is the only value for which the system can fail to have a unique solution.
b)
For a=4, det=0, the matrix is invertible and the system has a unique solution, whatever the value of b. Cramer's rule or the inverse apply without restriction.
c)
For a=4, the coefficient matrix becomes 112123134, and we notice that R3=R1+R2. Consistency therefore depends on the same test applied to the right-hand side: we need b=2+5=7. Row reduction shows it: R2→R2−R1 and R3→R3−2R1 give the rows (0,1,2∣3) and (0,1,2∣b−4); then R3→R3−R2 gives (0,0,0∣b−7). If b=7, this row says 0=b−7=0, a contradiction: the system has no solution. If b=7, the row becomes 0=0: the system has infinitely many solutions.
d)
For a=4 and b=7, two independent equations remain: x+y+z=2 and y+2z=3. Take z=t as the free parameter: y=3−2t and x=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). It is a line of solutions, consistent with the rank 2 of the matrix when a=4.
Exercise 10: Proofs: properties of the inverse and special matrices
Questions a) to c) are general proofs about invertible square matrices of order n. Question d) illustrates the result of a) on an example.
a) Let A and B be two invertible matrices of the same order. Prove that AB is invertible and that (AB)−1=B−1A−1, paying close attention to the order of the factors.
b) Prove that if A is invertible, then so is AT, and (AT)−1=(A−1)T.
c) Prove that if a matrix A satisfies A2=A and is invertible, then A=I.
d) Illustrate a) with A=(2001) and B=(1011): compute (AB)−1 and B−1A−1, and check that they are equal but that A−1B−1 is different.
Show the solution
Answers
a)(AB)−1=B−1A−1
b)(AT)−1=(A−1)T
c)A−1A2=A−1A: A=I
d)(210−11); A−1B−1 is different
a)
It is enough to exhibit a matrix which, multiplied by AB, gives the identity on both sides. Let C=B−1A−1. Then (AB)C=(AB)(B−1A−1)=A(BB−1)A−1=AIA−1=AA−1=I, using the associativity of the product. Likewise C(AB)=B−1(A−1A)B=B−1IB=B−1B=I. So AB is invertible and its inverse is B−1A−1. The order is reversed: writing A−1B−1 would be wrong, because the inner factors would no longer cancel. It is the same reversal as for the transpose, (AB)T=BTAT.
b)
Transpose the identity AA−1=I. Since (XY)T=YTXT and IT=I, we get (A−1)TAT=I. Likewise, transposing A−1A=I gives AT(A−1)T=I. The matrix (A−1)T is therefore the inverse of AT on both sides: AT is invertible and (AT)−1=(A−1)T.
c)
Start from A2=A. Since A is invertible, we can multiply both sides on the left by A−1: A−1A2=A−1A. The left side is A−1(AA)=(A−1A)A=IA=A, and the right side is I. So A=I. In other words, the only invertible idempotent matrix is the identity: the other matrices satisfying A2=A (the non-trivial projections) are all singular.
d)
AB=(2001)(1011)=(2021), with determinant 2, so (AB)−1=21(10−22)=(210−11). Also A−1=(21001) and B−1=(10−11), so B−1A−1=(10−11)(21001)=(210−11)=(AB)−1. On the other hand A−1B−1=(21001)(10−11)=(210−211)=(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=(2513) and B=(1201). We are looking for matrices X of order 2.
a) Show that A is invertible and compute A−1.
b) Solve AX=B.
c) Solve XA=B. Is the solution the same as in b)?
d) Solve AX+X=B.
e) For b), a student writes “X=AB”. What should you tell them?
Show the solution
Answers
a)A−1=(3−5−12)
b)X=(1−1−12)
c)X=(31−10): different
d)X=71(21−13)
e)No matrix division
a)
detA=6−5=1=0, so A is invertible and A−1=11(3−5−12)=(3−5−12).
b)
Multiply ON THE LEFT by A−1: X=A−1B=(3−2−5+4−12)=(1−1−12). Check: AX=(2−15−3−2+2−5+6)=B.
c)
Multiply ON THE RIGHT by A−1: X=BA−1=(36−5−1−2+2)=(31−10). Check: XA=(6−523−31)=B. The solution differs from that of b): since the product is not commutative, the side on which X sits decides the side on which A−1 goes.
d)
Factor X out on the right: AX+X=AX+IX=(A+I)X=B. Writing (A+1)X would make no sense: you do not add a number to a matrix. A+I=(3514), with determinant 7 and inverse 71(4−5−13). So X=71(4−2−5+6−13)=71(21−13).
e)
Division by a matrix does not exist: AB does not say whether to multiply by A−1 on the left or on the right, and that is exactly what changes the answer between b) and c). Always write A−1B or BA−1, never a fraction.
The thread: to isolate X, multiply by the inverse on the same side as the factor to remove; X is factored out with I, not with 1.
Exercise 12: Triangular matrices: products, powers and inverse
Consider the upper triangular matrices T=(1023) and U=(20−11), and the diagonal matrix D=2000−10003.
a) Compute TU. What shape does the product have, and what are its diagonal entries?
b) Compute T2 and T3, conjecture a formula for Tn, then prove it by induction.
c) Compute T−1. Is it still triangular?
d) Compute D5 and D−1.
e) Under what condition is a triangular matrix invertible? Is the matrix 100400562 invertible?
Show the solution
Answers
a)TU=(2013)
b)Tn=(103n−13n)
c)T−1=(10−3231)
d)diag(32,−1,243); diag(21,−1,31)
e)No zero on the diagonal; here, not invertible
a)
TU=(20−1+23)=(2013): still upper triangular, and its diagonal is the term-by-term product of the diagonals, 1×2 and 3×1.
b)
T2=(102+69)=(1089) and T3=T2T=(102+2427)=(102627). Conjecture: Tn=(103n−13n), true for n=1. If it holds for n, then Tn+1=TnT=(102+3(3n−1)3n+1)=(103n+1−13n+1): the inductive step holds.
c)
detT=3 and T−1=31(30−21)=(10−3231): upper triangular, with a diagonal made of the reciprocals 1 and 31.
d)
For a diagonal matrix, raise each diagonal entry to the power: D5=diag(32,−1,243), and invert each one: D−1=diag(21,−1,31).
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 0 on the diagonal, so its determinant is 1×0×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, is the sum of its diagonal entries. Consider A=(1324) and B=(051−2).
a) Compute AB and BA, then their traces. Are the two products equal?
b) Prove that tr(AB)=tr(BA) for all square matrices A and B of order 2.
c) Are there two square matrices of order 2 such that AB−BA=I? Justify.
d) With E=(1000), F=(0010) and G=(0100), compute tr(EFG) and tr(FEG). What do you conclude?
e) Show that tr(P−1AP)=tr(A) for every invertible matrix P, and check it with P=(1011).
Show the solution
Answers
a)Both traces equal 5, the products differ
b)The same four products
c)No: 0=2
d)1 and 0: the trace is only cyclic
e)Trace 5 preserved
a)
AB=(1020−3−5) and BA=(3−142). The products are different, but tr(AB)=10−5=5 and tr(BA)=3+2=5.
b)
With A=(aij) and B=(bij): tr(AB)=(a11b11+a12b21)+(a21b12+a22b22) and tr(BA)=(b11a11+b12a21)+(b21a12+b22a22). These are the same four products of numbers, arranged differently: the two traces are equal. The same calculation, ∑i,jaijbji, works for any order n.
c)
No. The trace is linear, so tr(AB−BA)=tr(AB)−tr(BA)=0, whereas tr(I)=2. No pair of matrices can satisfy this equality, in any finite order.
d)
EF=(0010), then EFG=(1000), with trace 1. FE=(0000), so FEG is zero, with trace 0. The factors can be rotated, tr(EFG)=tr(GEF), but not permuted freely: the property is CYCLIC, not commutative.
e)
By b) applied to P−1A and P: tr((P−1A)P)=tr(P(P−1A))=tr(A). With P−1=(10−11): P−1A=(−23−24) and P−1AP=(−23−47), with trace 5=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=I and makes the trace invariant under a change of basis.
Exercise 14: Problem: traffic flows in a neighbourhood
Four intersections A, B, C and D form a square of one-way streets: x1 cars per hour go from A to B, x2 from B to C, x3 from C to D and x4 from D to A.
Outside streets bring traffic in and take it out, in cars per hour: at A, 500 enter and 200 leave; at B, 300 enter and 400 leave; at C, 200 enter and 600 leave; at D, 400 enter and 200 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.
a) Write the four conservation equations.
b) Find the rank of the system. Why is one equation redundant?
c) Express x2, x3 and x4 in terms of x1=t, then compute them for t=600.
d) No flow can be negative, since the streets are one-way. What is the smallest possible value of x1?
e) Roadwork closes the street from C to D. What are the other flows? Could the street from B to C also be limited to 300 cars per hour?
At A: 500+x4=x1+200, that is x1−x4=300. At B: x1+300=x2+400, that is x1−x2=100. At C: x2+200=x3+600, that is x2−x3=400. At D: x3+400=x4+200, that is x3−x4=−200.
b)
The equations at B, C and D, added together, give x1−x4=300, the equation at A. The rank is 3: four unknowns and three independent equations, hence one free parameter. The redundancy comes from the overall balance: 1400 cars per hour enter the neighbourhood and 1400 leave it, so the last intersection is balanced as soon as the other three are.
c)
x2=t−100, x3=x2−400=t−500 and x4=x3+200=t−300. For t=600: x2=500, x3=100 and x4=300. Check at A: 600−300=300.
d)
We need t−100≥0, t−500≥0 and t−300≥0: the strongest constraint is t≥500. At the minimum, 500 cars per hour go from A to B, and the street from C to D is then empty.
e)
x3=0 forces t=500, so x1=500, x2=400 and x4=200: only one distribution is possible. Limiting x2 to 300 would require t≤400, which is incompatible with t≥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 M gives, in grams, the flour, butter and sugar (rows) used for one piece of each product (columns): M=50255552510601515.
The purchase price of the ingredients, in dollars per gram, is given by the row matrix p=(0.0020.0120.003).
a) An order consists of 100 croissants, 80 pains au chocolat and 50 brioches, written q=1008050. Compute Mq and interpret it.
b) Compute pM and interpret each of its entries.
c) Compute the ingredient cost of the order in two ways, p(Mq) and (pM)q.
d) Today's stock is 11900 grams of flour, 5100 grams of butter and 2000 grams of sugar. Compute detM, then find the production that uses up exactly all the stock.
e) Why does question d) require detM=0, and what would a solution with a negative component mean?
Show the solution
Answers
a)12400 g, 5250 g, 2050 g
b)0.415; 0.44; 0.345 dollar
c)93.95 dollars
d)detM=2250; 80, 100, 40
e)Unique solution; negative: impossible
a)
Mq=5000+4400+30002500+2000+750500+800+750=1240052502050: the order needs 12400 grams of flour, 5250 of butter and 2050 of sugar. The product is defined because M has three columns, one per product, just as q 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): the ingredient cost of one croissant, one pain au chocolat and one brioche, in dollars.
c)
p(Mq)=0.002×12400+0.012×5250+0.003×2050=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 dollars. Same result: this is the associativity of the matrix product, read first by ingredients, then by products.
d)
detM=50(375−150)−55(375−75)+60(250−125)=11250−16500+7500=2250=0. The system Mq=s has a unique solution; check that q=8010040 works: 4000+5500+2400=11900, 2000+2500+600=5100 and 400+1000+600=2000. The bakery can make 80 croissants, 100 pains au chocolat and 40 brioches.
e)
If detM=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.
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.