Matrices In this chapter: matrices, determinants inverse matrix 1
1.1 Matrices A matrix is a retangular array of numbers. Rows: horizontal lines. A = a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 a 41 a 42 a 4, Columns: vertical lines. 2
In the example aboe the matrix has 4 rows and 3 columns. The elements of the matrix are numbers denoted by: i = row. j = column. Most often the matrix with elements a ij is denoted a ij. A = ( a ij ) i=1,...,n j=1,...,m The elements a ii form the diagonal (from the upper left to the lower right hand corner). of A. 3
We say that a matrix is of size n m if the matrix have n rows and m columns, and in this case the matrix belong to the set M n m of matrices of size n m. When n = m, the matrix is square. The square matrix 1 0... n) 0 0 1... 0. n)..... 0 0... 1 is the identity matrix of size n and it is denoted I n. 4
Definition. Given a matrix A = a 11 a 12 a 1m a 21 a 22 a 2m...... a n1 a n2 a nm M n m we call transpose matrix A t M m n (or A ) of A, to the matrix which row i is equal to the column i of A, for every i. That is, A t = A = a 11 a 21 a n1 a 12 a 22 a n2...... a 1m a 2m a nm M m n Hence, the transpose matrix of A is the result of the exchange of rows and columns in A. 5
Definition. Given the square matrix A = a 11 a 12 a 1n a 21 a 22 a 2n...... a n1 a n2 a nn M n n the trace of A is the sum of the elements of the diagonal trace(a) = a 11 + a 22 + + a nn 6
1.1.1 Sum and product by scalars Equal sized matrices can be summed. The sum of two n m matrices is the n m matrix whose row vectors are the sums of the corresponding row vectors of the original matrices. Thus, if A = ( a i,j ) i=1,...,n j=1,...,m and B = ( b i,j ) i=1,...,n j=1,...,m, then A + B = ( a i,j + b i,j ) i=1,...,n j=1,...,m 7
Example. A + B = A = ( 2 1 3 9 6 5 ) B = ( 1 4 0 5 2 3 ( 2 + 1 1 + 4 3 + 0 9 + 5 6 + ( 2) 5 + ( 3) ) = ) ( 3 5 3 14 4 2 ) 8
Product by scalars (real numbers). A = ( a i,j ) i=1,...,n j=1,...,m λ R The product of a matrix by an scalar is defined to be the matrix in which each element is multiplied by that scalar λa = ( λa i,j ) i=1,...,n j=1,...,m 9
Example. Let λ be an arbitrary number and A be the matrix ( ) 2 1 3 A = 9 6 5. Then λa = With λ = 7 we get ( 7 2 7 1 7 3 7A = 7 9 7 6 7 5 ( λ 2 λ 1 λ 3 λ 9 λ 6 λ 5 ) = ) ( 14 7 21 63 42 35 ) 10
Properties. Let A, B and C be matrices of the same size and let α and β be arbitrary real numbers: 1. A + B = B + A (commutative law). 2. A + (B + C) = (A + B) + C (associative law). 3. α(a + B) = αa + αb. 4. (α + β)a = αa + βa. 11
Product of matrices Let A = (a ij ) i=1,...n j=1,...,m be an n m matrix and B = (b ij) j=1...l an m p matrix 1=1...m be The number of columns of A has to be the same as the number of rows of B. The product C = A B is an n p matrix whose element in the ith row and jth row column is the the scalar product of the ith row vector of the first matrix and the jth column vector of the second matrix. Thus, c ij = a i1 b 1j + a i2 b 2j + + a im b mj 12
Example. Consider the matrices A = ( 2 1 5 3 0 2 ) B = 1 6 7 4 8 0 Matrix C = A B is 2 2 given by ( 49 2= 2 6 + 1 ( 4) + 5 0 C = 13 18 ) 13
Warning. The product of matrices is not commutative. To illustrate this, let us consider ( ) 2 1 A = B = 3 1 ( 1 2 5 1 4 4 We can compute A B but B A is no sense. ) 14
IMPORTANT the product of any matrix of M n n by the identity matrix I n gives the original matrix. EXAMPLE: ( 10 23 21 11 ) ( 1 0 0 1 ) = ( 10 23 21 11 ) 15
Determinants To any square matrix can be associated a real number called the determinant of the matrix. We try here an inductive definition. If A = (a) is a 1 1 matrix, that is, with only 1 row and 1 column, then the determinant of A is det(a) = a. If A is a 2 2 matrix, then the determinant is det(a) = a b c d = ad cb 16
If A is a 3 3 matrix, we candefine the determinant in two alternative ways: 1. Sarrus rule: a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 = a 11 a 22 a 33 +a 12 a 23 a 31 +a 13 a 21 a 32 a 31 a 22 a 13 a 32 a 23 a 11 a 33 a 21 a 12 2. Expanding by a row or a column: a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 = a 11 a 22 a 23 a 32 a 33 a 12 a 12 a 13 a 32 a 33 +a 13 a 22 a 23 a 32 a 33 17
It is not needed to expand by the first row or column. One can expand by an arbitrary line. Notice that the sign of the element a i,j is ( 1) i+j. Example. Compute the determinant 1 2 1 4 3 5 3 1 3 = ( 1) 1+2 2 + ( 1) 2+3 1 4 5 3 3 1 1 4 5 + ( 1)2+2 3 1 1 3 3 = 2 ( 3) + 3 (0) (1) 1 = 5 18
For matrices of size > 3 the method is the same: Expand the matrix by a row or a column (preferably the one with more zeroes). In this way, a determinant of order 4 is reduced to compute four determinants of order 3. For a matrix A = (a ij ) of order n, the minor of the element a ij is the n 1 order determinant of the submatrix of A obtained by striking out the ith row and the jth column of the matrix A. The adjoint of the element a ij of matrix A is the minor of a ij multiplied by ( 1) i+j, and its value is denoted by A ij. 19
With this notation, the determinant is A = a i1 A i1 + a i2 A i2 + + a ij A ij when expanded by row i, or A = a 1j A 1j + a 2j A 2j + + a ij A ij when we use column j. 20
Example. Find the determinant 1 2 0 3 4 7 1 1 1 3 3 1 0 2 0 7 We want to expand by row 4 or by column 3 (two zeroes). In the latter case we get 21
1 2 0 3 4 7 2 1 1 3 3 1 0 2 0 7 = 0 4 7 1 1 3 1 0 2 7 + ( 1) 3+3 3 + ( 1) 3+2 2 1 2 3 4 7 1 0 2 7 + 0 1 2 3 1 3 1 0 2 7 1 2 3 4 7 1 1 3 1 22
Properties. Elementary operations 1. If the rows and columns are interchanged in a determinant, the value of the determinant is unchanged. 2. If in a determinant two rows (or columns) are interchanged, the value of the determinant is changed in sign. 3. If two rows (columns) in a determinant are identical, the value of the determinant is zero. 4. If all the entries in a row (column) of a determinant are multiplied by a constant k, then the value of the determinant is also multiplied by this constant. 23
5. In a given determinant, a constant multiple of the elements in one row (column) may be added to the elements of another row (column) without changing the value of the determinant. Definition. Given a matrix A, any matrix B obtained from A by means of elementary operations on rows and columns is called equivalent to A, Property. Let A and B square matrices of the same size. Then det(a B) = det(a) det(b) 24
Example. Consider the determinant 1 2 3 3 2 3 5 1 3 1 4 2 2 5 5 1 = 1 2 3 3 0 1 1 7 0 5 8 10 0 1 1 7 = 1 1 7 5 8 10 1 1 7 = 1 1 7 5 8 10 1 1 7 = 1 1 7 5 8 10 1 1 7 = 1 1 7 0 3 25 0 2 0 = 50 25
Rank of a matrix The rank of an n m matrix A is the number of lines not identically null in the echelon matrix associated (the echelon matrix is obtained applying Gauss method). Example. Consider the matrix: A = 0 3 2 5 7 1 7 2 4 3 0 0 0 1 3 0 0 0 0 0 0 5 0 4 7 hence, the rank of A is 4. 1 7 2 4 3 0 3 2 5 7 0 0 10 13 14 0 0 0 1 3 0 0 0 0 0 26
An alternative definition of rank: Property. The rank of a matrix A is the order of the largest determinant different from zero that can be obtained from A by deleting rows and columns. 27
Example. Consider the matrix ( 1 2 5 2 4 9 The rank of this matrix is 2 at most. give no information 1 5 2 9 1 2 2 4 Hence, the matrix has rank 2. ) = 0 = 1 0 28
Consider now ( 1 2 5 2 4 10 ) 1 2 2 4 = 0, 1 5 2 10 = 0, 2 5 4 10 = 0 The rank is 1. 29
Warning. The rank of two equivalent matrices is the same! 30
Inverse Matrix We say that the matrix A of order n has an inverse if there exists a matrix of order n, A 1, such that A A 1 = A 1 A = I n. 31
Property. A square matrix A of order n has an inverse if and only if its determinant is 0. Equivalently, A has an inverse if and only if its rank is n. Property. If A admits inverse, then det(a 1 ) = 1 det(a). Property. Let A and B be matrices of order n. A B y B A have inverse if and only if both A and B have inverse. Moreover, (A B) 1 = B 1 A 1 (B A) 1 = A 1 B 1 32
Finding the inverse matrix with Gauss method Let the matrix A = and consider the new matrix a 11 a 12... a 1n a 21 a 22... a 2n...... a n1 a n2... a nn a 11 a 12... a 1n 1 0... 0 a 21 a 22... a 2n 0 1... 0............ a n1 a n2... a nn 0 0... 1 33
To this matrix we apply elementary transformations until the identity matrix appears in the left box. 1 0... 0 b 11 b 12... b 1n 0 1... 0 b 21 b 22... b 2n............ 0 0... 1 b n1 b n2... b nn The matrix that appears at the right box is the inverse matrix of A. 34
Example. Consider the matrix and the augmented matrix: 1 1 0 0 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 1 35
By elementary operations we get (f 3 f 1 ) (f 3 + f 2 ) 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 0 0 2 1 1 1 Notice that the rank of A is 3, hence it is invertible. 36
Dividing by 2 (2f 2 f 3 ) (2f 1 f 2 ) Finally, the inverse matrix is 1 1 0 1 0 0 0 2 0 1 1 1 0 0 2 1 1 1 2 0 0 1 1 1 0 2 0 1 1 1 0 0 2 1 1 1 1 0 0 1/2 1/2 1/2 0 1 0 1/2 1/2 1/2 0 0 1 1/2 1/2 1/2 A 1 = 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 37