MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.

Slides:



Advertisements
Similar presentations
Rules of Matrix Arithmetic
Advertisements

CSNB143 – Discrete Structure
Chapter Matrices Matrix Arithmetic
February 26, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2. a 0 + b.
Applied Informatics Štefan BEREŽNÝ
1 Section 7.3 Representing relations (part 1: matrices)
Matrix Definition: An array of numbers in m rows and n colums is called an mxn matrix A square matrix of order n, is an (nxn) matrix.
Mathematics. Matrices and Determinants-1 Session.
1 Matrices Rosen 6 th ed., §3.8 2 Matrices A matrix is a rectangular array of numbers.A matrix is a rectangular array of numbers. An m  n (“m by n”)
CALCULUS – II Matrix Multiplication by Dr. Eman Saad & Dr. Shorouk Ossama.
Matrices MSU CSE 260.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
3.8 Matrices.
Chapter 1: Matrices Definition 1: A matrix is a rectangular array of numbers arranged in horizontal rows and vertical columns. EXAMPLE:
Division in the Integers Theorem 1. If n and m are integers and n>0, then m=qn+r for unique integers q and r with 0
CSE 504 Discrete Mathematics & Foundations of Computer Science
February 25, 2002Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers How do we (humans) add two integers? Example: 7583.
Systems of Linear Equation and Matrices
Chapter 3: The Fundamentals: Algorithms, the Integers, and Matrices
A rectangular array of numbers (we will concentrate on real numbers). A nxm matrix has ‘n’ rows and ‘m’ columns What is a matrix? First column First row.
Matrices. A matrix, A, is a rectangular collection of numbers. A matrix with “m” rows and “n” columns is said to have order m x n. Each entry, or element,
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/21 Module.
Matrices Matrices A matrix (say MAY-trix) is a rectan- gular array of objects (usually numbers). An m  n (“m by n”) matrix has exactly m horizontal.
2009/9 1 Matrices(§3.8)  A matrix is a rectangular array of objects (usually numbers).  An m  n (“m by n”) matrix has exactly m horizontal rows, and.
Module #9: Matrices Rosen 5 th ed., §2.7 Now we are moving on to matrices, section 7.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
CSCI 171 Presentation 9 Matrix Theory. Matrix – Rectangular array –i th row, j th column, i,j element –Square matrix, diagonal –Diagonal matrix –Equality.
For real numbers a and b,we always have ab = ba, which is called the commutative law for multiplication. For matrices, however, AB and BA need not be equal.
2 2.1 © 2012 Pearson Education, Inc. Matrix Algebra MATRIX OPERATIONS.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
Chapter 2 … part1 Matrices Linear Algebra S 1. Ch2_2 2.1 Addition, Scalar Multiplication, and Multiplication of Matrices Definition A matrix is a rectangular.
CSNB143 – Discrete Structure Topic 3 – Matrices. Learning Outcomes Students should understand all matrices operations. Students should be able to differentiate.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Matrices and Determinants
Linear Algebra Chapter 2 Matrices.
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Section 2.4. Section Summary  Sequences. o Examples: Geometric Progression, Arithmetic Progression  Recurrence Relations o Example: Fibonacci Sequence.
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
MATRICES A rectangular arrangement of elements is called matrix. Types of matrices: Null matrix: A matrix whose all elements are zero is called a null.
2.1 Matrix Operations 2. Matrix Algebra. j -th column i -th row Diagonal entries Diagonal matrix : a square matrix whose nondiagonal entries are zero.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
Matrices Introduction.
CSE 504 Discrete Mathematics & Foundations of Computer Science
CSNB 143 Discrete Mathematical Structures
4.5 Matrices.
1.4 Inverses; Rules of Matrix Arithmetic
Discrete Structures – CNS2300
Rules of Matrix Arithmetic
1.5 Matricies.
4.6 Matrices.
L6 matrix operations.
Rosen 5th ed., §2.7 ~18 slides, ~1 lecture
Sequences and Summations
2. Matrix Algebra 2.1 Matrix Operations.
CS100: Discrete structures
Matrices and Matrix Operations
Rosen 5th ed., §2.7 ~18 slides, ~1 lecture
3.8 Matrices L Al-zaid Math1101.
Applied Discrete Mathematics Week 4: Functions
Matrices and Determinants
Presentation transcript:

