480 likes | 868 Views
Discrete Structures – CNS2300. Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices. Section 2.7. Matrices. Matrix Definition.
E N D
Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5th Edition) Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
Section 2.7 Matrices
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.
2x3 3x2 1x5 2x2 Examples
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].
Examples Not Possible
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
3x2 2x3 3x3 Example
3x2 2x3 3x3 Example
3x2 2x3 Example 3x3
3x2 2x3 Example 3x3
Algorithm procedure matrix multiplication(A,B:matrices)for i:=1 to mbeginfor j:=1 to nbegin cij := 0for q := 1 to k cij := cij + aiqbqjendend
Identity Matrix Exist as square matrices. AI = IA = A
Transpose of a matrix The transpose of a square matrix A is labeled AT and is found by interchanging rows and columns.
Symmetric Matrices A square matrix A is called symmetric if A = AT.
Algorithm procedure matrix booleanProduct(A,B:matrices)for i:=1 to mbeginfor j:=1 to nbegin cij := 0for q := 1 to k cij := cij|| aiq&&bqjendend