21
MATRICES MATRIX OPERATIONS

matrix_ops.ppt

Embed Size (px)

Citation preview

Page 1: matrix_ops.ppt

MATRICES

MATRIX OPERATIONS

Page 2: matrix_ops.ppt

About Matrices A matrix is a rectangular

arrangement of numbers in rows and columns. Rows run horizontally and columns run vertically.

The dimensions of a matrix are stated “m x n” where ‘m’ is the number of rows and ‘n’ is the number of columns.

Page 3: matrix_ops.ppt

Equal Matrices

Two matrices are considered equal if they have the same number of rows and columns (the same dimensions) AND all their corresponding elements are exactly the same.

Page 4: matrix_ops.ppt

Special MatricesSome matrices have special names because of what they look like.

a) Row matrix: only has 1 row.

b) Column matrix: only has 1 column.

c) Square matrix: has the same number of rows and columns.

d) Zero matrix: contains all zeros.

Page 5: matrix_ops.ppt

Matrix Addition

You can add or subtract matrices if they have the same dimensions (same number of rows and columns).

To do this, you add (or subtract) the corresponding numbers (numbers in the same positions).

Page 6: matrix_ops.ppt

Matrix Addition

2 4 1 0

5 0 2 1

1 3 3 3

Example:

3 4

7 1

2 0

Page 7: matrix_ops.ppt

Scalar Multiplication

To do this, multiply each entry in the matrix by the number outside (called the scalar). This is like distributing a number to a polynomial.

Page 8: matrix_ops.ppt

Scalar Multiplication

2 4

4 5 0

1 3

Example:

8 16

20 0

4 12

Page 9: matrix_ops.ppt

Matrix Multiplication Matrix Multiplication is NOT

Commutative! Order matters! You can multiply matrices only if the

number of columns in the first matrix equals the number of rows in the second matrix.

2 3

5 6

9 7

2 columns2 rows

1 2 0

3 4 5

Page 10: matrix_ops.ppt

Matrix Multiplication Take the numbers in the first row of

matrix #1. Multiply each number by its corresponding number in the first column of matrix #2. Total these products.

2 3

5 6

9 7

1 2 0

3 4 5

21 33 11

The result, 11, goes in row 1, column 1 of the answer. Repeat with row 1, column 2; row 1 column 3; row 2, column 1; ...

Page 11: matrix_ops.ppt

Matrix Multiplication Notice the dimensions of the matrices and

their product.

2 3

5 6

9 7

1 2 0

3 4 5

11 8 15

13 34 30

12 46 35

3 x 2 2 x 3 3 x 3__ __ __ __

Page 12: matrix_ops.ppt

Matrix Multiplication Another example:

2 15

9 02

10 5

3 x 2 2 x 1 3 x 1

8

45

60

Page 13: matrix_ops.ppt

Matrix Determinants

A Determinant is a real number associated with a matrix. Only SQUARE matrices have a determinant.

The symbol for a determinant can be the phrase “det” in front of a matrix variable, det(A); or vertical bars arounda matrix, |A| or .3 1

2 4

Page 14: matrix_ops.ppt

Matrix Determinants

To find the determinant of a 2 x 2 matrix, multiply diagonal #1 and subtract the product of diagonal #2.

3 1       

2 4

Diagonal 1 = 12

Diagonal 2 = -2

12 ( 2) 14

Page 15: matrix_ops.ppt

Matrix Determinants

To find the determinant of a 3 x 3 matrix, first recopy the first two columns. Then do 6 diagonal products.

5 2 6

2 1 4

3 3 4

 

5 2

2 1

3 3-20 -24 36

18 60 16

Page 16: matrix_ops.ppt

Matrix Determinants

The determinant of the matrix is the sum of the downwards products minus the sum of the upwards products.

5 2 6

2 1 4

3 3 4

 

5 2

2 1

3 3-20 -24 36

18 60 16

= (-8) - (94) = -102

Page 17: matrix_ops.ppt

Identity Matrices An identity matrix is a square matrix that

has 1’s along the main diagonal and 0’s everywhere else.

When you multiply a matrix by the identity matrix, you get the original matrix.

1 0 0

0 1 0

0 0 1

1 0

0 1

Page 18: matrix_ops.ppt

Inverse Matrices When you multiply a matrix and its

inverse, you get the identity matrix.

3 1

5 2

2 1

5 3

1 0

0 1

Page 19: matrix_ops.ppt

Inverse Matrices Not all matrices have an inverse! To find the inverse of a 2 x 2 matrix,

first find the determinant.a) If the determinant = 0, the inverse does

not exist! The inverse of a 2 x 2 matrix is the

reciprocal of the determinant times the matrix with the main diagonal swapped and the other terms multiplied by -1.

Page 20: matrix_ops.ppt

Inverse Matrices

Example 1: A 3 1

5 2

det(A) 6 (5) 1

A 1 1

1

2 1

5 3

2 1

5 3

Page 21: matrix_ops.ppt

Inverse Matrices

Example 2: B 2 2

5 4

det(B) ( 8) ( 10) 2

B 1 1

2

4 2

5 2

2 1

52 1