Linear-Algebra-Done-Right ยท Unit 6 ยท Video 3 ยท Interactive Practice

Rows, Columns and Linear Combinations in Matrix Products

IKey Formulas

FormulaNameSizes
(AB)j,k=Aj,โ‹…โ€‰Bโ‹…,k(AB)_{j,k} = A_{j,\cdot}\,B_{\cdot,k}Entry = row times columnAA is mร—nm \times n, BB is nร—pn \times p
(AB)โ‹…,k=Aโ€‰Bโ‹…,k(AB)_{\cdot,k} = A\,B_{\cdot,k} and (AB)j,โ‹…=Aj,โ‹…โ€‰B(AB)_{j,\cdot} = A_{j,\cdot}\,BColumn / row of a productmร—1m \times 1 and 1ร—p1 \times p
Ab=b1Aโ‹…,1+โ‹ฏ+bnAโ‹…,nAb = b_1 A_{\cdot,1} + \cdots + b_n A_{\cdot,n}Matrix times columnbb is nร—1n \times 1
aB=a1B1,โ‹…+โ‹ฏ+anBn,โ‹…aB = a_1 B_{1,\cdot} + \cdots + a_n B_{n,\cdot}Row times matrixaa is 1ร—n1 \times n

Key Insight: Column kk of CRCR is a linear combination of the columns of CC with coefficients from column kk of RR; row jj of CRCR is a linear combination of the rows of RR with coefficients from row jj of CC.

IIEntry = Row Times Column

Each entry (AB)j,k(AB)_{j,k} is the 1ร—11 \times 1 product of row jj of AA and column kk of BB.

IIIMatrix Times Column, Row Times Matrix

With A=(2โˆ’111)A = \begin{pmatrix} 2 & -1 \\ 1 & 1 \end{pmatrix}, AbAb combines the columns of AA and aAaA combines its rows.

IVColumns and Rows of CR

Column kk of CRCR uses only column kk of RR, as coefficients on the columns of CC; rows mirror this.

๐Ÿ’ก So every column of CRCR lies in the span of the columns of CC, and every row of CRCR lies in the span of the rows of RR โ€” the fact the next video builds on.

VQuiz Questions

Problem 1 ยท Change One Column of B

Given: A=(120โˆ’131)A = \begin{pmatrix} 1 & 2 \\ 0 & -1 \\ 3 & 1 \end{pmatrix} and B=(2101โˆ’14)B = \begin{pmatrix} 2 & 1 & 0 \\ 1 & -1 & 4 \end{pmatrix}. The entry B2,2B_{2,2} is changed from โˆ’1-1 to 22, so column 22 of BB becomes (12)\begin{pmatrix} 1 \\ 2 \end{pmatrix} โ€” decide which entries of ABAB can change and find the new column 22 of ABAB.

Which entries of ABAB can change?

The new column 22 of ABAB isโ€ฆ

โœ… Correct! (AB)โ‹…,2=Aโ€‰Bโ‹…,2=1โ‹…Aโ‹…,1+2โ‹…Aโ‹…,2(AB)_{\cdot,2} = A\,B_{\cdot,2} = 1 \cdot A_{\cdot,1} + 2 \cdot A_{\cdot,2}, and columns 11 and 33 of ABAB never use column 22 of BB.
โŒ Rows of BB are not rows of ABAB. Row jj of ABAB is Aj,โ‹…โ€‰BA_{j,\cdot}\,B, which uses all of BB. The changed entry sits in column 22 of BB, and only column 22 of ABAB, which is Aโ€‰Bโ‹…,2A\,B_{\cdot,2}, uses that column.
โŒ Too narrow. Every entry of column 22, (AB)j,2=Aj,โ‹…โ€‰Bโ‹…,2(AB)_{j,2} = A_{j,\cdot}\,B_{\cdot,2}, contains the term Aj,2โ€‰B2,2A_{j,2}\,B_{2,2}, and here A1,2=2A_{1,2} = 2, A2,2=โˆ’1A_{2,2} = -1, A3,2=1A_{3,2} = 1 are all nonzero.
โŒ Too broad. Column kk of ABAB is Aโ€‰Bโ‹…,kA\,B_{\cdot,k}, which uses only column kk of BB. Columns 11 and 33 of BB are unchanged, so columns 11 and 33 of ABAB are too.
โŒ Coefficients on the wrong columns. That is 2Aโ‹…,1+Aโ‹…,22A_{\cdot,1} + A_{\cdot,2}, which is column 11 of ABAB. The first entry of the new Bโ‹…,2B_{\cdot,2}, which is 11, multiplies the first column of AA.
โŒ That is the old column. A(1โˆ’1)=Aโ‹…,1โˆ’Aโ‹…,2A\begin{pmatrix} 1 \\ -1 \end{pmatrix} = A_{\cdot,1} - A_{\cdot,2} is column 22 of ABAB before the change; use the new column (12)\begin{pmatrix} 1 \\ 2 \end{pmatrix}.
โŒ Only the middle entry was updated. All three entries of column 22 use B2,2B_{2,2}, so all three change, not just (AB)2,2(AB)_{2,2}.
Show solution

