Revision Lecture on Linear Algebra PDF
Document Details
Uploaded by HumourousLanthanum
Faculty of Computer Science and Information Technology
Dr. Moataz Mostafa Elkhateeb
Tags
Summary
This document is a revision lecture on linear algebra, covering topics such as matrices, their properties, inverses, and solving systems of linear equations.
Full Transcript
Revision Lecture on Linear Algebra Dr. Moataz Mostafa Elkhateeb Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 1 / 23 Introduction to Matrices A matrix is a rectangular array of numbers arranged in rows and columns. Matrices...
Revision Lecture on Linear Algebra Dr. Moataz Mostafa Elkhateeb Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 1 / 23 Introduction to Matrices A matrix is a rectangular array of numbers arranged in rows and columns. Matrices can represent linear transformations and systems of linear equations. Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 2 / 23 Square Matrix Definition: A matrix is called square if it has the same number of rows and columns, i.e., n × n. Example: " # 2 3 1 4 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 3 / 23 Lower Triangular Matrix Definition: A square matrix where all entries above the diagonal are zero. Example: 4 0 0 2 3 0 1 −1 5 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 4 / 23 Upper Triangular Matrix Definition: A square matrix where all entries below the diagonal are zero. Example: 3 5 2 0 4 −1 0 0 6 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 5 / 23 Diagonal Matrix Definition: A matrix with all non-diagonal elements equal to zero. Example: 5 0 0 0 8 0 0 0 3 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 6 / 23 Identity Matrix Definition: A diagonal matrix where all diagonal entries are 1. It acts as a multiplicative identity in matrix operations. Example: 1 0 0 0 1 0 0 0 1 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 7 / 23 Transpose of a Matrix Definition: The transpose of a matrix A, denoted AT , is obtained by swapping rows and columns. Example: " # " # 1 2 T1 3 A= , A = 3 4 2 4 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 8 / 23 Orthogonal Matrix Definition: A matrix Q is orthogonal if QQ T = I. Example: " # 0 −1 Q= 1 0 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 9 / 23 Symmetric and Skew-Symmetric Matrices Symmetric Matrix: A = AT. Skew-Symmetric Matrix: A = −AT. Example: " # " # 2 1 0 2 Symmetric: , Skew-Symmetric: 1 3 −2 0 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 10 / 23 Product of Matrices Definition: The product of matrices A and B is defined if the number of columns of A equals the number of rows of B. Example: " # " # " # 1 2 2 0 4 2 A= , B= , AB = 3 4 1 1 10 4 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 11 / 23 Properties of the Inverse If A and B are invertible matrices, then: (AB)−1 = B −1 A−1 (cA−1 ) = c1 A−1 (A−1 )−1 = A (AT )−1 = (A−1 )T Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 12 / 23 Finding the Inverse of a 2 × 2 Matrix " # a b For a matrix A = : c d 1 Compute the determinant: det(A) = ad − bc " # d −b 2 If det(A) ̸= 0, then A−1 = 1 det(A) −c a ! 4 7 Given the matrix A = , 2 6 det(A) = (4)(6) − (7)(2) = 24 − 14 = 10 ̸= 0 ! ! −1 1 6 −7 0.6 −0.7 A = = 10 −2 4 −0.2 0.4 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 13 / 23 Inverse by Adjoint Method To find the inverse of a matrix A using the adjoint method, follow these steps: 1 Find the cofactor matrix of A: For each element aij in matrix A, calculate the cofactor Cij. The cofactor Cij is given by (−1)i+j · Mij , where Mij is the determinant of the submatrix formed by removing the i-th row and j-th column from A. Repeat this for each element in A to form the cofactor matrix cof(A). Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 14 / 23 2 Transpose the cofactor matrix to get the adjoint: Take the transpose of the cofactor matrix cof(A), which means swapping rows and columns. The resulting matrix is called the adjoint of A, denoted as adj(A). 3 Calculate the inverse: Compute the determinant of A, det(A). If det(A) ̸= 0, the inverse of A exists and is given by: 1 A−1 = adj(A) det(A) Multiply each entry of the adjoint adj(A) by 1 det(A) to obtain A−1. Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 15 / 23 Example: Finding the Inverse Using the Adjoint Method 2 −1 0 Consider the matrix A = 1 3 −1. 4 1 2 1 Find the cofactor matrix: ! ! 3 −1 1 −1 C11 = det = 7, C12 = − det = −6 1 2 4 2 ! ! 1 3 −1 0 C13 = det = −11 C21 = − det = 2, 4 1 1 2 ! ! 2 0 2 −1 C22 = det =4 C23 = − det = −6 4 2 4 1 ! ! −1 0 2 0 C31 = det = 1, C32 = − det =2 3 −1 1 −1 ! 2 −1 C33 = det =7 1 3 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 16 / 23 The cofactor matrix is: 7 −6 −11 cof(A) = 2 4 −6 1 2 7 Transpose the cofactor matrix: 7 2 1 adj(A) = −6 4 2 −11 −6 7 Calculate the inverse: det(A) = 2·(3·2−(−1)·1)−(−1)·(1·2−(−1)·4)+0·(1·1−3·4) = 28 7 2 1 7 2 1 1 286 28 28 A−1 = −6 4 2 = − 28 4 28 2 28 28 11 6 7 −11 −6 7 − 28 − 28 28 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 17 / 23 Conditions for a Matrix to be in Reduced Row Echelon Form (RREF) 3 2 Pivots must be 1: The elements on the leading diagonal (pivot elements) must be equal to 1. All other elements in the pivot’s column must be zero: All elements in the same column as the pivot (except the pivot itself) must be zero. If all elements below a 0 pivot are zeros: If a pivot element is 0 and has no non-zero elements below it, then the pivot must shift to the next column to the right. Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 18 / 23 Matrices in RREF Examples ! 1 0 A= 0 1 1 0 0 B = 0 1 3 0 0 0 1 1 0 C = 0 0 1 0 0 0 ! 1 0 4 D= 0 1 −3 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 19 / 23 Steps of Finding the Inverse using Reduced Row Echelon Form (RREF) 1 Set up the augmented matrix: Write A next to the identity matrix, forming [A|I]. 2 Identify the first pivot: Start with the leftmost column. The first non-zero entry in this column is the pivot. 3 Make the pivot 1: If the pivot is not 1, divide the entire row by the pivot’s value. If the pivot is 0, exchange with a lower row that has a non-zero entry in this column (if possible). 4 Clear the pivot column: Use row operations to make all other entries in the pivot’s column 0. For each row above and below the pivot row, subtract a suitable multiple of the pivot row. Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 20 / 23 5 Move to the next pivot: Shift to the next column and find the pivot entry in the next row. If the pivot entry is 0, exchange with a lower row that has a non-zero entry. If all entries below are 0, shift the pivot to the next column. 6 Repeat until the left block is the identity matrix: Continue the above steps for each row until A is transformed into I on the left side. 7 The right block is A−1 : When [A|I] becomes [I|A−1 ], the right side is the inverse of A. Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 21 / 23 Example: Finding the Inverse of a Matrix Using RREF ! 1 −1 1 0 3 −2 0 1 ! 1 −1 1 0 −3 · R1 + R2 : 0 1 −3 1 ! 1 0 −2 1 R2 + R1 : 0 1 −3 1 ! −1 −2 1 A = −3 1 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 22 / 23 Solving Systems of Linear Equations using Inverse To solve AX = B: 1 Find A−1. 2 Multiply both sides from left by A−1 : X = A−1 B. 3 Substitute A−1 and B to find X. ( x −y =5 3x − 2y = 7 ! ! ! −2 1 5 −3 X= = −3 1 7 −8 Dr. Moataz Mostafa Elkhateeb Revision Lecture on Linear Algebra 23 / 23