MATH 304Linear AlgebraLecture 4:Matrix multiplication.Diagonal matrices.Inverse matrix.MatricesDefinition. An m-by-n matrix is a rectangulararray of numbers that has m rows and n columns:a11a12. . . a1na21a22. . . a2n............am1am2. . . amnNotation: A = (aij)1≤i≤n, 1≤j≤mor simply A = (aij)if the dimensions are known.Matrix algebra: linear operationsAddition: two matrices of the same dimensionscan be added by adding their corresponding entries.Scalar multiplication: to multiply a matrix A bya scalar r, one multiplies each entry of A by r.Zero matrix O: all entries are zeros.Negative: −A is defined as (−1)A.Subtraction: A − B is defined as A + (−B).As far as the linear operations are concerned, them×n matrices can be regarded as mn-dimensionalvectors.Properties of linear operations(A + B) + C = A + (B + C )A + B = B + AA + O = O + A = AA + (−A) = (−A) + A = Or(sA) = (rs)Ar(A + B) = rA + rB(r + s)A = rA + sA1A = A0A = ODot productDefinition. The dot product of n-dimensionalvectors x = (x1, x2, . . . , xn) and y = (y1, y2, . . . , yn)is a scalarx · y = x1y1+ x2y2+ · · · + xnyn=nXk=1xkyk.The dot product is also called the scalar product.Matrix multiplicationThe product of matrices A and B is defined if thenumber of columns in A matches the number ofrows in B.Definition. Let A = (aik) be an m×n matrix andB = (bkj) be an n×p matrix. The product AB isdefined to be the m×p matrix C = (cij) such thatcij=Pnk=1aikbkjfor all indices i, j.That is, matrices are multiplied row by column:∗ ∗ ∗* * *∗ ∗* ∗∗ ∗* ∗∗ ∗ * ∗=∗ ∗ ∗ ∗∗ ∗* ∗A =a11a12. . . a1na21a22. . . a2n............am1am2. . . amn=v1v2...vmB =b11b12. . . b1pb21b22. . . b2p............bn1bn2. . . bnp= (w1, w2, . . . , wp)=⇒ AB =v1·w1v1·w2. . . v1·wpv2·w1v2·w2. . . v2·wp............vm·w1vm·w2. . . vm·wpExamples.(x1, x2, . . . , xn)y1y2...yn= (Pnk=1xkyk),y1y2...yn(x1, x2, . . . , xn) =y1x1y1x2. . . y1xny2x1y2x2. . . y2xn............ynx1ynx2. . . ynxn.Example.1 1 −10 2 10 3 1 1−2 5 6 01 7 4 1=−3 1 3 0−3 17 16 10 3 1 1−2 5 6 01 7 4 11 1 −10 2 1is not definedSystem of linear equations:a11x1+ a12x2+ · · · + a1nxn= b1a21x1+ a22x2+ · · · + a2nxn= b2· · · · · · · · ·am1x1+ am2x2+ · · · + amnxn= bmMatrix representation of the system:a11a12. . . a1na21a22. . . a2n............am1am2. . . amnx1x2...xn=b1b2...bma11x1+ a12x2+ · · · + a1nxn= b1a21x1+ a22x2+ · · · + a2nxn= b2· · · · · · · · ·am1x1+ am2x2+ · · · + amnxn= bm⇐⇒ Ax = b,whereA =a11a12. . . a1na21a22. . . a2n............am1am2. . . amn, x =x1x2...xn, b =b1b2...bm.Properties of matrix multiplication:(AB)C = A(BC ) (associative law)(A + B)C = AC + BC (distributive law #1)C (A + B) = CA + CB (distributive law #2)(rA)B = A(rB) = r (AB)Any of the above identities holds provided thatmatrix sums and products are well defined.If A and B are n×n matrices, then both AB and BAare well defined n×n matrices.However, in general, AB 6= BA.Example. Let A =2 00 1, B =1 10 1.Then AB =2 20 1, BA =2 10 1.If AB does equal BA, we say that the matrices Aand B commute.Problem. Let A and B be arbitrary n×n matrices.Is it true that (A − B)(A + B) = A2− B2?(A − B)(A + B) = (A − B)A + (A − B)B= (AA − BA) + (AB − BB)= A2+ AB − BA − B2Hence (A − B)(A + B) = A2− B2if and only ifA commutes with B.Diagonal matricesIf A = (aij) is a square matrix, then the entries aiiare called diagonal entries. A square matrix iscalled diagonal if all non-diagonal entries are zeros.Example.7 0 00 1 00 0 2, denoted diag(7, 1, 2).Let A = diag(s1, s2, . . . , sn), B = diag(t1, t2, . . . , tn).Then A + B = diag(s1+ t1, s2+ t2, . . . , sn+ tn),rA = diag(rs1, rs2, . . . , rsn).Example.7 0 00 1 00 0 2−1 0 00 5 00 0 3=−7 0 00 5 00 0 6Theorem Let A = diag(s1, s2, . . . , sn),B = diag(t1, t2, . . . , tn).Then A + B = diag(s1+ t1, s2+ t2, . . . , sn+ tn),rA = diag(rs1, rs2, . . . , rsn).AB = diag(s1t1, s2t2, . . . , sntn).In particular, diagonal matrices always commute(i.e., AB = BA).Example.7 0 00 1 00 0 2a11a12a13a21a22a23a31a32a33=7a117a127a13a21a22a232a312a322a33Theorem Let D = diag(d1, d2, . . . , dm) and A bean m×n matrix. The n the matrix DA is obtainedfrom A by multiplying the ith row by difori = 1, 2, . . . , m:A =v1v2...vm=⇒ DA =d1v1d2v2...dmvmExample.a11a12a13a21a22a23a31a32a337 0 00 1 00 0 2=7a11a122a137a21a222a237a31a322a33Theorem Let D = diag(d1, d2, . . . , dn) and A bean m×n matrix. The n the matrix AD is obtainedfrom A by multiplying the ith column by difori = 1, 2, . . . , n:A = (w1, w2, . . . , wn)=⇒ AD = (d1w1, d2w2, . . . , dnwn)Identity matrixDefinition. The identity matrix (or unit matrix) isa diagonal matrix with all diagonal entries equal to 1.The n×n identity matrix is denoted Inor simply I .I1= (1), I2=1 00 1, I3=1 0 00 1 00 0 1.In general, I =1 0 . . . 00 1 . . . 0............0 0 . . . 1.Theorem. Let A be an arbitrary m×n matrix.Then ImA = AIn= A.Inverse matrixLet Mn(R) denote the set of all n×n matrices withreal entries. We can add, subtract, and multiplyelements of Mn(R). What about division?Definition. Let A be an n×n matrix. Supposethere exists an n×n matrix B such thatAB = BA = In.Then the matrix A is called invertible and B iscalled the inverse of A (denoted A−1).A non-invertible square matrix is called singular.AA−1= A−1A = IExamplesA =1 10 1, B =1 −10 1, C =−1 00 1.AB =1 10 11 −10 1=1 00 1,BA =1 −10 11 10 1=1 00 1,C2=−1 00 1−1 00 1=1 00 1.Thus A−1= B, B−1= A, and C−1= C .Inverting diagonal matricesTheorem A diagonal matrix D = diag(d1, . . . , dn)is invertible if and only if all diagonal entries arenonzero: di6= 0 for
View Full Document