how to multiply two matrices. steps for matrix multiplication 1.determine whether the matrices are...

12
How to Multiply Two Matrices

Upload: cecil-perry

Post on 18-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

How to Multiply Two Matrices

Page 2: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Steps for Matrix Multiplication

1. Determine whether the matrices are compatible.

2. Determine the dimensions of the product matrix.

3. Using the addresses of each entry in the product matrix, multiply and add a row in the first matrix by a column in the second.

Page 3: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Test for Compatibility/Dimensions of the Product Matrix

1. Line the matrices next to each other, and write the dimensions under each matrix.

2. Verify that the number of columns in the first matrix equals the number of rows in the second matrix.

3. If the matrices are compatible, the dimensions of the product matrix is found as follows: the number of rows from first matrix by the number of columns from the second.

Page 4: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Test for Compatibility/Dimensions of the Product Matrix

Examples:

Compatible? Yes

What are the dimensions of the product matrix?

3 x 2 2 x 2

3 x 2 2 x 2 3 x 2

=

__

__

__

Page 5: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Test for Compatibility/Dimensions of the Product Matrix

Your turn. Is matrix multiplication possible? If so, what is are the dimensions of the product matrix?

Page 6: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

How to Multiply:Addresses

Once we know the dimensions of the product matrix, we next find the value for each entry. In order to do this, we need to be able to give each entry its own address.

Each entry has a two number address. The first is its row, the second its column.

__

__

__1,1 1,2

3,1 3,2

2,22,1

3,32,31,3

3,22,21,2

3,12,11,1

___

___

___

Page 7: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

How to Multiply:Addresses

Label the addresses for the entries in the following matrices.

__

__

___

___

____

_

_

___

___

___

_

_

_

_

__

__

__

__

Page 8: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Multiplying Entry by Entry

To compute the value of entry 1,1:

Multiply the first entry from row 1 from the first matrix by the first entry of column 1 from the second matrix; add that to the product of the second entry from row 1 of the first matrix and the second entry from the first column of the second matrix.

Etc.

In general, to find the entry m, n:

Multiply the mth row of the first matrix by the nth column of the second, and add the products.

Page 9: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

-15

12

26

51

23

12 4

12

26

51

23

12 4

26

51

23

12

4

26

51

23

12

2 x 2 2 x 2

__

__

26

51

23

12

For entry 1,1, multiply and add row-1 of first matrix by column-1 of second.

(2 x -1) + (1 x 6) = 4

For entry 1,2, multiply and add row-1 of first matrix by column-2 of second.

(2 x 5) + (2 x 1) = 12

For entry 2,1, multiply and add row-2 of first matrix by column-1 of second.

(3 x -1) + (-2 x 6) = -15

For entry 2,2, multiply and add row-2 of first matrix by column-2 of second.

(3 x 5) + (-2 x 2) = 11

4

12

11

-15

Page 10: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

25

10

41

432

__

25

10

41

432

_18

25

10

41

432

1918

25

10

41

432

Can you multiply the matrices?

1 x 3 and 3 x 2

yes

What are the dimensions of the product matrix?

1 x 2

What is in entry 1,1?

Multiply and add row 1 of the first matrix by column 1 of the second.

(2 x -1) + (3 x 0) + (4 x 5) = 18

What is in entry 1,2?

Multiply and add row 1 of the first matrix by column 1 of the second.

(2 x 4) + (3 x 1) + (4 x 2) = 19

Page 11: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product

Try It!

Page 12: How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product