Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Structures – CNS2300

Similar presentations


Presentation on theme: "Discrete Structures – CNS2300"— Presentation transcript:

1 Discrete Structures – CNS2300
Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5th Edition) Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices

2 Section 2.7 Matrices

3 Matrix Definition A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an mxn 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.

4 Examples 3x2 2x3 2x2 1x5

5 Sum of two matrices Let A = [aij] and B = [bij] be mxn matrices. The sum of A and B, is the mxn matrix that has aij + bij as its (i,j)th element. In other words, A + B = [aij + bij].

6 Examples

7 Examples Not Possible

8 Matrix Multiplication
Let A be an mxk matrix and B be a kxn matrix. The product of A and B, denoted by AB, is the mxn matrix with (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

9 Example 3x3 3x2 2x3

10 Example 3x3 3x2 2x3

11 Example 3x2 2x3 3x3

12 Example 3x2 2x3 3x3

13 Algorithm procedure matrix multiplication(A,B:matrices) for i:=1 to m begin for j:=1 to n begin cij := for q := 1 to k cij := cij + aiqbqj end end

14 Identity Matrix Exist as square matrices. AI = IA = A

15 Transpose of a matrix The transpose of a square matrix A is labeled AT and is found by interchanging rows and columns.

16 Symmetric Matrices A square matrix A is called symmetric if A = AT.

17 Zero-one Matrices

18 Join of two zero-one matrices

19 Join

20 Meet of two zero-one matrices

21 Boolean Product

22 Algorithm procedure matrix booleanProduct(A,B:matrices) for i:=1 to m begin for j:=1 to n begin cij := for q := 1 to k cij := cij || aiq&&bqj end end

23 Boolean Product =

24 finished


Download ppt "Discrete Structures – CNS2300"

Similar presentations


Ads by Google