Column kk of ABAB is Aโ€‰Bโ‹…,kA\,B_{\cdot,k}, so it depends on column kk of BB and on nothing else in BB. Changing B2,2B_{2,2} changes column 22 of BB only, so only column 22 of ABAB can change. Its new value is a linear combination of the columns of AA with coefficients 11 and 22:

A(12)=1(103)+2(2โˆ’11)=(103)+(4โˆ’22)=(5โˆ’25).A\begin{pmatrix} 1 \\ 2 \end{pmatrix} = 1\begin{pmatrix} 1 \\ 0 \\ 3 \end{pmatrix} + 2\begin{pmatrix} 2 \\ -1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 3 \end{pmatrix} + \begin{pmatrix} 4 \\ -2 \\ 2 \end{pmatrix} = \begin{pmatrix} 5 \\ -2 \\ 5 \end{pmatrix}.

Before the change it was Aโ‹…,1โˆ’Aโ‹…,2=(โˆ’112)A_{\cdot,1} - A_{\cdot,2} = \begin{pmatrix} -1 \\ 1 \\ 2 \end{pmatrix}, so all three entries of column 22 did change, while columns 11 and 33 of ABAB, (4โˆ’17)\begin{pmatrix} 4 \\ -1 \\ 7 \end{pmatrix} and (8โˆ’44)\begin{pmatrix} 8 \\ -4 \\ 4 \end{pmatrix}, stay the same.

Problem 2 ยท A Column of a Product

Given: A=(1โˆ’20321)A = \begin{pmatrix} 1 & -2 \\ 0 & 3 \\ 2 & 1 \end{pmatrix} and B=(41โˆ’1203)B = \begin{pmatrix} 4 & 1 & -1 \\ 2 & 0 & 3 \end{pmatrix} โ€” find (AB)โ‹…,3(AB)_{\cdot,3}, column 33 of ABAB.

โœ… Correct! (AB)โ‹…,3=Aโ€‰Bโ‹…,3=โˆ’1โ‹…Aโ‹…,1+3โ‹…Aโ‹…,2(AB)_{\cdot,3} = A\,B_{\cdot,3} = -1 \cdot A_{\cdot,1} + 3 \cdot A_{\cdot,2}.
โŒ Coefficients on the wrong columns. That is 3Aโ‹…,1โˆ’Aโ‹…,23A_{\cdot,1} - A_{\cdot,2}. The first entry of Bโ‹…,3B_{\cdot,3}, which is โˆ’1-1, multiplies the first column of AA.
โŒ Wrong column of BB. That is Aโ€‰Bโ‹…,1A\,B_{\cdot,1}, column 11 of ABAB. Column 33 of ABAB needs column 33 of BB, which is (โˆ’13)\begin{pmatrix} -1 \\ 3 \end{pmatrix}.
โŒ Check the sign. That is Aโ‹…,1+3Aโ‹…,2A_{\cdot,1} + 3A_{\cdot,2}; the coefficient on Aโ‹…,1A_{\cdot,1} is B1,3=โˆ’1B_{1,3} = -1, not 11.
Show solution

