24
What is a Matrix? • A matrix is a set of elements, organized into rows and columns 11 10 01 00 a a a a n columns m rows n matrix is a matrix of m rows and n column n order (mxn).

Matrices

Embed Size (px)

DESCRIPTION

matrices

Citation preview

Page 1: Matrices

What is a Matrix?

• A matrix is a set of elements, organized into rows and columns

1110

0100

aa

aa

n columns

m rows

m×n matrix is a matrix of m rows and n columns with an order (mxn).

Page 2: Matrices

Basic Operations

• Addition and Subtraction

hdgc

fbea

hg

fe

dc

ba

hdgc

fbea

hg

fe

dc

ba

Just add elements

Just subtract elements

A

Page 3: Matrices

Matrix arithmetic (operations)Matrix arithmetic (operations)

Matrix addition.Matrix addition. A Ammnn and B and Bmmnn

• must have the same numbers of rows and must have the same numbers of rows and columnscolumns• add corresponding entries add corresponding entries

AAmmnn + B + Bmmnn = C = Cmmn n = [a= [ai,ji,j + b + bi,ji,j]]

31

20

11

2,3A

32

61

54

2,3B

03

81

65

2,32,3 BA

Matrix subtractionMatrix subtraction is done similarly is done similarly

Matrix Addition/Subtraction

Page 4: Matrices

Basic Operations

• Multiplication

dhcfdgce

bhafbgae

hg

fe

dc

baMultiply each row by each column

An m×n can be multiplied by an n×p matrix to yield an m×p result

Page 5: Matrices

Matrix arithmetic (operations)Matrix arithmetic (operations)ExampleExample

143410211,33,11,22,11,11,11,1 bababac

220013112401

3,4A

031142

2,3B

2813798414

2,4CAB

40410412,33,12,22,12,11,12,1 bababac

83111221,33,21,22,21,11,21,2 bababac

Matrix Multiplication

Page 6: Matrices

Basic Operations

• Transpose: Swap rows with columns

ihg

fed

cba

M

ifc

heb

gda

M T

z

y

x

V zyxV T

Page 7: Matrices

Square Matrices

• A Square matrix has same number of rows and columns.

Square Matrices

This is a 3x3 matrix

Page 8: Matrices

Row and Column Matrices

• A matrix can have single row (a “row matrix”) or just a single column(a”column matrix”)

Page 9: Matrices

10

01

Identity matrix: Square matrix with 1’s on the diagonal and zeros everywhere else

2 x 2 identity matrix

100

010

001

3 x 3 identity matrix

The identity matrix is to matrix multiplication as ___ is to regular multiplication!!!!1

Identity Matrix

Page 10: Matrices

Multiply:

10

01

43

25=

43

25

10

01

43

25=

43

25

So, the identity matrix multiplied by any matrix lets the “any” matrix keep its identity!

Mathematically, IA = A and AI = A !!

Page 11: Matrices

• The 2×2 matrix,

`

has determinant

Determinant

Page 12: Matrices

45

23

Notice the different symbol:

the straight lines tell you to

find the determinant!!

(3 * 4) - (-5 * 2)

12 - (-10) 22

=45

23

=

=

Example of 2 X 2 matrix

Page 13: Matrices

1 1 1

2 2 2

3 3 3

a b c

a b c

a b c

= – +2 2

13 3

b ca

b c1 1

23 3

b ca

b c1 1

32 2

b ca

b c

= 1 2 3 3 2a b c b c – + 2 1 3 3 1a b c b c 3 1 2 2 1a b c b c

= 1 2 3 3 2a b c b c + + 2 1 3 3 1( 1)a b c b c 3 1 2 2 1a b c b c

= 1 1a A + +2 2a A 3 3a A

Example of 3X3 matrix

Page 14: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=

Page 15: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=1 2

( 3)1 4

Page 16: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=1 2

( 3)1 4

1 2

82 3

– +

Page 17: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=1 2

( 3)1 4

1 2

82 3

– +

= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)

Page 18: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=1 2

( 3)1 4

1 2

82 3

– +

= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)

= 55 – ( 6) + 56

Page 19: Matrices

2 35

1 4

5 1 2

3 2 3

8 1 4

=1 2

( 3)1 4

1 2

82 3

– +

= 5 8 ( 3) – ( 3) 4 2 + 8 3 ( 4)

= 55 – ( 6) + 56

= 117

Example-

Page 20: Matrices

This rule can be used to calculate solutions of

where A is a square matrix.

Let A  be an n x n  matrix. The system of equations

has a unique solution if and only if           .

Cramer’s Rule

Page 21: Matrices

Let Ak be the matrix obtained by replacing column k   of A  by the column matrix B   . Then

                  

                  

     

              

Page 22: Matrices

Example:Solve the following equations:-

x + 3 y + 3z = 1;x + 4y +3 z = 0;x + 3y + 4z = 2;

Ans: x = 1, y = -1, z = 1

Page 23: Matrices

Example:

The ABC shipping company charges $2.90 for all packages weighing less than or equal to 5 lbs, $5.20 for packages weighing more than 5 lbs and less than 10 lbs, and $8.00 for all packages weighing 10 lbs. or more. The number of packages weighing 5 lbs or less is 50% of the number of packages weighing 10 lbs or more. One day shipping charges for 300 orders was $1,508. Find the number of packages in each category.

Page 24: Matrices

Sol:x = pkgs less or equal to 5 lbsy = pkgs between 5 and 10 lbsz = pkgs 10 lbs or more

x + y + z = 3002.9x + 5.2y + 8z = 1508x = .5z which changes to x - .5z = 0

D determinant| 1.......1......1 ||2.9....5.2....8 || 1.......0.... -.5|