Math1300:MainPage/Matrices Contents • 1 Matrices and Matrix Operations ♦ 1.1 Size ♦ 1.2 Equality ♦ 1.3 Addition and Subtraction of Matrices ♦ 1.4 Scalar Multiplication ♦ 1.5 Matrix Multiplication ♦ 1.6 Transpose, Trace and Diagonal ◊ 1.6.1 Theorem (Properties of the Transpose) ♦ 1.7 Linear Combinations of Columns ♦ 1.8 Linear Combinations, Systems of Linear Equations and Matrix Multiplication ♦ 1.9 Properties of Matrix Arithmetic ◊ 1.9.1 Theorem (Properties of Addition and Scalar Multiplication) ◊ 1.9.2 Theorem (Properties of Matrix Multiplication) ♦ 1.10 The zero matrix and the identity matrix In ◊ 1.10.1 Theorem (Properties of the Zero Matrix) ◊ 1.10.2 Theorem (Properties of the Identity Matrix) ♦ 1.11 Solving the Matrix Equation AX=B Matrices and Matrix Operations Size An m by n matrix is a rectangular array of numbers with m rows and n columns. The numbers m and n define the size of the matrix. When it is desirable to emphasize the size of the matrix, the following notation is used: Such a matrix is called "m by n". This is written as An matrix is called square if m = n. To emphasize the size of a square matrix, a single subscript is used: Matrices and Matrix Operations 1 Math1300:MainPage/Matrices Equality Two matrices A = [ai,j] and B = [bi,j] are equal if they are the same size, say m by n, and a = b , for i,j and i,j Examples: 1. 2. (note that this is the same as four equations in two unknowns; they imply x = y = 1) Addition and Subtraction of Matrices For two matrices A = [ai,j] and B = [bi,j], addition is defined if and only if the matrices have the same size. In that case, we say that the matrix C = [ci,j] satisfies C = A + B if and only if ci,j = ai,j + bi,j Similarly, for two matrices A and B of the same size, C = A − B is defined by ci,j = ai,j − bi,j Example: If and then and In short, addition and subtraction of two matrices are carried out by adding or subtracting the corresponding positions within the matrices. Scalar Multiplication A scalar, in our context, is any real number. If A = [ai,j] is a matrix and r is a scalar, then the matrix C = rA is defined by ci,j = rai,j. Equality 2 Math1300:MainPage/Matrices Example: If and r = 2, then In short, the product rA is computed by multiplying every entry of A by r. Matrix Multiplication The definition of matrix multiplication is very different from that of addition and subtraction. Suppose we have two matrices A and B with respective sizes and The product of A and B is defined only if n = r, that is, the number of columns of A is equal to the number of rows of B. When this is the case, The matrix C = [ci,j] is defined in the following way: consider the entries in row i of the matrix A: and also the entries in column j of the matrix B: Then Notice that the assumption n = r implies that there is just the right number of entries in the rows of A and columns of B to allow ci,j to be defined. The number ci,j is also called the inner product of row i of A and column j of B. Notice that this definition implies that the size of the product is Examples: 1. Suppose and Then C = AB is defined and has size . . Here are the entries in C: In other words 2. Using A and B from the previous example, the matrix D = BA is also defined. In this case the product is of size In this case we have Note that Scalar Multiplication since the two matrices, in this case, have different size. 3 Math1300:MainPage/Matrices 3. Let and A as in the previous examples. Then 4. Let . Computing as in the last example, we have AI3 = A. Transpose, Trace and Diagonal Suppose that A is a square matrix. Then the diagonal elements are the ones joining the upper left and lower right entries of the matrix, that is, the entries of the form The trace is the sum of the diagonal entries. The transpose of A is the matrix AT obtained by making the first row of A the first column of AT, the second row of A the second column of AT, etc. Another way of saying this is that AT = [aj,i]. Examples: 1. Let Then The diagonal elements of A are 1, 5, and 9, while the trace of A is 1 + 5 + 9 = 15. 2. The identity matrix In of order n has all diagonal entries equal to one and all other entries equal to zero. if A is an matrix, then ImA = A = AIn. 3. The transpose is defined for nonsquare matrices, too. Let Matrix Multiplication 4 Math1300:MainPage/Matrices Then Theorem (Properties of the Transpose) For matrices A and B of the right size and r a scalar, • (AT)T = A • (A + B)T = AT + BT • (rA)T = rAT • (AB)T = BTAT Linear Combinations of Columns Given a matrix , the columns of the matrix may be considered as In other words matrices themselves. Call these column matrices A linear combination of columns is a matrix of the form where are scalars. Example: Let Transpose, Trace and Diagonal 5 Math1300:MainPage/Matrices then If c1 = 1,c2 = 2 and c3 = 3, then and we say that is a linear combination of the columns of A. Notice that and, in general, for any choice of c1,c2,c3 we have This illustrates an important principle that is valid for any matrix: B is linear combination of the columns of a matrix A if and only if Interesting additional note to the example: suppose we want to know if columns of is a linear combination of the . In other words, can we find numbers c ,c ,c so that Linear Combinations of Columns 1 2 3 6 Math1300:MainPage/Matrices Notice that this is the same as solving the system of linear equations: so we are just solving three equations in three unknowns. The augmented matrix of this system of equations is whose reduced row echelon form is The last row says that there is no solution, so is not a linear combination of the columns of A. Now suppose we ask if is a linear combination of the columns of the same matrix A. The augmented matrix of the system of linear equations which has an augmented matrix Linear Combinations of Columns 7 Math1300:MainPage/Matrices whose reduced row echelon form is Hence we have a solution (in fact, an infinite number of them) so that columns of A. is a linear combination of the Linear Combinations, Systems of Linear Equations and Matrix Multiplication We have been representing a system of m linear equations in n unknowns as If A is the coefficient matrix, then these equations may be written in a matrix form: We will usually write this equation as where and . We make two easy but important observations: Linear Combinations, Systems of Linear Equations and Matrix Multiplication 8 Math1300:MainPage/Matrices 1. if 2. and has a solution if and only if are the columns of A, then . is a linear combination of the . Properties of Matrix Arithmetic The following theorem proves five additive and five multiplicative properties of matrix addition and scalar multiplication Theorem (Properties of Addition and Scalar Multiplication) Let A,B and C be matrices, r and s be scalars. Then A1: A + B is a matrix A2: (A + B) + C = A + (B + C) M1: rA is a matrix M2: r(A + B) = rA + rB A3: There exists a matrix M3: (r + s)A = rA + sA so that A4: For every matrix A there exists a matrix − A so that A5: A + B = B + A Proofs: The proofs are based on the following known properties of real numbers: M4: (rs)A = r(sA) M5: 1A = A • r + (s + t) = (r + s) + t (associative law of addition) • r + s = s + r (commutative law of addition) • r(st) = (rs)t (associative law of multiplication) • rs = sr (commutative law of multiplication) • r(s + t) = rs + rt (distributive law) • r + 0 = r (0 is the additive identity) • 1r = r (1 is the multiplicative identity) Click on each statement to see its proof. Theorem (Properties of Matrix Multiplication) Let A, B and C be matrices of the right size for matrix multiplication. Then • A(B + C) = AB + AC • (B + C)A = BA + CA • A(BC) = (AB)C Properties of Matrix Arithmetic 9 Math1300:MainPage/Matrices The zero matrix The zero matrix properties: and the identity matrix In is the matrix with z = 0 for all i and j. It satisfies the following i,j Theorem (Properties of the Zero Matrix) Suppose that A and are of appropriate sizes in each case. Then • • • • The identity matrix I = [a ] is the (square) matrix where Theorem (Properties ofi,j the Identity Matrix) n Suppose that A is an matrix. Then ImA = A = AIn. Solving the Matrix Equation AX=B Suppose that A is an matrix and B is an definition of matrix multiplication, X must be of size then we have matrix. We want find a matrix X so that AX = B. By the Specifically, if A = [ai,j], X = [xi,j] and B = [bi,j], If we look at the i-j entry on both sides of the equation, we get If we keep j fixed and let i range from 1 to m, we get a system of linear equations The zero matrix and the identity matrix In 10 Math1300:MainPage/Matrices We can solve this system by finding the reduced row echelon form of the augmented matrix. Here's the beautiful part: the n different systems of linear equations that arise as j takes on the values from 1 to n all have the identical coefficient matrix. This means that the same sequence of elementary row operations may be used on each of the equations to find the solutions. Examples: 1. Let and . The X must be a matrix so that Solving for the first column means finding the reduced row echelon form of which is so that , ,x =s Solving for the second3,1column means finding the reduced row echelon form of which is Hence we conclude that so that x = − 1 + t, x 1,2 2,2 = 1 − 2t, x =t 3,2 is a solution of the matrix equation AX = B for any choice of s and t. Notice how similar are the two matrices to be put into reduced row echelon form. They differ, of course, only in the last column. In fact, this means that exactly the same elementary row operations were used to put both matrices into reduced row echelon form. Since both computations used the same coefficient matrix, we could have carried out both computations at once by starting with the matrix and obtaining for the reduced row echelon form. 2. An even more striking example can be obtained when there are no free variables. Let Solving the Matrix Equation AX=B 11 Math1300:MainPage/Matrices and so that X is Then the augmented matrix has reduced row echelon form From the first column of B we get x1,1 = − 1, x2,1 = 5 and x3,1 = − 1. From the second column of B we get x1,2 = − 1, x2,2 = 5 and x3,2 = − 1. From the third column of B we get x1,3 = − 2, x2,3 = 7 and x3,3 = 1. So . Notice that X is the right half of the reduced row echelon form, and note that it follows directly from the identity matrix in the left half of the same matrix. 3. If A and B are both square matrices, and the reduced row echelon form of A is In, then the reduced row echelon form of [A | B] is [In | X] where X satisfies AX = B. Solving the Matrix Equation AX=B 12