Column 33 of ABAB is AA times column 33 of BB, and a matrix times a column is a linear combination of the matrix's columns, with coefficients from that column:

(AB)โ‹…,3=A(โˆ’13)=โˆ’1(102)+3(โˆ’231)=(โˆ’10โˆ’2)+(โˆ’693)=(โˆ’791).(AB)_{\cdot,3} = A\begin{pmatrix} -1 \\ 3 \end{pmatrix} = -1\begin{pmatrix} 1 \\ 0 \\ 2 \end{pmatrix} + 3\begin{pmatrix} -2 \\ 3 \\ 1 \end{pmatrix} = \begin{pmatrix} -1 \\ 0 \\ -2 \end{pmatrix} + \begin{pmatrix} -6 \\ 9 \\ 3 \end{pmatrix} = \begin{pmatrix} -7 \\ 9 \\ 1 \end{pmatrix}.

Only column 33 of BB is needed; the rest of BB never enters.

Problem 3 ยท A Row Times a Matrix

Given: a=(2โˆ’13)a = \begin{pmatrix} 2 & -1 & 3 \end{pmatrix} and B=(1402โˆ’11)B = \begin{pmatrix} 1 & 4 \\ 0 & 2 \\ -1 & 1 \end{pmatrix} โ€” describe aBaB and compute it.

aBaB is a linear combination ofโ€ฆ

aB=aB =

โœ… Correct! aB=2B1,โ‹…โˆ’B2,โ‹…+3B3,โ‹…=(โˆ’19)aB = 2B_{1,\cdot} - B_{2,\cdot} + 3B_{3,\cdot} = \begin{pmatrix} -1 & 9 \end{pmatrix}.
โŒ Not quite. aa has three entries and BB has three rows (but only two columns): in aB=a1B1,โ‹…+a2B2,โ‹…+a3B3,โ‹…aB = a_1 B_{1,\cdot} + a_2 B_{2,\cdot} + a_3 B_{3,\cdot}, entry ii of the row aa multiplies row ii of BB.
โŒ Check the sign. a2=โˆ’1a_2 = -1, so row 22 of BB is subtracted: โˆ’(02)-\begin{pmatrix} 0 & 2 \end{pmatrix}, not +(02)+\begin{pmatrix} 0 & 2 \end{pmatrix}.
โŒ Coefficients reversed. That is 3B1,โ‹…โˆ’B2,โ‹…+2B3,โ‹…3B_{1,\cdot} - B_{2,\cdot} + 2B_{3,\cdot}. The first entry of aa multiplies the first row of BB.
โŒ Check B3,1B_{3,1}. It is โˆ’1-1, so 3B3,โ‹…=(โˆ’33)3B_{3,\cdot} = \begin{pmatrix} -3 & 3 \end{pmatrix} and the first entry is 2โˆ’0โˆ’3=โˆ’12 - 0 - 3 = -1.
Show solution

A 1ร—31 \times 3 row times a 3ร—23 \times 2 matrix is a linear combination of the three rows of the matrix, with coefficients from the row:

aB=2(14)โˆ’1(02)+3(โˆ’11)=(28)+(0โˆ’2)+(โˆ’33)=(โˆ’19).aB = 2\begin{pmatrix} 1 & 4 \end{pmatrix} - 1\begin{pmatrix} 0 & 2 \end{pmatrix} + 3\begin{pmatrix} -1 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 8 \end{pmatrix} + \begin{pmatrix} 0 & -2 \end{pmatrix} + \begin{pmatrix} -3 & 3 \end{pmatrix} = \begin{pmatrix} -1 & 9 \end{pmatrix}.

Check one entry with row times column: entry 22 of aBaB is aโ€‰Bโ‹…,2=2โ‹…4+(โˆ’1)โ‹…2+3โ‹…1=9a\,B_{\cdot,2} = 2 \cdot 4 + (-1) \cdot 2 + 3 \cdot 1 = 9.

