Chapter 3 Matrices 3. Definitions and Notations Matrices are yet another mathematical object. Learning about matrices means learning what they are, how they are represented, the types of operations which can be performed on them, their properties and finally their applications. Definition 33 (matrix). A matrix is a rectangular array of numbers. in which not only the value of the number is important but also its position in the array. 2. The size of the matrix is described by the number of its rows and columns (always in this order). An m n matrix is a matrix which has m rows and n columns. 3. The elements (or the entries) of a matrix are generally enclosed in brackets, double-subscripting is used to index the elements. The first subscript always denote the row position, the second denotes the column position. For example A = a a 2... a n a 2 a 22... a 2n........................ a m a m2... a mn (3.) = [a ij ], i =, 2,..., m, j =, 2,...,n (3.2) Enclosing the general element a ij representing a matrix A. in square brackets is another way of. When m = n, the matrix is said to be a square matrix. 5. The main diagonal in a square matrix contains the elements a,a 22,a 33,... 9
20 CHAPTER 3. MATRICES 6. A matrix is said to be upper triangular if all its entries below the main diagonal are 0. 7. A matrix is said to be lower triangular if all its entries above the main diagonal are 0. 8. If all the entries of a square matrix are zero, except those entries on the main diagonal, then we say the matrix is a diagonal matrix. 9. The n n identity matrix is an n n matrix having ones on the main diagonal, and zeroes everywhere else. It is usually denoted I n. We say that two matrices are equal whenever they have the same dimension, and their corresponding entries are equal. Definition 3 (row and column vectors) Vectors are special forms of matrices.. A row vector is a vector which has only one row. In other words, it is an n matrix. 2. A column vector is a vector which has only one column. In other words, it is an m matrix. Example 35 Here are some matrices. 2 5 2.5 is a 3 2 matrix. 0 2 3 2. 3 5 9 π is a square (3 3) matrix. 2 0 3. 0 0 0 0 is the 3 3 identity matrix. 0 0 3 5. 0 2 6 0 0 2 is a upper triangular matrix. 0 0 0 5 5. 2 3 0 is a column vector. It is also a matrix. 6. [ 5 0 2 ] is a row vector. It is also a 3 matrix.
3.2. OPERATIONS ON MATRICES 2 In the case of a vector, there is no need to use double subscripts. For example, instead of writing A = [ a a 2 a 3 a ], we write A = [ a a 2 a 3 a ]. In the special case that m = n =, the matrix is a matrix and may be written A =[a ]=[a] =a. In other words, subscripts are not needed. Since the matrix only has one entry, it is the same as a number (also called a scalar). Definition 36 (Transpose) Let A =[a ij ] beamatrix. ThetransposeofA, denoted A T = { a T ij} is defined by a T ij = a ji In other words, the transpose is obtained by switching the row and column position of each entry of A. Example 37 Here are some examples of matrices and their transpose.. 2. 2 3 5 6 7 8 9 2 3 5 6 T = T = 7 2 5 8 3 6 9 [ 3 5 2 6 Remark 38 Let us note the following: ]. When taking the transpose of a matrix, the main diagonal remains unchanged. 2. If A is m n, thena T is n m. 3. The transpose of a column vector is a row vector and vice-versa. Definition 39 Let A be an m n matrix, then:. A is symmetric if A t = A 2. A is skew-symmetric if A t = A 3.2 Operations on Matrices For each operation, we give the conditions under which the operation can be performed. We then explain how the operation is performed. For the remaining of this section, unless specified otherwise, we assume that A = [a ij ] B = [b ij ] C = [c ij ]
22 CHAPTER 3. MATRICES 3.2. Addition and Subtraction Only matrices having the same size can be added or subtracted. The resulting matrix has the same size. To add (subtract) two matrices having the same size, simply add (subtract) the corresponding entries. In other words, if C = A + B, then c ij = a ij + b ij. Same for subtraction. Example 0 Example of addition and subtraction of matrices.. 2. 3 2 5 + 0 5 2 3 2 = 5 6 6 3 3 2 3 2 2 2 Cannot be done, the matrices do not have the 5 6 3 3 3 same dimension. 3.2.2 Scalar Multiplication This is multiplication of a matrix by a number. This operation can always be done. The result is a matrix of the same size. Simply multiply each entry of the matrix by the number. Example Example of multiplication of a matrix by a scalar.. 0 2 = 0 8 3 0 2 0 [ ] [ ] a a 2. λ 2 λa λa = 2 a 2 a 22 λa 2 λa 22 3.2.3 Multiplication of a Row Vector by a Column Vector The row and column vector must have the same number of elements. This means that if the first vector has n entries (that is is a n matrix), then the second vector must also have n entries (that is must be a n matrix). Theresultisa matrix or a scalar.
3.2. OPERATIONS ON MATRICES 23 Suppose that A = [ a a 2... a n ] and B = b b 2 : b n. Then AB = a b + a 2 b 2 +...a n b n n = a i b i i= You will note that the result is a scalar. Example 2 [ 3 5 7 ] 2 5 =[ 2+3 +5 5+7 0] = 0 00 [ 3 5 ] 2 3 number of elements.. This cannot be done, the vectors do not have the same 3.2. Matrix Multiplication Let us assume that A is m p and B is q n. The product of A and B, denoted AB can be performed only if p = q. In other words, the number of columns of the first matrix, A must be the same as the number of rows of the second matrix, B. In the case p = q, then AB is a new matrix. Its size is m n. In summary, if we put next to each other the dimensions of the matrices we are trying to multiply, in this case m p and q n, then we see that we can do the multiplication if the inner numbers (p and q) are equal. The size is given by the outer numbers (m and n). Matrix multiplication is a little bit more complicated than the other operations. We explain it by showing how each entry of the resulting matrix is obtained. Let us assume that A =[a ij ] is m p and B =[b ij ] is p n. Let C =[c ij ]=AB. Then, C is a m n matrix. c ij is obtained by multiplying the i th row of A by the j th column of B. In other words, c ij = p a ik b kj, i =, 2,..., m, j =, 2,..., n k=
2 CHAPTER 3. MATRICES Remark 3 Because of the condition on the sizes of the matrices, one can see easily that matrix multiplication will not be commutative. For example, if A is 3 and B is 5 then one can compute AB. Itssizewillbe3 5. However, BA cannot be computed. Even in cases when both AB and BA can be computed, they are unlikely to be the same. For example 2 3 2 3 2 2 2 = 3 5 3 3 3 20 20 20 26 26 26 but 2 2 2 2 3 2 3 = 6 9 2 2 8 2 3 3 3 3 5 8 27 36 Example. 2 3 2 3 2 2 2 = 20 20 20 3 5 3 3 3 26 26 26 2. 2 3 3 2 9 3 7 3 2 = 0 0 0 0 3 6 7 0 0 3. 2 3 3 2 x x +2y +3z y = 3x +2y + z 3 6 z x +3y +6z. 2 3 2 3 2 2 2 3 3 3 cannot be done (why?) 3 5 5. 2 3 2 3 0 0 0 0 = 2 3 2 3. In fact if A is m n, then 3 5 0 0 3 5 AI n = A 3.2.5 Multiplicative Inverse of a Matrix Definition 5 Let A be an n n matrix. If there exists a matrix B, alson n such that AB = BA = I n then B is called the multiplicative inverse of A. The multiplicative inverse of a matrix A is usually denoted A. Its is important to note that we only talk about inverses for square matrices. However, not every square matrix has an inverse.
3.2. OPERATIONS ON MATRICES 25 Proposition 6 If a matrix A has an inverse, then it is unique. Example 7 The inverse of 2 3 9 3 3 2 is 7 3 2, to check this, 3 6 7 we compute 2 3 9 3 3 2 7 3 2 = 0 0 0 0 3 6 0 0 and 9 7 7 3 3 2 7 2 3 3 2 = 0 0 0 0 3 6 0 0 3.2.6 Properties Having defined matrices, and some of the operations which can be performed on them, it is important to know the properties of each operation so we know how to manipulate matrices with these operations. Proposition 8 Suppose that A is m n. Then, AI n = A and I m A = A You will note that a different identity matrix was used (why?). Proposition 9 The set of m n matrices with real coefficients together with addition is an Abelian (commutative) group. That is, addition satisfies the following properties:. Addition is commutative that is A + B = B + A for any two matrices A and B in the set. 2. Addition is associative that is A+(B + C) =(A + B)+C for any matrices A, B, C in the set. 3. There exists an additive identity matrix, the m n matrix whose entries are all 0 s.. Each matrix has an additive inverse. The additive inverse of A is A. Remark 50 Properties 2- are the properties of a group. Proposition 5 The set of m n matrices with real coefficients together with scalar multiplication satisfies the following properties:
26 CHAPTER 3. MATRICES. A = A =A for every matrix A in the set. 2. (c c 2 ) A = c (c 2 A) for every scalar c,c 2 and every matrix A in the set. 3. c (A + B) =ca + cb for every scalar c and every matrix A and B in the set.. (c + c 2 ) A = c A + c 2 A for every scalar c,c 2 and every matrix A in the set. Proposition 52 Propositions 9 and 5 imply that the set of m n matrices with real coefficients together with addition and scalar multiplication is a vector space. Proposition 53 Let A and B be two matrices. The following is true:. (AB) T = B T A T 2. If both A and B are invertible and have the same dimension, then AB is also invertible and (AB) = B A. 3. A is invertible if and only A T is invertible and ( A T ) = ( A ) T. 3.2.7 Matrix Equations As mathematical objects, matrices can appear in equations the same way numbers do. Equations involving matrices are solved in a similar way. In this section, we only look at equations of the form Ax = b where A is n n, x is n and b is n. Solving the equation means finding x such that the equation is satisfied. When solving matrix equations, the following operations are permitted:. Add the same matrix on each side of the equation. 2. Multiply each side of the equation by the same non-zero scalar. 3. Multiply each side of the equation by the same non-zero matrix. Let us assume for now that A has an inverse. Then, to solve Ax = b, we proceed as follows: Ax = b A Ax = A b (multiply each side by the same matrix) I n x = A b (use the fact that A A = I n ) x = A b (property of the identity matrix)
3.3. DETERMINANT 27 3.3 Determinant The determinant of a square matrix is a scalar quantity derived from the entries of the matrix. The determinant of a matrix M is denoted det (M) or M. Itis defined recursively, that is the formula to compute the determinant of an n n matrix is given in terms of the determinant of several n n matrices. There is a specific formula for 2 2 matrices. We begin with preliminary definitions. Definition 5 (Minor) Let M be an n n matrix. The minor associated with the i th row and j th column of M, denoted M ij is the n n matrix obtained by deleting the i th row and j th column of M. Example 55 If M = a b c [ ] d e f d f then M 2 =.Notethatwehave g i g h i deleted the first row of M and its second column. Definition 56 (Determinant) We are now ready to give the recursive definition of the determinant.. The determinant of a 2 2 matrix is a b c d = ad bc. 2. Let M =[M ij ] be an n n matrix and let M ij denote the minors of M. Then the determinant of M is given by the two formulas below: M = = n ( ) i+k M ik M ik i= n ( ) k+j M kj M kj j= where k is an arbitrary integer such that k n. Remark 57 The two formulas give the same answer, regardless of the value of k. In the first formula, we use all the minors along the k th column whereas inthesecond,weusetheminorsalongthek th row. Usually, what determines whether we use the first or the second formula and for what value of k is the entries in the matrix. If M has a row with a lot of zero entries, then we want to use the second formula, with k corresponding to the row having a lot of zero entries. Similarly, if M has a column with a lot of zero entries, we will use the first formula. Example 58 a a 2 a 3 a 2 a 22 a 23 a 3 a 32 a 33 a = a 22 a 23 a 32 a 33 a 2 a 2 a 23 a 3 a 33 + a 3 a 2 a 22 a 3 a 32 = a 3 (a 2 a 32 a 22 a 3 ) a 2 (a 2 a 33 a 3 a 23 )+a (a 22 a 33 a 23 a 32 )
28 CHAPTER 3. MATRICES Proposition 59 The determinant of a matrix satisfies the properties below, where M and N denote two n n matrices.. MN = M N 2. Exchanging two rows or two columns in a matrix negates its determinant. 3. Multiplying a row or a column of a matrix by a scalar multiplies the determinant by the scalar.. cm = c n M where c is a scalar. 5. The determinant of a matrix having two identical rows or columns is zero. 6. M is invertible if and only if M 0. 7. M T = M