Matrix Algebra 1 Learning Objectives 1. Find the sum and difference of two matrices 2. Find scalar multiples of a matrix 3. Find the product of two matrices 4. Find the inverse of a matrix 5. Solve a system of linear equations using an inverse matrix 2 Size of Matrix The size of a matrix is m (the number of rows) by the n (the number of columns). If n = m we say it is a square matrix s 4 3 is 2 x 2 0 2 5 2 1 3 is 3x2 4 2 2 1 7 0 is 2 x 4 2 4 1 3 3 1
s 4 3 0 2 2 by 2 square matrix 3 2 a11 a12 a13 a21 a22 a23 a31 a32 a 33 2 by 1 matrix 3 by 3 square matrix 4 Special Matrices In the zero matrix all entries are zero 0 0 0 0 0 0 0 0 0 0 0 0 An identity matrix is square where the diagonal entries are one and all other entries are zero 1 0 I 0 1 1 0 0 I 0 1 0 0 0 1 5 Equality of Matrices Two matrices are equal if they have the same order and their corresponding entries are equal. Solve for a11, a12, a21, a22 a 4 11 a 3 a a 12 21 22 0 2 a11 a12 4 3 a21 a 22 0 2 6 2
Adding Matrices To add two matrices of the same order, add their corresponding entries Add A B 4 3 2 0 A, B 0 2 5 1 4 2 3 0 AB 0 5 2 1 6 3 5 3 7 Subtracting Matrices To subtract two matrices of the same order, subtract their corresponding entries Subtract A B 4 3 2 0 A, B 0 2 5 1 4 2 3 0 2 3 AB 0 5 2 1 5 1 8 Scalar Multiplication To multiply a matrix by a scalar, multiply each entry by the scalar Multiply ka 4 3 A, k 3 0 2 4 3 ka 3 0 2 34 3 3 30 32 12 9 0 6 9 3
Find 2A3B 4 3 2 0 A, B 0 2 5 1 4 3 2 0 2A3B 2 3 0 2 5 1 8 6 6 0 0 4 15 3 2 6 15 1 10 Find 2A3B 4 3 2 0 A, B 0 2 5 1 11 Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 1) Commutative Property of Matrix Addition: A + B = B + A 4 2 3 2 AB 0 5 2 1 4 3 2 0 A, B 0 2 5 1 2 4 3 2 BA 0 5 2 1 12 4
Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 2) Associative Property of Matrix Addition: A + (B + C) = (A + B) + C 4 3 2 0 1 2 A, B, C 0 2 5 1 3 1 4 3 2 1 0 2 4 2 1 3 0 2 A B C 0 2 5 3 11 0 5 3 2 11 4 2 3 0 1 2 4 2 1 3 0 2 A B C 0 5 2 1 3 1 0 5 3 2 11 13 Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 3) Associative Property of Scalar Multiplication: (cd)a = c(da) cd A 4 3 A, c 2, d 3 0 2 4 3 4 3 64 6 3 23 6 0 2 0 2 60 62 34 33 64 63 cda 2 3 0 3 2 6 0 6 2 14 Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 4) Scalar Identity: 1A = A 4 3 A 0 2 4 3 14 1 3 4 3 1A1 A 0 2 1 0 1 2 0 2 15 5
Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 5) Distributive Property (two forms): c(a + B) = ca + cb (c + d)a = ca + da 16 s 4 3 2 0 A, B, c 2, d 3 0 2 5 1 c(a + B) = ca + cb 4 2 3 0 6 3 12 6 c A B 2 2 0 5 2 1 5 3 10 6 4 3 2 0 8 6 4 0 12 6 ca cb 2 2 0 2 5 1 0 4 10 2 10 6 (c + d)a = ca + da 4 3 20 15 c d A 5 0 2 0 10 4 3 4 3 8 6 12 9 20 15 ca da 2 3 0 2 0 2 0 4 0 6 0 10 17 Properties of Matrices Let A, B, and C be mxn matrices and let c and d be scalars. 6) If A is an mxn matrix and O is the mxn zero matrix, then A + O = A 4 3 A 0 2 4 3 0 0 4 0 3 0 4 3 A 0 A 0 2 0 0 0 0 2 0 0 2 18 6
Vector Vectors can be represented as either row vectors or column vectors. A row vector is a 1 by n matrix 1 2 n R r r r A Column vector is a n by 1 matrix c1 c2 C cn 19 Product of Vectors 1 2 n R r r r R is 1 x n C is n x 1 RC is 1 x 1 RC r r r 1 2 n c1 c2 cn c1 c2 C cn rc 1 1 r2 c2 rnc n 20 R 1 2 3 4 RC 1 2 3 5 6 410 18 32 14 2536 4 C 5 6 21 7
Computing Revenue We sell 100-8 pizzas for $5 125-10 pizzas for $10 90-15 pizzas for $15 Quantity R 100 125 90 $5 Cost C $10 $15 $5 100 125 90 $10 $15 22 Revenue RC Computing Revenue We sell 100-8 pizzas for $5 125-10 pizzas for $10 90-15 pizzas for $15 $5 RC 100 125 90 $10 $15 100 $5 125 $10 90 $15 $500 $10 $1350 $3100 23 Multiplying Matrices If A is a m by n matrix and B is a n by p matrix Then the product AB is a m by p matrix mnnp Inside must equal mnnp Outside is product 24 8
2 1 0 Find AB A 3 4 5 1 3 B 1 4 2 0 First check to see size of product 233 2 2 2 Then write A as two row vectors A 2 1 0, A 3 4 5 1 2 and write B as two row vectors 1 3 B1 1, B2 4 2 0 25 A B The product is then AB A B A B A B 1 1 1 2 2 1 2 2 1 3 AB 1 1 2 1 0 1 1 AB 1 2 2 1 0 4 2 2 0 1 3 AB 2 1 3 4 5 1 9 AB 2 2 3 4 5 4 7 2 0 AB 1 2 9 7 26 2 1 0 Find AB A 3 4 5 1 3 B 1 4 2 0 27 9
2 1 0 Find BA A 3 4 5 1 3 B 1 4 2 0 We see that AB BA 28 Remarks In the last example AB BA That is matrix multiplication is not commutative. In fact, if A is 2 by 3 and B is 3 by 5, AB is 2 by 5, but BA is not even possible to compute, since the size is wrong. 29 Properties of Matrices Let A be a m by n matrix 1) Associative Property A(BC) = (AB)C 2) Distributive Property A(B+C) = AB+AC (A+B)C = AC+BC 3) Identity I m A = A A I n = A 30 10
Application: Computer Graphics A computer image is usually represented as a matrix picture elements (pixels) The number of pixels determines the resolution of the image. Typical resolutions range from 320 by 200 to 2000 by 1500 A gray-scale (black and white) image uses a number (0-255) to describe the intensity of each pixel 31 Application: Computer Graphics If we enlarge the eye of the bird we can see the pixels Each pixel is represented by a number associated with color and brightness 32 Application: Computer Graphics A matrix representation of the letter a 33 11
Inverse of Matrix Let A be a m by m square matrix A -1 is an inverse of A if A A -1 = A -1 A = I A 3 4 5 6 3 2 B 5 2 3 2 Inverses do not always exist 34 Finding The Inverse We have several methods of finding the inverse suppose A 3 4 and we want to find the 5 6 a b Inverse. We wan to find B such that c d 3 4 a b 1 0 AB I and after 5 6 c d 0 1 3a 4c 3b 4d 1 0 multiplying we have 5a 6c 5b 6d 0 1 Finding The Inverse 3a 4c 3b 4d 1 0 5a 6c 5b 6d 0 1 We then have to solve four equations 3a4c1 5a6c0 and 3b4d 0 5b6d 1 3 4 1 1 0 3 3 4 0 1 0 2 5 6 0 0 1 5 2 5 6 1 0 1 3 2 A 1 3 2 5 2 3 2 12
Finding The Inverse Another way to find the inverse is to begin with 3 4 1 0 the augmented matrix A I 5 6 0 1 which we row reduce to produce 3 4 1 0 1 0 3 2 5 6 0 1 0 1 5 2 3 2 1 0 3 2 1 which is equal to I A 0 1 5 2 3 2 1 3 2 giving us A 5 2 3 2 Finding The Inverse The inverse of a 2x2 matrix can be found by a b Let A c d If ad bc 0, then A is invertible and A 1 1 d b ad bc c a det Remarks If the determinant is zero, we say the matrix is singular and the inverse matrix does not exist a b A ad bc c d 13
A 3 4 5 6 A 1 1 6 4 18 20 5 3 6 2 4 2 5 2 3 2 3 2 5 2 3 2 40 Finding The Inverse The inverse of a matrix can also be found using a graphing calculator A 3 4 5 6 TI-84 42 14
7 3 A 5 2 1 1 2 3 2 3 A 14 15 5 7 5 7 43 Matrix Equation a11x a12 y a13 z b1 a21x a22 y a23z b becomes 2 a31x a32 y a33z b3 where and a a a A a a a a a a 11 12 13 21 22 23 31 32 33 x b1 x y b b2 z b 3 Ax = b 44 Matrix Equation Where the inverse exists Ax = b is solved by x = A -1 b Note: This works in the case of consistent independent systems i.e. those with only one solution 45 15
3x y z 2 2x y 3z 14 x y z 4 Solution 2, 1,3 46 16