Problem 4 ยท Columns and Rows of CR

Given: C=(120โˆ’13120)C = \begin{pmatrix} 1 & 2 \\ 0 & -1 \\ 3 & 1 \\ 2 & 0 \end{pmatrix} with columns u=Cโ‹…,1u = C_{\cdot,1}, v=Cโ‹…,2v = C_{\cdot,2}, and R=(20โˆ’1134)R = \begin{pmatrix} 2 & 0 & -1 \\ 1 & 3 & 4 \end{pmatrix} with rows r1=R1,โ‹…r_1 = R_{1,\cdot}, r2=R2,โ‹…r_2 = R_{2,\cdot} โ€” express column 33 and row 33 of CRCR.

Column 33 of CRCR isโ€ฆ

Row 33 of CRCR isโ€ฆ

โœ… Correct! Column 33 takes its coefficients โˆ’1,4-1, 4 from column 33 of RR; row 33 takes its coefficients 3,13, 1 from row 33 of CC.
โŒ Not quite. Column kk of CRCR is R1,kโ€‰u+R2,kโ€‰vR_{1,k}\,u + R_{2,k}\,v: the coefficients are column kk of RR. That option uses a different column of RR.
โŒ Wrong column of RR. 2u+v2u + v uses column 11 of RR, so it is column 11 of CRCR.
โŒ Coefficients swapped. R1,3=โˆ’1R_{1,3} = -1 multiplies u=Cโ‹…,1u = C_{\cdot,1} and R2,3=4R_{2,3} = 4 multiplies v=Cโ‹…,2v = C_{\cdot,2}.
โŒ Not quite. Row jj of CRCR is Cj,1โ€‰r1+Cj,2โ€‰r2C_{j,1}\,r_1 + C_{j,2}\,r_2: the coefficients are row jj of CC. That option uses row 22 of CC, which is (0โˆ’1)\begin{pmatrix} 0 & -1 \end{pmatrix}.
โŒ Coefficients swapped. C3,1=3C_{3,1} = 3 multiplies r1r_1 and C3,2=1C_{3,2} = 1 multiplies r2r_2.
โŒ Wrong row of CC. r1+2r2r_1 + 2r_2 uses row 11 of CC, so it is row 11 of CRCR.
Show solution

Column 3. (CR)โ‹…,3=Cโ€‰Rโ‹…,3=R1,3โ€‰Cโ‹…,1+R2,3โ€‰Cโ‹…,2=โˆ’u+4v(CR)_{\cdot,3} = C\,R_{\cdot,3} = R_{1,3}\,C_{\cdot,1} + R_{2,3}\,C_{\cdot,2} = -u + 4v:

โˆ’(1032)+4(2โˆ’110)=(7โˆ’41โˆ’2).-\begin{pmatrix} 1 \\ 0 \\ 3 \\ 2 \end{pmatrix} + 4\begin{pmatrix} 2 \\ -1 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 7 \\ -4 \\ 1 \\ -2 \end{pmatrix}.

Row 3. (CR)3,โ‹…=C3,โ‹…โ€‰R=C3,1โ€‰r1+C3,2โ€‰r2=3r1+r2(CR)_{3,\cdot} = C_{3,\cdot}\,R = C_{3,1}\,r_1 + C_{3,2}\,r_2 = 3r_1 + r_2:

3(20โˆ’1)+(134)=(731).3\begin{pmatrix} 2 & 0 & -1 \end{pmatrix} + \begin{pmatrix} 1 & 3 & 4 \end{pmatrix} = \begin{pmatrix} 7 & 3 & 1 \end{pmatrix}.

Both agree with entry (CR)3,3=C3,โ‹…โ€‰Rโ‹…,3=3โ‹…(โˆ’1)+1โ‹…4=1(CR)_{3,3} = C_{3,\cdot}\,R_{\cdot,3} = 3 \cdot (-1) + 1 \cdot 4 = 1.

Solved: 0 / 4