SMA 214 Math 3 Lecture Notes PDF
Document Details
SMA
Dr. Moataz Mostafa Elkhateeb, Dr. Mohamed Abo Shady, Dr. Mostafa Ramadan
Tags
Summary
These lecture notes cover various topics related to matrices and linear algebra. The document includes examples of fundamental matrix operations and the importance of matrices in different fields of computer science. The notes are suitable for undergraduate-level linear algebra courses.
Full Transcript
SMA 214 Math 3 1- Operations on Matrices 5- Linear Independency 2- Row Echelon Form 6- Bases of Vector Spaces 3- System of Linear Equations 7- Linear Transformations 4- Cramer’s Rule 8...
SMA 214 Math 3 1- Operations on Matrices 5- Linear Independency 2- Row Echelon Form 6- Bases of Vector Spaces 3- System of Linear Equations 7- Linear Transformations 4- Cramer’s Rule 8- Eigenvalues and Eigenvectors Dr. Moataz Mostafa Elkhateeb MIDTERM EXAM: 25% Dr. Mohamed Abo Shady Quizzes: 25% Dr. Mostafa Ramadan FINAL EXAM: 50% CHAPTER 1 Some Topics of Linear Algebra Idea Many difficult problems can be handled easily once relevant information is organized in a certain way. This text aims to teach you how to organize information in cases where certain mathematical structures are present. Linear algebra is, in general, the study of those structures. Namely Linear algebra is the study of vectors and linear functions. 1- Matrices and Determinants A matrix is a rectangular array of numbers enclosed by a pair of bracket. 1 3 1 2 3 7 A = B = 2 1 4 1 - 1 5 4 7 6 Both A and B are examples of matrix. Why matrix? Consider the following set of equations: x y 7, 3 x y 5. It is easy to show that x = 3 and y = 4. x y 2 z 7, 2 x y 4 z 2, How about solving 5 x 4 y 10 z 1, 3 x y 6 z 5. Matrices can help… a 11 a 12 … a 1n a a2 2 … a 2 n In the matrix A = 21 am 1 am 2 … am n numbers aij are called elements (or entries). First subscript indicates the row; Second subscript indicates the column. The matrix consists of mn elements It is called “the m n matrix A = [aij]” or simply “the matrix A ” if number of rows and columns are understood. Importance of Matrices in Computer Science Matrices play a critical role in various areas of computer science, including: 1. Computer Graphics In computer graphics, matrices are used for transformations such as scaling, rotating, and translating objects in space. 2. Machine Learning Matrices are foundational in machine learning, where they represent datasets and models. Operations like matrix multiplication are crucial for algorithms such as neural networks. 3. Data Analysis Matrices are used to represent and manipulate large datasets in data analysis, enabling efficient computations and transformations. 4. Algorithms and Complexity Many algorithms, particularly those involving graphs and networks, utilize matrices to represent relationships and structures, aiding in the analysis of their complexity. 2. Square matrices When m = n, i.e., a11 a12 a1n a a22 a2 n A 21 an1 an 2 ann A is called a “square matrix of order n” or “n-square matrix” elements a11, a22, a33,…, ann called diagonal elements. n a ii = a 11 + a 2 2 is + a nn the trace of A. +...called i=1 3. Equal matrices Two matrices A = [aij] and B = [bij] are said to be equal (A = B) iff each element of A is equal to the corresponding element of B, i.e., aij = bij for 1 i m, 1 j n. iff pronouns “if and only if” if A = B, it implies aij = bij for 1 i m, 1 j n; if aij = bij for 1 i m, 1 j n, it implies A = B. Example: 1 and 0 a b A B 4 2 c d Given that A = B, find a, b, c and d. if A = B, then a = 1, b = 0, c = -4 and d = 2. Zero matrices Every element of a matrix is zero, it is called a zero matrix, which denoted by O, i.e., 4. Operations of matrices Sums of matrices If A = [aij] and B = [bij] are m n matrices, then A + B is defined as a matrix C = A B, where C= [cij], cij = aij bij for 1 i m, 1 j n. 1 2 3 2 3 0 Example: if A and 4 B 5 0 1 1 2 Evaluate A + B and A – B. 1 2 23 3 0 3 5 3 A B 0 ( 1) 1 2 4 5 1 3 9 1 2 2 3 3 0 1 1 3 A B 0 ( 1) 1 2 4 5 1 1 1 Two matrices of the same order are said to be conformable for addition or subtraction. Two matrices of different orders cannot be added or subtracted, e.g., 1 3 1 2 3 7 2 1 4 1 1 5 4 7 6 are NOT conformable for addition or subtraction. 5. Scalar multiplication Let l be any scalar and A = [aij] is an m n matrix. Then lA = [laij] for 1 i m, 1 j n, i.e., each element in A is multiplied by l. 1 2 3 Example: Evaluate 3A, where A 0 1 4 3 1 3 2 3 3 3 6 9 3 A 3 0 3 1 3 4 0 3 12 In particular, l = -1, i.e., -A = [-aij]. It’s called the negative of A. Note: A - A = 0 is a zero matrix Properties Matrices A, B and C are conformable, A + B = B + A (commutative law) A + (B +C) = (A + B) +C (associative law) l(A + B) = lA + lB, where l is a scalar (distributive law) A + O = A + O = A (O is an identity additionn) Can you prove them? Properties Example: Prove l(A + B) = lA + lB. Proof Let C = A + B, so cij = aij + bij. Consider lcij = l (aij + bij ) = laij + lbij, we have, lC = lA + lB. Since lC = l(A + B), so l(A + B) = lA + lB ∴ Ex: 2 0 4 2 A , B , 3 4 1 3 7 2 0 4 2 2 0 4 2 3( A B ) 3 3 3 4 1 3 7 4 1 3 7 2 0 4 2 3 A 3B 3 3 4 1 3 7 3( A B) 3 A 3B A+O= A+O=A 6. Matrix multiplication If A = [aij] is a m p matrix and B = [bij] is a p n matrix, then AB is defined as a m n matrix C = AB, where C= [cij] with p cij aik bkj ai1b1 j ai 2b2 j ... aipb pj for 1 i m, 1 j n. k 1 1 2 Example: 1, 2 3 2 and B C = AB 3 . Evaluate c. A 21 0 1 4 5 0 1 2 1 2 3 0 2 3 c21 0 ( 1) 12 4 5 22 1 4 5 0 1 2 1 2 3 2 3 Example: C = AB. A , B ,Evaluate 0 1 4 5 0 c11 1 ( 1) 2 2 3 5 18 1 2 c 1 2 2 3 3 0 8 1 2 3 2 0 3 12 1 4 5 0 c21 0 ( 1) 1 2 4 5 22 c22 0 2 1 3 4 0 3 1 2 1 2 3 18 8 C AB 2 3 22 3 0 1 4 5 0 Note that: The product BA is not defined because the number of columns of B is not equal to the number of rows A software system requires three key components: libraries, frameworks, and utilities. Different types of applications require different quantities of these components for compilation. In particular, A is a 1 m matrix (called Row matrix) and B is a m 1 matrix (called Column matrix), i.e., b11 b A a11 a12... a1m B 21 bm1 then C = AB is a scalar. m C a1k bk 1 a11b11 a12b21 ... a1mbm1 k 1 BUT BA is a m m matrix! b11 b11 a11 b11 a12 b11 a1 m b b a b21 a12 b21 a1 m BA 21 a11 a12... a1m 21 11 b m1 bm1 a11 bm1 a12 bm1 a1m So AB BA in general ! Properties Matrices A, B and C are conformable, A(B + C) = AB + AC (A + B)C = AC + BC A(BC) = (AB) C AB BA in general Howev AB = 0 NOT necessarily imply A = 0 or B = 0 er AB = AC NOT necessarily imply B = C Example: Prove A(B + C) = AB + AC where A, B and C are n-square matrices Proof Let X = B + C, so xij = bij + cij. Let Y = AX, then n n yij aik xkj aik (bkj ckj ) k 1 k 1 n n n ( aik bkj aik ckj ) aik bkj aik ckj k 1 k 1 k 1 So Y = AB + AC; therefore, A(B + C) = AB + AC