1 / 15

Chapter 3

Chapter 3. 3.8 Matrices Matrix Arithmetic Algorithms for Matrix Multiplication Transposes and Powers of Matrices Zero-One Matrices. Matrix Arithmetic. Definition 1: A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m × n matrix.

joanne
Download Presentation

Chapter 3

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. Chapter 3 • 3.8 Matrices • Matrix Arithmetic • Algorithms for Matrix Multiplication • Transposes and Powers of Matrices • Zero-One Matrices

  2. Matrix Arithmetic • Definition 1: • Amatrixis a rectangular array of numbers. • A matrix with m rows and n columns is called an m × n matrix. • The plural of matrix is matrices. A matrix with the same number of rows as columns is called square. • Two matrices are equal if they have the same number of rows and the same number of columns and the corresponding entries in every position are equal.

  3. Matrix Arithmetic • Definition 2: Let • The ith row of A is the 1 x n matrix [ai1,ai2,. . .,ain]. • The jth column of A is the n x 1 matrix The (i, j)thelementorentryof is the element aij, that is , the number in the ith row and jth column of A. A convenient shorthand notation for expressing the matrix A is to write A =[aij], which indicates that A is the matrix with its (i, j)th element equal toaij.

  4. Matrix Arithmetic • Definition 3: Let A=[aij] and B=[bij] be m x n matrices. The sum of A and B, denoted by A+B, is the m x n matrix that has aij+bij as its (i, j)th element. In other words, A+B= [aij+bij]. • Example 2: we have

  5. Matrix Arithmetic • Definition 4: • Let A be an m x k matrix and B be k x n matrix. • The productof A and B, denoted by AB, is the m x n matrix with its (i, j )th entry equal to the sum of the products of the corresponding elements from the ith row of A and the jth column of B. • In other words, if AB=[cij], then cij= ai1b1j + ai2b2j +. . . +aikbkj

  6. Matrix Arithmetic

  7. Algorithms for Matrix Multiplication • Algorithm 1 : Matrix Multiplication procedure matrix multiplication (A, B: matrices) for i := 1 tom for j := 1 ton begin cij :=0 forq := 1 tok cij:=cij+ aiqbqj end {C= [cij] is the product of A and B} • Example 6: In which order should the matrices A1, A2, and A3, where • A1 is 30x20 , A2 is 20x40 , A3is 40x10, • all with integer entries – be multiplied to use the least number of multiplications of integers?

  8. Transposes and Powers of Matrices • Definition 5: the identity matrix of order n is the n x n matrix In = [δij] where δij=1 ifi= j and δij= 0 if i ≠ j. Hence,

  9. Transposes and Powers of Matrices • Definition 6: Let A=[aij] be an m x n matrix. • The transpose of A, denoted by At, is the n x m matrix obtained by interchanging the rows and columns of A . • In other words, if At=[bij], then bij = aji for i=1,2,. . .,n and j = 1,2,. . .,m . • Definition 7:A square matrix A is called symmetric if A = At. • Thus A =[aij] is symmetric if aij = aji for all i and j with 1≤ i ≤ n and 1 ≤ j ≤ n .

  10. Symmetric Matrix

  11. Zero-One Matrices • Definition 8: Let A=[aij] and B=[bij] be m x n zero-one matrices. • Then thejoinof A and B is the zero-one matrix with (i , j )th entry aijv bij. The join of A and B is denoted by A v B. • The meetof A and B is the zero-one matrix with (i, j )th entry aijΛbij. The meet of A and B is denoted by AΛB.

  12. Zero-One Matrices • Definition 9: Let A=[aij] be an m x k zero-one matrix and B=[bij] be a k x n zero-one matrix . • Then the boolean product of A and B,denote by A⊙B , is the m x n matrix with with (i , j)thentry cij where • Example 10: find the Boolean product of A and B, where

  13. Zero-One Matrices • Algorithm 2: The Boolean Product procedure Boolean product(A, B: zero-one matrices) for i := 1 tom for j := 1 ton begin cij :=0 forq := 1 tok end {C= [cij] is the Boolean product of A and B}

  14. Zero-One Matrices • Definition 10: Let A be a square zero-one matrix ant let r be a positive integer. • The rthBoolean power of A is the Boolean product of r factors of A. The rth Boolean product of A is denoted by A[r] • Hence, • (this is well defined because the Boolean product of matrices is associative.) • We also define A[0] to be In

  15. Zero-One Matrices • Example 11: Let . Find A[n] for all positive integers n.

More Related