Matrix Multiplication

Slides:



Advertisements
Similar presentations
Chapter 6 Matrix Algebra.
Advertisements

Matrix.
© 2005 Baylor University Slide 1 Fundamentals of Engineering Analysis EGR 1302 Unit 1, Lecture B Approximate Running Time - 24 minutes Distance Learning.
Maths for Computer Graphics
Chapter 2 Section 3 Arithmetic Operations on Matrices.
Finding the Inverse of a Matrix
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Table of Contents Matrices - Multiplication Assume that matrix A is of order m  n and matrix B is of order p  q. To determine whether or not A can be.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
ECON 1150 Matrix Operations Special Matrices
Overview Definitions Basic matrix operations (+, -, x) Determinants and inverses.
1 C ollege A lgebra Systems and Matrices (Chapter5) 1.
Identity What number is the multiplication identity for real numbers? For matrices, n x n--square matrices, has 1’s on main diagonal and zeros elsewhere.
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
Class Opener:. Identifying Matrices Student Check:
4.4 Identify and Inverse Matrices Algebra 2. Learning Target I can find and use inverse matrix.
Fundamentals of Engineering Analysis
Chapter 6 Systems of Linear Equations and Matrices Sections 6.3 – 6.5.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
CSCI 171 Presentation 9 Matrix Theory. Matrix – Rectangular array –i th row, j th column, i,j element –Square matrix, diagonal –Diagonal matrix –Equality.
Matrices. What you need to learn Know how to write a Matrix Know what is ORDER of Matrices Addition and Subtraction of Matrices Multiplication of Matrices.
8.2 Operations With Matrices
Chapter 2 … part1 Matrices Linear Algebra S 1. Ch2_2 2.1 Addition, Scalar Multiplication, and Multiplication of Matrices Definition A matrix is a rectangular.
Matrix Operations.
3.4 Solution by Matrices. What is a Matrix? matrix A matrix is a rectangular array of numbers.
Copyright © Cengage Learning. All rights reserved. 2 SYSTEMS OF LINEAR EQUATIONS AND MATRICES.
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Matrices. Matrices – How to write & What is Order AppleOrangePear Shop Shop rows and 3 columns  Matrix has order 2x3 (read as “2 by.
2.5 – Determinants and Multiplicative Inverses of Matrices.
Chapter 1 Section 1.6 Algebraic Properties of Matrix Operations.
12-2 MATRIX MULTIPLICATION MULTIPLY MATRICES BY USING SCALAR AND MATRIX MULTIPLICATION.
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
Ch. 12 Vocabulary 1.) matrix 2.) element 3.) scalar 4.) scalar multiplication.
Ch. 7 – Matrices and Systems of Equations 7.5 – Operations with Matrices.
2.1 Matrix Operations 2. Matrix Algebra. j -th column i -th row Diagonal entries Diagonal matrix : a square matrix whose nondiagonal entries are zero.
MTH108 Business Math I Lecture 20.
4-2 Multiplying Matrices Warm Up Lesson Presentation Lesson Quiz
MATH 1046 Introduction to Matrices (Sections 3.1 and 3.2)
13.4 Product of Two Matrices
Sections 2.4 and 2.5 Matrix Operations
Properties and Applications of Matrices
MATRICES.
Chapter 4 Systems of Linear Equations; Matrices
Chapter 7 Matrix Mathematics
10.5 Inverses of Matrices and Matrix Equations
Finding the Inverse of a Matrix
MATHEMATICS Matrix Multiplication
What we’re learning today:
L6 matrix operations.
Multiplication of Matrices
Matrix Algebra.
Matrix Algebra.
RECORD. RECORD Gaussian Elimination: derived system back-substitution.
2. Matrix Algebra 2.1 Matrix Operations.
27. Determinants and Inverses
Unit 3: Matrices
Matrices Introduction.
CS100: Discrete structures
Matrices and Matrix Operations
Matrix Algebra.
Basics of Linear Algebra
Multiplication of Matrices
3.6 Multiply Matrices.
Section 9.4 Matrix Operations
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
3.5 Perform Basic Matrix Operations Algebra II.
Matrices - Operations MULTIPLICATION OF MATRICES
Presentation transcript:

Chapter 6 – Intro to Matrices Operations/properties Now  multiplication

Matrix Multiplication The product of matrices A (m x n) and B (n x p) is the m x p matrix C whose entry cij is given by: Check to see if 2 matrices can be multiplied - check for compatibility! Product of matrices A and B can be calculated if : # of columns of A equals # of rows in B

