Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3 3.8 Matrices ‒Matrix Arithmetic ‒Algorithms for Matrix Multiplication ‒Transposes and Powers of Matrices ‒Zero-One Matrices 1.

Similar presentations


Presentation on theme: "Chapter 3 3.8 Matrices ‒Matrix Arithmetic ‒Algorithms for Matrix Multiplication ‒Transposes and Powers of Matrices ‒Zero-One Matrices 1."— Presentation transcript:

1 Chapter Matrices ‒Matrix Arithmetic ‒Algorithms for Matrix Multiplication ‒Transposes and Powers of Matrices ‒Zero-One Matrices 1

2 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. 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. 2

3 Matrix Arithmetic Definition 2: Let The ith row of A is the 1 x n matrix [a i1,a i2,...,a in ]. The jth column of A is the n x 1 matrix The (i, j)th element or entry of is the element a ij, 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 =[a ij ], which indicates that A is the matrix with its (i, j)th element equal to a ij. 3

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

5 Matrix Arithmetic Definition 4 : Let A be an m x k matrix and B be k x n matrix. The product of 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=[c ij ], then c ij = a i1 b 1j + a i2 b 2j a ik b kj 5

6 Matrix Arithmetic 6

7 Algorithms for Matrix Multiplication Algorithm 1 : Matrix Multiplication procedure matrix multiplication (A, B: matrices) for i := 1 to m for j := 1 to n begin c ij :=0 for q := 1 to k c ij :=c ij + a iq b qj end {C= [c ij ] is the product of A and B} Example 6: In which order should the matrices A 1, A 2, and A 3, where A 1 is 30x20, A 2 is 20x40, A 3 is 40x10, all with integer entries – be multiplied to use the least number of multiplications of integers? 7

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

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

10 Symmetric Matrix 10

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

12 Zero-One Matrices Definition 9: Let A=[a ij ] be an m x k zero-one matrix and B=[b ij ] 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)th entry c ij where Example 10: find the Boolean product of A and B, where 12

13 Zero-One Matrices Algorithm 2: The Boolean Product procedure Boolean product(A, B: zero-one matrices) for i := 1 to m for j := 1 to n begin c ij :=0 for q := 1 to k end {C= [c ij ] is the Boolean product of A and B} 13

14 Zero-One Matrices Definition 10: Let A be a square zero-one matrix ant let r be a positive integer. The rth Boolean 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 I n 14

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


Download ppt "Chapter 3 3.8 Matrices ‒Matrix Arithmetic ‒Algorithms for Matrix Multiplication ‒Transposes and Powers of Matrices ‒Zero-One Matrices 1."

Similar presentations


Ads by Google