1 / 23

2.3 Matrix Multiplication

2.3 Matrix Multiplication. Background Example. We return to our Sweatshirt store example: We wish to find the value of the inventory by size Smalls - $10, Med - $11, Large - $12, XL - $13. How would we set up the mult. to do this?. Matrix Multiplication Algorithm.

ganesa
Download Presentation

2.3 Matrix Multiplication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2.3 Matrix Multiplication

  2. Background Example • We return to our Sweatshirt store example: • We wish to find the value of the inventory by size • Smalls - $10, Med - $11, Large - $12, XL - $13 • How would we set up the mult. to do this?

  3. Matrix Multiplication Algorithm • The mtx mult algorithm is defined to do just that: • (i,j): multiply entries in row i of first mtx by the corresponding entries in col j of second mtx, and then add terms. • Note that this is the dot product of row i and col j

  4. A few things to note • Given the way that the algorithm is defined, what must be true about the dimensions of the matrices in order for multiplication to work? • # of entries in each row of first matrix must equal # of entries in each column of second matrix • (i.e. number of columns of first matrix must equal the number of rows of second matrix) • So if multiplying matrices of following order: (a x b) x (c x d), b = c • Note: order of solution mtx is: a x d

  5. Example • Given matrices A and B, find the results of the following if possible: • A2 • B2 • AB • BA

  6. Example#2 • Given the matrices A and B, find AB and BA: • B is the identity matrix, I3, since AB = BA = A • The identity is always a square matrix with 1’s on the main diagonal and 0’s elsewhere. • I is only the identity for a matrix of the same size.

  7. Properties of Mtx Multiplication • IA = A, BI = B • A(BC) = (AB)C • A(B+C) = AB + AC, A(B-C) = AB - AC • (B+C)A = BA + CA, (B - C)A = BA - CA • k(AB) = (kA)B = A(kB) • (AB)T = BTAT • Note: commutativity does not hold (AB ≠ BA in most cases). • Therefore the order of the factors in a product of matrices makes a difference!

  8. Helpful Notation • To help us prove the properties, it is useful to understand the following notation for matrix multiplication. • A = [aij] is m x n, B = [bij] is n x p • ith row of A is [ ai1 ai2 …… ain] • jth column of B is:---------------------> • ij entry of prod mtx is dot prod of row i of A and col j of B:

  9. Proving Property 3 (also in book) • Property 3: A(B + C) = AB + AC • A is m x n, B is n x p, C is n x p • B + C = [bij + cij] • This is just the (i,j) entry of AB + the (i,j) entry of AC • Therefore A(B + C) = AB + AC 

  10. Matrix form of linear system • Try to write the following system as a single matrix equation: • A is coefficient mtx, X is solution mtx, B is constant mtx

  11. Precursor to Theorem 2 • If X1 is a sol’n to AX=B and X0 is a sol’n to the related homogeneous system AX = 0, then: • X1 + X0 is a solution to AX = B: • Theorem 2 is a converse of this.

  12. Theorem 2 • If X1 is a sol’n to AX=B, then every solution, X2, to AX=B is of the form: • X2 = X1 + X0 where X0 is a solution to the associated homogeneous system AX=0.

  13. Proof of Theorem 2 • If X2 and X1 are both sol’ns to AX=B, • So AX1 = B and AX2 = B: • say X0 = X2 - X1 so X2 = X0+X1 • AX0 = A(X2 - X1) = AX2 - AX1= B - B = 0 • Therefore, X0 is a solution to the associated homogeous system AX = 0. 

  14. Example • Express every solution to the following system as the sum of a specific solution plus a solution to the associated homogeneous system.

  15. Solution • If we take t=0, we get a specific solution, X1 • Therefore, if t≠0, the solution, X2 = X1 + X0 where X0 is a solution to the associated homogeneous stm: AX = 0 • So, gives all sol’ns to assoc. hom. System • (Show)

  16. Example • Find row 3 and column 2 of AB. • In many situations, it is helpful to write a matrix as a column of rows or as a row of columns:

  17. Simplifying Notation • So then we can use the following notation in mtx mult:

  18. A further simplification • We can partition a matrix into smaller blocks:

  19. Continuing the Example • We need to make sure that the way we partition the matrices allows us to multiply matrices which match up appropriately by dimension. (show)

  20. Another Block Multiplication Ex. • Go through ex. 11 with finding powers of mtx: • Find A8

  21. Example continued • This was convenient since we have a 0 matrix • This was convenient since we had a diagonal matrix

  22. Finally...

  23. Other topics in homework • Trace: sum of elements on main diagonal of square mtx • Idempotent: square mtx,P, is idempotent if P2 = P

More Related