Matrix Multiplication Example – Sizes of Matrices and Their Product A = 3 × 5 matrix ( # columns = 5 ) B = 5 × 3 matrix (# rows = 5) so #columns_A = #rows_B  COMPATIBLE! Product AB is then a 3 × 3 matrix (#rows_A × #columns_B) And(!) BA = 5 × 5 matrix product of 5 × 3 and 3 × 5  5 × 5

Matrix Multiplication Example – Sizes of Matrices and Their Product Assume: C = 3 × 5 matrix (how many columns?) 5 D = 7 × 3 matrix (how many rows?) 7 Are they compatible? Nope! What about product DC ? (different order of multiplication)?

Matrix Multiplication Example – Sizes of Matrices and Their Product Now: D = 7 × 3 matrix (how many columns?) 3 C = 3 × 5 matrix ( how many rows?) 3 So, product CD is undefined, but DC ~is~ defined. Size/dimension of product DC? product of 7 × 3 and 3 × 5  7 × 5

Matrix Multiplication Example – Sizes of Matrices and Their Product In general a m × n matrix is compatible with a n × p matrix and product is matrix of size m × p [m × n ] [n × p ] = [m × p]

Matrix Multiplication Example – Sizes of Matrices and Their Product Try: Compatible or undefined? Size of product? 3 × 6 times 6 × 5 ? 6 × 5 times 3 × 6 ? 2 × 3 times 2 × 3 ? 1 × 4 times 4 × 1 ? 4 × 1 times 1 × 4 ? bird × cat times cat × dog ? So, product CD is undefined, but DC ~is~ defined. Size/dimension of product DC? DC is a 7 × 5 matrix. In general a m × n is compatible with a n × p and product is a matrix of size m × p

Matrix Multiplication Example – Sizes of Matrices and Their Product Try: Compatible or undefined? Size of product? 3 × 6 times 6 × 5 ? Yes, compatible: 3 × 5 6 × 5 times 3 × 6 ? Undefined 2 × 3 times 2 × 3 ? Undefined 1 × 4 times 4 × 1 ? Yes, compatible: 1 × 1 4 × 1 times 1 × 4 ? Yes, compatible: 4 × 4 bird × cat times cat × dog? Yes, compatible: bird × dog

Example – Matrix Products 2 5 1 4 0 2 1 × 3 times 3 × 1  1 × 1 want first row & first column First row of matrix on left? 2 5 1 First column of matrix on right? 4 0 2 Multiply/add/combine: C11 = 2(4) + 5(0) + 1(2) = 8 + 0 + 2 = 10 Product: 𝟏𝟎

Example – Matrix Products 1 4 6 2 0 3 1 −1 3 2 × 3 times 3 × 1  2 × 1 𝑪𝟏𝟏 𝐶21 want first row & first column First row of matrix on left? 1 4 6 First column of matrix on right? 1 -1 3 Multiply/add/combine: C11 = 1(1) + 4(-1) + 6(3) = 1 + (-4) + 18 = 15 Product: 𝟏𝟓 b. c. d.

Example – Matrix Products 1 4 6 2 0 3 1 −1 3 2 × 3 times 3 × 1  2 × 1 𝟏𝟓 𝐶21 want second row & first column Second row of matrix on left? 2 0 3 First column of matrix on right? 1 -1 3 Multiply/add/combine: C21 = 2(1) + 0(-1) + 3(3) = 2 + 0 + 9 = 11 Product: 𝟏𝟓 𝟏𝟏 b. c. d.

Example – Matrix Products 1 2 0 −2 0 5 1 2 3 4 5 6 2 × 3 times 3 × 2  2 × 2 𝑪𝟏𝟏 𝐶12 𝐶21 𝐶22 (need four entries) C11? First row (left matrix), first column (right): 1 2 0 & 1 3 5 : C11 = 1(1) + 2(3) + 0(5) = 1 + 6 + 0 = 7 C12? First row (left matrix), second column(right): 1 2 0 & 2 4 6 : C12 = 1(2) + 2(4) + 0(6) = 2 + 8 + 0 = 10

Example – Matrix Products 1 2 0 −2 0 5 1 2 3 4 5 6 2 × 3 times 3 × 2  2 × 2 𝟕 𝟏𝟎 𝑪𝟐𝟏 𝑪𝟐𝟐 C21? Second row (left matrix), first column (right): -2 0 5 & 1 3 5 : C21 = -2(1) + 0(3) + 5(5) = -2 + 0 + 25 = 23 C22? Second row (left matrix), second column(right): -2 0 5 & 2 4 6 : C22 = -2(2) + 0(4) + 5(6) = -4 + 0 + 30 = 26

Example – Matrix Products – Try it …! 2 5 −1 1 4 0 0 3 7 1 2 3 4 5 6 3 × 3 times 3 × 2  3 × 2 𝑪𝟏𝟏 𝑪𝟏𝟐 𝑪𝟐𝟏 𝑪𝟐𝟐 𝑪𝟑𝟏 𝑪𝟑𝟐 (need six entries) C11? First row (left matrix), first column (right): C11 = ? C12? First row (left matrix), second column(right): C12 =

Example – Matrix Products – Try it …! 2 5 −1 1 4 0 0 3 7 1 2 3 4 5 6 3 × 3 times 3 × 2  3 × 2 𝑪𝟏𝟏 𝑪𝟏𝟐 𝑪𝟐𝟏 𝑪𝟐𝟐 𝑪𝟑𝟏 𝑪𝟑𝟐 (need six entries) C11? First row (left matrix), first column (right): C11 = 2(1) + 5(3) + (-1)(5) = 2 + 15 - 5 = 12 C12? First row (left matrix), second column(right): C12 = 2(2) + 5(4) + (-1)(6) = 4 + 20 – 6 = 18 𝟏𝟐 𝟏𝟖 ? ? ? ?

Example – Matrix Products – Try it …! 2 5 −1 1 4 0 0 3 7 1 2 3 4 5 6 3 × 3 times 3 × 2  3 × 2 𝟏𝟐 𝟏𝟖 𝑪𝟐𝟏 𝑪𝟐𝟐 𝑪𝟑𝟏 𝑪𝟑𝟐 C21? Second row (left matrix), first column (right): C21 = ? C22? Second row (left matrix), second column(right): C22 =

Example – Matrix Products – Try it …! 2 5 −1 1 4 0 0 3 7 1 2 3 4 5 6 3 × 3 times 3 × 2  3 × 2 𝑪𝟏𝟏 𝑪𝟏𝟐 𝑪𝟐𝟏 𝑪𝟐𝟐 𝑪𝟑𝟏 𝑪𝟑𝟐 C21? Second row (left matrix), first column (right): C21 = 1(1) + 4(3) + (0)(5) = 1 + 12 + 0 = 13 C22? Second row (left matrix), second column(right): C22 = 1(2) + 4(4) + (0)(6) = 2 + 16 +0 = 18 𝟏𝟐 𝟏𝟖 𝟏𝟑 𝟏𝟖 ? ?

Example – Matrix Products – Try it …! 2 5 −1 1 4 0 0 3 7 1 2 3 4 5 6 3 × 3 times 3 × 2  3 × 2 𝟏𝟐 𝟏𝟖 𝟏𝟑 𝟏𝟖 𝑪𝟑𝟏 𝑪𝟑𝟐 C31? Third row (left matrix), first column (right): C31 = 0(1) + 3(3) + (7)(5) = 0 + 9 + 35 = 44 C32? Third row (left matrix), second column(right): C32 = 0(2) + 3(4) + (7)(6) = 0 + 12 + 42 = 54 𝟏𝟐 𝟏𝟖 𝟏𝟑 𝟏𝟖 𝟒𝟒 𝟓𝟒

Example – Matrix Products b. c.

If Note that A(BC) = (AB)C. Example – Associative Property compute ABC in two ways. Solution 1: 𝑨 𝑩𝑪 = 1 −2 −3 −4 3 0 −1 1 1 2 1 0 0 2 1 1 = 1 −2 −3 −4 2 −1 3 4 = −𝟒 −𝟗 −𝟏𝟖 −𝟏𝟑 Solution 2: 𝐀𝐁 𝐂= 1 −2 −3 −4 3 0 −1 1 1 2 1 0 0 2 1 1 = 1 −2 −5 −13 −4 −5 1 0 0 2 1 1 = −𝟒 −𝟗 −𝟏𝟖 −𝟏𝟑 Note that A(BC) = (AB)C.

Two Special Matrices (Identities) Identity for addition: zero matrix  O Aij = 0 for all i, j Identity matrix for multiplication  I Aij = 1 for all i = j Aij = 0 for all i ≠ j (all matrix elements on diagonal are 1, all others 0) E.g: A+O = 𝟏 𝟐 𝟑 𝟒 + 𝟎 𝟎 𝟎 𝟎 = 𝟎 𝟎 𝟎 𝟎 + 𝟏 𝟐 𝟑 𝟒 = O+A = 𝟏 𝟐 𝟑 𝟒 = A AI = 𝟏 𝟐 𝟑 𝟒 𝟏 𝟎 𝟎 𝟏 = 𝟏 𝟎 𝟎 𝟏 𝟏 𝟐 𝟑 𝟒 = 𝟏 𝟐 𝟑 𝟒 = A

Solution: Example – Matrix Operations Involving I and O If compute each of the following. Solution:

Given the price and the quantities, calculate the total cost. Example – Cost Vector Given the price and the quantities, calculate the total cost. Solution: The cost vector is

in matrix form by using matrix multiplication. Example – Matrix Form of a System Using Matrix Multiplication Write the system in matrix form by using matrix multiplication. Solution: If then the single matrix equation is