Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Math 221, Section 2.1 (1) Matrix addition (2) Matrix multiplication (3) Special matrices 1 / 16 Matrix sum If A and B are m × n matrices, then the sum A + B is the m × n matrix whose entries are the sums of the corresponding entries in A and B. The subtraction A − B is defined similarly. 2 / 16 Scalar multiplication of matrices If c is a scalar and A is a matrix, then the scalar multiple cA is the matrix whose entries are c times the corresponding entries in A. Example, 3 / 16 Matrix multiplication: motivation When a matrix B multiplies a vector x, it transforms x into the vector Bx. If Bx is multiplied in turn by a matrix A, the resulting vector is A(Bx). We view A(Bx) as produced from x by a composition of linear transformations. Our goal is to represent this composite function as multiplication by a single matrix, denoted by AB, so that (AB)x = A(Bx). 4 / 16 Matrix multiplication: example 5 / 16 Matrix multiplication: example Previous example: The matrix that (i) reflects points along the x-axis (ii) then rotates π/2 radians (90◦ ) clockwise. We have computed I I 0 1 , and the second one is −1 0 0 −1 the matrix of the whole process is −1 0 (computed in Sec 1.8). the first matrix is 1 0 0 −1 Now check that 0 1 −1 0 1 0 0 −1 = 0 −1 −1 0 6 / 16 Matrix multiplication: definition I The number of columns of A must match the number of rows in B in order for the multiplication AB to be defined. I Otherwise, we cannot multiply A and B. 7 / 16 Notice that since the first column of AB is Ab1 ; this column is a linear combination of the columns of A using the entries in b1 as weights. A similar statement is true for other columns of AB. I In example 3 on p.5, the first column of AB is Ab1 , which is 11 2 3 =4 +1 −1 1 −5 I Write similar arguments for the 2nd and the 3rd columns. 8 / 16 Warnings I In general AB 6= BA I (Example on p.5) What if we reverse the 2 steps: (i) first rotates π/2 radians (90◦ ) clockwise. (ii) then reflects points along the x-axis The resulting matrix is I Also check example 7 in the textbook. 9 / 16 Warnings I If AB = AC , then it is not true in general that B = C . (That is, cancellation law does not hold for matrix multiplication.) I Example (Sec 2.1, Ex 10) 3 −6 −1 A= ,B= −1 2 3 1 4 ,C= −3 2 −5 1 10 / 16 Warnings I If AB = 0 (the zero matrix), it is not true in general that A = 0 or B = 0. I Example (Sec 2.1, Ex 12) 3 −6 2 A= ,B= −2 4 1 4 2 . 11 / 16 Appendix: properties 12 / 16 Some special matrices 0 0 0 0 zero matrix 0 = , 0 0 0 0 0 0 1 1 0 identity matrix I = , 0 0 1 0 a 0 a 0 diagonal matrix , 0 b 0 b 0 0 I I I 0 0 0 0 0 1 0 0 1 0 0 c 13 / 16 Zero and one I I I ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ 0 0 0 0 ∗ 0 0 = ∗ 0 0 0 0 0 0 0 = 0 0 0 0 0 , 0 0 0 0 Zero matrix behaves like 0 in numbers: 0a = a0 = 0. 1 0 0 1 1 4 1 2 3 4 5 6 I ∗ ∗ 0 0 0 2 5 1 0 0 3 1 2 = 6 4 5 0 0 1 1 0 = 4 0 1 3 6 , 2 3 5 6 Identity matrix behaves like 1 in numbers: 1a = a1 = a. 14 / 16 Diagonal matrices I 2 0 0 3 I I = 2 4 6 12 15 18 Multiplying a diagonal matrix D from the left of A results in row operations on A by scaling each row by the corresponding diagonal entry of D. 1 2 3 4 5 6 I 1 2 3 4 5 6 2 0 0 0 3 0 = 2 6 12 8 15 24 0 0 4 Multiplying a diagonal matrix D from the right of A results in column operations on A by scaling each column by the corresponding diagonal entry of D. 15 / 16 Matrix Powers Ak = A · · · A (k times) I A= I A2 I = AA = 2 5 1 3 = AA2 = 2 5 1 3 2 5 1 3 = 9 25 5 14 9 25 = 5 14 2 5 4 3 A = AA = = 1 3 or you may try 9 25 9 25 4 2 2 A =A A = = 5 14 5 14 I A3 I 2 5 1 3 16 / 16