3.2 Matrix Algebra
Matrix Multiplication Example Foxboro Stadium has three main concession stands, located behind the south, north and west stands. The top-selling items are peanuts, hot dogs and soda. Sales for the season opener are recorded in the first matrix below, and the prices (in dollars) of the three items are given in the second matrix. South North West 120 250 305 2.00 207 140 419 3.00 39 120 190 2.75 Peanuts Hot Dogs Soda
Matrix Multiplication Example Foxboro Stadium has three main concession stands, located behind the south, north and west stands. The top-selling items are peanuts, hot dogs and soda. Sales for the season opener are recorded in the first matrix below, and the prices (in dollars) of the three items are given in the second matrix. South North West 120 250 305 2.00 207 140 419 3.00 39 120 190 2.75 Peanuts Hot Dogs Soda How can we find the total sales from the south stands?
Matrix Multiplication Example Foxboro Stadium has three main concession stands, located behind the south, north and west stands. The top-selling items are peanuts, hot dogs and soda. Sales for the season opener are recorded in the first matrix below, and the prices (in dollars) of the three items are given in the second matrix. South North West 120 250 305 2.00 207 140 419 3.00 39 120 190 2.75 Peanuts Hot Dogs Soda How can we find the total sales from the south stands? 120(2.00) + 250(3.00) + 305(2.75) = $1828.75
Matrix Multiplication Similarly, for the north and west stands, respectively, we get 207(2.00) + 140(3.00) + 419(2.75) = $1986.25 and 39(2.00) + 120(3.00) + 190(2.75) = $940.50
Matrix Multiplication Similarly, for the north and west stands, respectively, we get and 207(2.00) + 140(3.00) + 419(2.75) = $1986.25 39(2.00) + 120(3.00) + 190(2.75) = $940.50 We can arrive at this, using matrix multiplication, where the system would look like 120 250 305 2.00 1828.75 207 140 419 3.00 = 1986.25 39 120 190 2.75 940.50
Matrix Multiplication Definition If A = [a ij ] is an m n matrix and B = [b ij ] is an n p matrix, then the product AB is an m p matrix AB = [c ij ] where n c ij = a ik b kj = a i1 b 1j + a i2 b 2j +... + a in b nj k=1
Matrix Multiplication Definition If A = [a ij ] is an m n matrix and B = [b ij ] is an n p matrix, then the product AB is an m p matrix AB = [c ij ] where n c ij = a ik b kj = a i1 b 1j + a i2 b 2j +... + a in b nj k=1 This is a fancy way of saying that the i, j position in the answer matrix is the dot product of the i th row of the first matrix and the j th column of the second matrix.
Matrix Multiplication Definition If A = [a ij ] is an m n matrix and B = [b ij ] is an n p matrix, then the product AB is an m p matrix AB = [c ij ] where n c ij = a ik b kj = a i1 b 1j + a i2 b 2j +... + a in b nj k=1 This is a fancy way of saying that the i, j position in the answer matrix is the dot product of the i th row of the first matrix and the j th column of the second matrix. We also have to make sure that the sizes of the matrices are appropriate for multiplying matrices.
Matrix Multiplication Example Example Find the product AB, where 1 3 A = 4 2 and B = 5 0 [ 3 ] 2 4 1
Matrix Multiplication Example Example Find the product AB, where 1 3 A = 4 2 and B = 5 0 [ 3 ] 2 4 1 1 3 [ ] c 4 2 3 2 11 c 12 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] c 4 2 3 2 11 c 12 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] c 4 2 3 2 11 c 12 = c 4 1 21 c 22 5 0 c 31 c 32 c 11 = ( 1)( 3) + 3( 4) = 9
Matrix Multiplication Example 1 3 [ ] c 4 2 3 2 11 c 12 = c 4 1 21 c 22 5 0 c 31 c 32 c 11 = ( 1)( 3) + 3( 4) = 9 1 3 [ ] 9 c 4 2 3 2 12 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] 9 c 4 2 3 2 12 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] 9 c 4 2 3 2 12 = c 4 1 21 c 22 5 0 c 31 c 32 c 12 = 1(2) + 3(1) = 1
Matrix Multiplication Example 1 3 [ ] 9 c 4 2 3 2 12 = c 4 1 21 c 22 5 0 c 31 c 32 c 12 = 1(2) + 3(1) = 1 1 3 [ ] 9 1 4 2 3 2 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] 9 1 4 2 3 2 = c 4 1 21 c 22 5 0 c 31 c 32
Matrix Multiplication Example 1 3 [ ] 9 1 4 2 3 2 = c 4 1 21 c 22 5 0 c 31 c 32 c 31 = 5( 3) + 0( 4) = 15
Matrix Multiplication Example 1 3 [ ] 9 1 4 2 3 2 = c 4 1 21 c 22 5 0 c 31 c 32 c 31 = 5( 3) + 0( 4) = 15 1 3 4 2 5 0 [ ] 9 1 3 2 = 4 1 c 21 c 22 15 c 32
Matrix Multiplication Example Continuing, we get... 1 3 [ ] 9 1 4 2 3 2 = 4 6 4 1 5 0 15 10
Matrix Multiplication Example [ ] 4 2 1 0 3 2 1 0 0 = 2 1 2 1 1 1
Matrix Multiplication Example [ ] 4 2 1 0 3 2 1 0 0 = 2 1 2 1 1 1 [ 5 7 ] 1 3 6 6
Matrix Multiplication Example [ ] 4 2 1 0 3 2 1 0 0 = 2 1 2 1 1 1 [ 5 7 ] 1 3 6 6 Example [ ] [ ] 3 4 1 0 = 2 5 0 1
Matrix Multiplication Example [ ] 4 2 1 0 3 2 1 0 0 = 2 1 2 1 1 1 [ 5 7 ] 1 3 6 6 Example [ ] [ ] 3 4 1 0 = 2 5 0 1 [ 3 ] 4 2 5
Matrix Multiplication Example [ ] 4 2 1 0 3 2 1 0 0 = 2 1 2 1 1 1 [ 5 7 ] 1 3 6 6 Example [ ] [ ] 3 4 1 0 = 2 5 0 1 [ 3 ] 4 2 5 What do we call the second matrix?
Matrix Multiplication Example [ ] [ ] 1 2 1 2 = 1 1 1 1
Matrix Multiplication Example [ ] [ ] 1 2 1 2 = 1 1 1 1 [ ] 1 0 0 1
Matrix Multiplication Example [ ] [ ] 1 2 1 2 = 1 1 1 1 [ ] 1 0 0 1 What is the relationship between these two matrices?
Matrix Multiplication Example [ ] [ ] 1 2 1 2 = 1 1 1 1 [ ] 1 0 0 1 What is the relationship between these two matrices? Example [ ] 2 1 2 3 1 = 1
Matrix Multiplication Example [ ] [ ] 1 2 1 2 = 1 1 1 1 [ ] 1 0 0 1 What is the relationship between these two matrices? Example [ ] 2 1 2 3 1 = [ 1 ] 1
Matrix Multiplication Example 2 1 [ 1 2 3 ] = 1
Matrix Multiplication Example 2 1 [ 1 2 3 ] = 1 2 4 6 1 2 3 1 2 3
Commutativity (and the lack of) Note: Matrices are not necessarily commutative. Think about the size of the matrices...
Commutativity (and the lack of) Note: Matrices are not necessarily commutative. Think about the size of the matrices... Even if the sizes work, there is no guarantee that there will be equality.
Commutativity (and the lack of) Note: Matrices are not necessarily commutative. Think about the size of the matrices... Even if the sizes work, there is no guarantee that there will be equality. Example Find[ the product ] AB and[ BA if ] 1 2 1 1 A = and B = 2 3 3 5
Commutativity (and the lack of) Note: Matrices are not necessarily commutative. Think about the size of the matrices... Even if the sizes work, there is no guarantee that there will be equality. Example Find[ the product ] AB and[ BA if 1 2 1 1 A = and B = 2 3 3 5 [ ] 5 9 AB = 5 17 ]
Commutativity (and the lack of) Note: Matrices are not necessarily commutative. Think about the size of the matrices... Even if the sizes work, there is no guarantee that there will be equality. Example Find[ the product ] AB and[ BA if ] 1 2 1 1 A = and B = 2 3 3 5 [ ] [ ] 5 9 3 1 AB = but BA = 5 17 13 9
The Identity Matrix We saw two instances of the identity matrix in the prior examples:
The Identity Matrix We saw two instances of the identity matrix in the prior examples: 1 The product of a matrix and the identity is the original matrix
The Identity Matrix We saw two instances of the identity matrix in the prior examples: 1 The product of a matrix and the identity is the original matrix 2 The product of a matrix and it s inverse is the identity matrix
The Identity Matrix We saw two instances of the identity matrix in the prior examples: 1 The product of a matrix and the identity is the original matrix 2 The product of a matrix and it s inverse is the identity matrix We actually have two identity matrices, depending on the operation.
The Identity Matrix We saw two instances of the identity matrix in the prior examples: 1 The product of a matrix and the identity is the original matrix 2 The product of a matrix and it s inverse is the identity matrix We actually have two identity matrices, depending on the operation. Additive Identity For any matrix A M mn, the matrix 0 mn is the additive identity and has the property A + 0 mn = A = 0 mn + A.
The Identity Matrix We saw two instances of the identity matrix in the prior examples: 1 The product of a matrix and the identity is the original matrix 2 The product of a matrix and it s inverse is the identity matrix We actually have two identity matrices, depending on the operation. Additive Identity For any matrix A M mn, the matrix 0 mn is the additive identity and has the property A + 0 mn = A = 0 mn + A. We generally refer to this as the zero matrix rather than an identity matrix.
The Identity Matrix Multiplicative Identity For any matrix A M n, the matrix I n is the multiplicative identity and has the property AI n = A = I n A.
The Identity Matrix Multiplicative Identity For any matrix A M n, the matrix I n is the multiplicative identity and has the property AI n = A = I n A. 1 0 0... 0 0 1 0... 0 I n =..... 0 0 0... 1
The transpose of a matrix Definition The transpose of a matrix, denoted A T, is the matrix formed from the matrix A = [a ij ] by interchanging the rows and the columns. A T = [a ji ].
The transpose of a matrix Definition The transpose of a matrix, denoted A T, is the matrix formed from the matrix A = [a ij ] by interchanging the rows and the columns. A T = [a ji ]. Visually speaking, the transpose of a matrix is a reflection over the main diagonal.
The transpose of a matrix Definition The transpose of a matrix, denoted A T, is the matrix formed from the matrix A = [a ij ] by interchanging the rows and the columns. A T = [a ji ]. Visually speaking, the transpose of a matrix is a reflection over the main diagonal. [ ] 1 2 3 A = 4 5 6
The transpose of a matrix Definition The transpose of a matrix, denoted A T, is the matrix formed from the matrix A = [a ij ] by interchanging the rows and the columns. A T = [a ji ]. Visually speaking, the transpose of a matrix is a reflection over the main diagonal. [ ] 1 2 3 A = 4 5 6 1 4 A T = 2 5 3 6
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true:
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true: ( 1 A T ) T = A
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true: ( 1 A T ) T = A 2 (A + B) T = A T + B T
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true: ( 1 A T ) T = A 2 (A + B) T = A T + B T 3 (ca) T = ca T
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true: ( 1 A T ) T = A 2 (A + B) T = A T + B T 3 (ca) T = ca T 4 (AB) T = B T A T
Properties of Transposes Theorem If A and B are matrices (with sizes such that the given matrix operations are defined) and c is a scalar, then the following properties are true: ( 1 A T ) T = A 2 (A + B) T = A T + B T 3 (ca) T = ca T 4 (AB) T = B T A T Why do these properties hold?
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix.
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix.
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist,
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist, but B T A T is a
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist, but B T A T is a c a matrix.
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist, but B T A T is a c a matrix. Since (AB) T and B T A T have the same size, we now need to show that the entries are the same.
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist, but B T A T is a c a matrix. Since (AB) T and B T A T have the same size, we now need to show that the entries are the same. First, note that the i, j th entry of (AB) T is the same as the j, i th entry of AB.
Proof of part 4 (AB) T = B T A T If A is an a b matrix, then B must be a b c matrix. Then, the product AB is an a c matrix, so (AB) T is a c a matrix. Furthermore, A T is a b a matrix and B T is a c b matrix, so A T B T cannot exist, but B T A T is a c a matrix. Since (AB) T and B T A T have the same size, we now need to show that the entries are the same. First, note that the i, j th entry of (AB) T is the same as the j, i th entry of AB. Now, the i, j th entry of B T A T is the dot product of the i th row of B T, which is the i th column of B, and the j th column of A T, which is the j th row of A. That is, the i, j th entry of B T A T is the dot product of the j th row of A and i th column of B.
Symmetric Matrices Definition A matrix is said to be symmetric if A = A T. Then a ij = a ji for all i j
Symmetric Matrices Definition A matrix is said to be symmetric if A = A T. Then a ij = a ji for all i j This implies that all symmetric matrices must be square.
Good Will Hunting
Good Will Hunting 4 1 2 3
Good Will Hunting 4 A = 0 1 0 1 1 0 2 1 0 2 0 0 1 1 0 0 1 2 3
Good Will Hunting 4 A = 0 1 0 1 1 0 2 1 0 2 0 0 1 1 0 0 1 2 3 A 2 = 2 1 2 1 1 6 0 1 2 0 4 2 1 1 2 2