copyright © 2006 brooks/cole, a division of thomson learning, inc. 2.5 matrix multiplication size...

8
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B is a matrix of size n x p (note: the column size of A must equal the row size of B), then the product AB will be a matrix of size m x p. Example. Matrix A size 3 x 2 and matrix B size 2 x 5 The product AB will be a matrix of size 3 x 5 Example. Matrix A size 3 x 4 and matrix B size 3 x 4 The product AB can’t be computed

Upload: walter-bradley

Post on 19-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

2.5 Matrix Multiplication

Size of the product: If A is a matrix of size m x n and B is a matrix of size n x p (note: the column size of A must equal the row size of B), then the product AB will be a matrix of size m x p.

Example. Matrix A size 3 x 2 and matrix B size 2 x 5

The product AB will be a matrix of size 3 x 5

Example. Matrix A size 3 x 4 and matrix B size 3 x 4

The product AB can’t be computed

Page 2: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

For matrices A, B, and C, let AB = C.

11 12 13

21 22 23

31 32 33

a a a

A a a a

a a a

11 12

21 22

31 32

b b

B b b

b b

11 12

21 22

31 32

c c

C c c

c c

Then

11 11 11 12 21 13 31c a b a b a b

12 11 12 12 22 13 32c a b a b a b

21 21 11 22 21 23 31c a b a b a b

And so on…

Page 3: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

Example. Given matrices B and C find BC and CB.

1 3

2 5B

1 2

4 0C

Note: in general, for any two square matrices B and C

BC CB

Page 4: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

Laws for Matrix Multiplication

If the products and sums are defined for matrices A, B, and C we have the Associative law (AB)C = A(BC) and the Distributive law: A(B + C) = AB + AC.

The identity matrix of size n is given by

1 0 . . . 0

0 1 . . . 0

. . . . . .

. . . . . .

. . . . . .

0 0 . . . 1

nI

In A = A and BIn = B where defined.

Diagonal of 1’s

Page 5: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

Matrix Equation Representation of a System of Linear Equations

2 3

3 2 4

2 3 1

x y z

x y z

x y z

1 1 2

3 2 1

2 3 1

3

4

1

x

y

z

AX = B

Page 6: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

Three network consultants, Alan, Maria, and Steven, each received a year-end bonus of $10,000, which they decided to invest in a (401)K retirement plan sponsored by their employer. Under this plan, each employee is allowed to place their investments in three funds-an equity index fund (I), a growth fund (II), and a global equity fund (III). The allocations of the investments (in dollars) of the three employees at the beginning of the year are summarized in the matrix

4000 3000 3000

2000 5000 3000

2000 3000 5000

A

I II III

Alan

Maria

Steven

The return of the three funds after 1 yr is 18% for fund I, 24% for fund II, and 12% for fund III.

Page 7: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

a. Write a column vector B representing the returns of the three funds after 1 year.

b. Which employee realize the best returns on his or her investment for the year in questions? The worst return?

Solution: (a)

Page 8: Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. 2.5 Matrix Multiplication Size of the product: If A is a matrix of size m x n and B

Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc.

(b)