Matrix Multiplication

Similar documents
Matrices: 2.1 Operations with Matrices

Elementary maths for GMT

Mathematics 13: Lecture 10

ICS 6N Computational Linear Algebra Matrix Algebra

Phys 201. Matrices and Determinants

Section 9.2: Matrices.. a m1 a m2 a mn

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

2.1 Matrices. 3 5 Solve for the variables in the following matrix equation.

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

. a m1 a mn. a 1 a 2 a = a n

Matrix Algebra & Elementary Matrices

Section 9.2: Matrices. Definition: A matrix A consists of a rectangular array of numbers, or elements, arranged in m rows and n columns.

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

MATH 320, WEEK 7: Matrices, Matrix Operations

Matrix representation of a linear map

Matrix Arithmetic. j=1

Materials engineering Collage \\ Ceramic & construction materials department Numerical Analysis \\Third stage by \\ Dalya Hekmat

Matrix representation of a linear map

Linear Algebra and Matrix Inversion

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

MATRICES. a m,1 a m,n A =

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Elementary Row Operations on Matrices

Matrices. Chapter Definitions and Notations

Matrices and Vectors

Matrices. Math 240 Calculus III. Wednesday, July 10, Summer 2013, Session II. Matrices. Math 240. Definitions and Notation.

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES

1 Matrices and matrix algebra

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

Section Summary. Sequences. Recurrence Relations. Summations Special Integer Sequences (optional)

Matrix & Linear Algebra

CLASS 12 ALGEBRA OF MATRICES

Math 360 Linear Algebra Fall Class Notes. a a a a a a. a a a

Section 1.6. M N = [a ij b ij ], (1.6.2)

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Instruction: Operations with Matrices ( ) ( ) log 8 log 25 = If the corresponding elements do not equal, then the matrices are not equal.

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

5.1 Introduction to Matrices

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

3. Replace any row by the sum of that row and a constant multiple of any other row.

CS 246 Review of Linear Algebra 01/17/19

MATH Mathematics for Agriculture II

Lecture 3: Matrix and Matrix Operations

Prepared by: M. S. KumarSwamy, TGT(Maths) Page

Numerical Analysis Lecture Notes

Math 4377/6308 Advanced Linear Algebra

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

MAC Module 2 Systems of Linear Equations and Matrices II. Learning Objectives. Upon completing this module, you should be able to :

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

MATH 2030: MATRICES ,, a m1 a m2 a mn If the columns of A are the vectors a 1, a 2,...,a n ; A is represented as A 1. .

Matrices and Linear Algebra

Matrices BUSINESS MATHEMATICS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Linear Equations in Linear Algebra

DM559 Linear and Integer Programming. Lecture 3 Matrix Operations. Marco Chiarandini

Review of Linear Algebra

Announcements Monday, October 02

Announcements Wednesday, October 10

Math 140, c Benjamin Aurispa. 2.1 Matrices

Multiplying matrices by diagonal matrices is faster than usual matrix multiplication.

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

Matrix Algebra: Definitions and Basic Operations

Review of linear algebra

Basic Concepts in Linear Algebra

MAT 2037 LINEAR ALGEBRA I web:

Lecture 3 Linear Algebra Background

1 Matrices and Systems of Linear Equations. a 1n a 2n

POLI270 - Linear Algebra

Review of Basic Concepts in Linear Algebra

MATH2210 Notebook 2 Spring 2018

Stage-structured Populations

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

Definition 2.3. We define addition and multiplication of matrices as follows.

Introduction - Motivation. Many phenomena (physical, chemical, biological, etc.) are model by differential equations. f f(x + h) f(x) (x) = lim

Matrices. 1 a a2 1 b b 2 1 c c π

Two matrices of the same size are added by adding their corresponding entries =.

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

What is the Matrix? Linear control of finite-dimensional spaces. November 28, 2010

Section 12.4 Algebra of Matrices

Matrix operations Linear Algebra with Computer Science Application

Matrix Basic Concepts

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

Computational Foundations of Cognitive Science. Addition and Scalar Multiplication. Matrix Multiplication

Math 4377/6308 Advanced Linear Algebra

Linear Algebra March 16, 2019

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

Knowledge Discovery and Data Mining 1 (VO) ( )

Linear Algebra V = T = ( 4 3 ).

Linear Algebra (Review) Volker Tresp 2018

ICS141: Discrete Mathematics for Computer Science I

Lesson U2.1 Study Guide

ORIE 6300 Mathematical Programming I August 25, Recitation 1

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

Math Linear Algebra Final Exam Review Sheet

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

Transcription:

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