MATRICES

Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m rows and n columns is called an m x n matrix. The plural of matrix is matrices. The i th row of A is the 1× n matrix [a i1, a i2,…, a in ], 1≤ i ≤ m. The j t h column of A is the m × 1 matrix:, 1≤ j ≤ n. 2 Example: The matrix is a 3 x 2 matrix.

Matrices We refer to the element in the i th row and j t h column of the matrix A as a ij or as the (i, j) entry of A, and we often write it as A= [a ij ]. A matrix with the same number of rows as columns is called square matrix, whose order is n. 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222 3

Then A is 2 x 3 with a 12 = 3 and a 23 = 2, B is 2 x 2 with b 21 = 4, C is 1 x 4, D is 3 x 1, and E is 3 x 3 Then A is 2 x 3 with a 12 = 3 and a 23 = 2, B is 2 x 2 with b 21 = 4, C is 1 x 4, D is 3 x 1, and E is 3 x 3 Example 1 4

A square matrix A = [a ij ] for which every entry off the main diagonal is zero, that is, a ij = 0 for i ≠ j, is called a diagonal matrix Example Diagonal Matrix 5

Example of Matrix applications Matrices are used in many applications in computer science, and we shall see them in our study of relations and graphs. At this point, we present the following simple application showing how matrices can be used to display data in a tabular form 6

Cont’d The following matrix gives the airline distance between the cities indicated 7

Matrix Equality Two m x n matrices A = [a ij ] and B = [b ij ] are said to be equal if a ij = b ij, 1 ≤ i ≤ m, 1 ≤ j ≤ n; that is, if corresponding elements in every position are the same. 8

Then A = B if and only if x=-3, y=0, and z=6 Cont’d If 9

The sum of two matrices of the same size is obtained by adding elements in the corresponding positions. Matrices of different sizes cannot be added. 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 ]. Matrix Arithmetic 10

Example 2 Example 1 11

Zero Matrix A matrix all of whose entries are zero is called: a zero matrix and is denoted by 0 Each of the following is Zero matrix: 12

Properties of Matrix Addition A + B = B + A (A + B) + C = A + (B + C) A + 0 = 0 + A = A A + B = B + A (A + B) + C = A + (B + C) A + 0 = 0 + A = A 13

The product of the two matrices is not defined when the number of columns in the first matrix and the number of rows in the second matrix is not the same. DEFINITION 4: Let A be an m x k matrix and B be a 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 I th row of A and the j th 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. Matrices Production 14 NOTE: Matrix multiplication is not commutative!

Cont’d 15

Cont’d Example: Let A = and B = Find AB if it is defined. AB = 16 4×3 3×2 4×2

Cont’d Example: 17 2×33×42×4

Matrices If A and B are two matrices, it is not necessarily true that AB and BA are the same. E.g. if A is 2 x 3 and B is 3 x 4, then AB is defined and is 2 x 4, but BA is not defined. Even when A and B are both n x n matrices, AB and BA are not necessarily equal. Example: Let A 2x2 = and B 2x2= Does AB = BA? Solution: AB = and BA = 18

Properties of Multiplication If A = m x p matrix, and B is a p x n matrix, then AB can be computed and is an m x n matrix. As for BA, we have four different possibilities: 1. BA may not be defined; we may have n ≠ m 2. BA may be defined if n = m, and then BA is p x p, while AB is m x m and p ≠ m. Thus AB and BA are not equal 3. AB and BA may both the same size, but not equal as matrices AB ≠ BA 4. AB = BA 19

Basic Properties of Multiplication The basic properties of matrix multiplication are given by the following theorem: 1. A(BC) = (AB)C 2. A(B + C)= AB + AC 3. (A + B)C = AC + BC 20

Identity Matrix The n×n diagonal matrix all of whose diagonal elements are 1 and 0’s everywhere else, is called the identity matrix of order n, denoted by I n. A I n = A Multiplying a matrix by an appropriately sized identity matrix does not change this matrix. In other words, when A is an m x n matrix, we have  A I n = I m A = A 21

Powers of Matrices Powers of square matrices can be defined. If A is an n  n square matrix and p  0, we have A p  AAA ··· A A 0 nxn = I n  square matrix to the zero power is identity matrix. Example: p times 22

Powers of Matrices cont. If p and q are nonnegative integers, we can prove the following laws of exponents for matrices: A p A q = A p+q (A p ) q =A pq Observe that the rule (AB) p =A p B p does not hold for square matrices unless AB = BA. If AB = BA, then (AB) p =A p B p. 23

Example: The transpose of the matrix is the matrix Example 2: Let, Find A t. 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. 24 Transpose Matrices

Properties for Transpose If A and B are matrices, then 25

Example: The matrix is symmetric. Example : 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. Symmetric Matrices 26

Symmetric Matrices Which is symmetric? A B C 27

Boolean Matrix Operation A matrix with entries that are either 0 or 1 is called a Boolean matrix or zero-one matrix. 0 and1 representing False & True respectively. A matrix with entries that are either 0 or 1 is called a Boolean matrix or zero-one matrix. 0 and1 representing False & True respectively. Example: The operations on zero-one matrices is based on the Boolean operations v and ^, which operate on pair of bits.

Boolean Matrix Operations- OR Let A = [a ij ] and B = [b ij ] be m x n Boolean matrices. 1.We define A v B = C = [ Cij], the join of A and B, by 1 if a ij = 1 or b ij = 1 C ij = 0 if a ij and b ij are both 0 29

Example Find the join of A and B: A = B = The join between A and B is A  B = = 1 v 0 0 v 1 1 v 0 = v 1 1 v 1 0 v

Boolean Matrix Operations- Meet We define A ^ B = C = [ C ij ], the meet of A and B, by 1 if a ij and b ij are both 1 C ij = 0 if a ij = 0 or b ij = 0 Meet & Join are the same as the addition procedure Each element with the corresponding element in the other matrix Matrices have the same size 31

Example Find the meet of A and B: A = 1 0 1B = A v B = 1 ^ 0 0 ^ 1 1 ^ 0 = ^ 1 1 ^ 1 0 ^

Boolean PRODUCT The Boolean product of A and B, denoted, is the m x n Boolean matrix defined by: 1 if a ik = 1 and b kj = 1 for some k, 1 ≤ k ≤ p C ij 0 otherwise The Boolean product of A and B is like normal matrix product, but using  instead + and using  instead . Procedure: Select row i of A and column j of B, and arrange them side by side Compare corresponding entries. If even a single pair of corresponding entries consists of two 1’s, then C ij = 1, otherwise C ij = 0 33 A⊙BA⊙B

Example Find the Boolean product of A and B: A 3x2= 1 0 B 2x3 = x3 = (1 ^ 1) v (0 ^ 0) (1 ^ 1) v (0 ^ 1) (1 ^ 0) v (0 ^ 1) (0 ^ 1) v (1 ^ 0) (0 ^ 1) v (1 ^ 1) (0 ^ 0) v (1 ^ 1) (1 ^ 1) v (0 ^ 0) (1 ^ 1) v (0 ^ 1) (1 ^ 0) v (0 ^ 1) = A⊙BA⊙B

Boolean Operations Properties If A, B, and C are Boolean Matrices with the same sizes, then a. A v B = B v A b. A ^ B = B ^ A c. (A v B) v C = A (B v C) d. (A ^ B) ^ C = A ^ (B ^ C) 35

Boolean Powers For a square zero-one matrix A, and any k  0, the k th Boolean power of A is simply the Boolean product of k copies of A. A [k]  A ⊙ A ⊙ … ⊙ A k times 36

Example Find A [n] for all positive integers n. Solution: We find that We also find that : Additional computation shows that We can notice that A [n] = A [5] for all positive integers n with n ≥ 5 37

Any Question Refer to chapter 3 of the book for further reading