CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

Similar documents
Phys 201. Matrices and Determinants

Matrix Arithmetic. j=1

Countable and uncountable sets. Matrices.

Mathematics 13: Lecture 10

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Matrices: 2.1 Operations with Matrices

Section Summary. Sequences. Recurrence Relations. Summations Special Integer Sequences (optional)

. a m1 a mn. a 1 a 2 a = a n

ICS 6N Computational Linear Algebra Matrix Algebra

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

Matrix Multiplication

ICS141: Discrete Mathematics for Computer Science I

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

Elementary maths for GMT

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

Matrix operations Linear Algebra with Computer Science Application

Section 9.2: Matrices. Definition: A matrix A consists of a rectangular array of numbers, or elements, arranged in m rows and n columns.

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

MATRICES. a m,1 a m,n A =

Matrix representation of a linear map

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

Chapter 2. Ma 322 Fall Ma 322. Sept 23-27

1 Matrices and matrix algebra

Matrices and Vectors

Countable and uncountable sets. Matrices.

Matrices. Math 240 Calculus III. Wednesday, July 10, Summer 2013, Session II. Matrices. Math 240. Definitions and Notation.

Math 4377/6308 Advanced Linear Algebra

Matrices. Chapter Definitions and Notations

Matrices and Determinants

Matrix representation of a linear map

Linear Algebra and Matrix Inversion

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Matrix & Linear Algebra

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES

Homework 1 Elena Davidson (B) (C) (D) (E) (F) (G) (H) (I)

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

7.6 The Inverse of a Square Matrix

MATH2210 Notebook 2 Spring 2018

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

Elementary Row Operations on Matrices

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

Matrices BUSINESS MATHEMATICS

4016 MATHEMATICS TOPIC 1: NUMBERS AND ALGEBRA SUB-TOPIC 1.11 MATRICES

Prepared by: M. S. KumarSwamy, TGT(Maths) Page

Matrices and Linear Algebra

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

Pre-Calculus I. For example, the system. x y 2 z. may be represented by the augmented matrix

Lecture 6: Geometry of OLS Estimation of Linear Regession

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

Math 3191 Applied Linear Algebra

Numerical Analysis Lecture Notes

Section 9.2: Matrices.. a m1 a m2 a mn

CLASS 12 ALGEBRA OF MATRICES

MAC Module 2 Systems of Linear Equations and Matrices II. Learning Objectives. Upon completing this module, you should be able to :

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

7.3. Determinants. Introduction. Prerequisites. Learning Outcomes

Calculus II - Basic Matrix Operations

Linear Equations in Linear Algebra

Review of Linear Algebra

Lecture 3: Matrix and Matrix Operations

Lecture 3 Linear Algebra Background

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

Knowledge Discovery and Data Mining 1 (VO) ( )

Lecture Notes in Linear Algebra

A matrix over a field F is a rectangular array of elements from F. The symbol

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

Exercise Set Suppose that A, B, C, D, and E are matrices with the following sizes: A B C D E

Math 360 Linear Algebra Fall Class Notes. a a a a a a. a a a

MATRICES The numbers or letters in any given matrix are called its entries or elements

Materials engineering Collage \\ Ceramic & construction materials department Numerical Analysis \\Third stage by \\ Dalya Hekmat

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Math "Matrix Approach to Solving Systems" Bibiana Lopez. November Crafton Hills College. (CHC) 6.3 November / 25

Matrix Algebra & Elementary Matrices

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

Multiplying matrices by diagonal matrices is faster than usual matrix multiplication.

Systems of Linear Equations and Matrices

CS 246 Review of Linear Algebra 01/17/19

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Matrix Algebra: Definitions and Basic Operations

Systems of Linear Equations and Matrices

Elementary Linear Algebra

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Chapter 2: Matrices and Linear Systems

8.4. Systems of Equations in Three Variables. Identifying Solutions 2/20/2018. Example. Identifying Solutions. Solving Systems in Three Variables

MAC Module 1 Systems of Linear Equations and Matrices I

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

CHAPTER 6. Direct Methods for Solving Linear Systems

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

PH1105 Lecture Notes on Linear Algebra.

POLI270 - Linear Algebra

Algebra & Trig. I. For example, the system. x y 2 z. may be represented by the augmented matrix

MAT 2037 LINEAR ALGEBRA I web:

Matrices. 1 a a2 1 b b 2 1 c c π

Linear Algebra Review

Transcription:

CS100: DISCRETE STRUCTURES Lecture 3 Matrices Ch 3 Pages: 246-262

Matrices 2 Introduction DEFINITION 1: A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m x n matrix. The plural of matrix is matrices. A matrix with the same number of rows as columns is called square. Two matrices are equals if they have the same number of rows and the same number of columns and the corresponding entries in every position are equal. Example: The matrix é1 0 ë 1 1ù 2 3û is a 3 x 2 matrix.

Matrices 3 DEFINITION 2:

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

Exercise 5 Let 1) What size is A? 3 4 2) What is the third column of A? 3) What is the second row of A? 4) What is the element of A in the (3,2) th position? A(3,2)=1

Diagonal Matrix 6 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 :

Identity Matrix 7 The n x n diagonal matrix all of whose diagonal elements are 1, is called the identity matrix of order n. 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 AI n = I m A = A Powers of square matrices can be defined. When A is a n n x n matrix, we have A 0 = I n, A r = AAAA A (r times)

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

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

Equal Matrices 10 DEFINITION 2: 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 are the same. Notice how easy it is to state the definition using generic elements a ij, b ij Two matrices are equal if : they have the same dimension or order and the corresponding elements are identical.

Cont d 11 Then A = B if and only if X=-3, y=0, and z=6

Matrices 12 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 ]. v The sum of two matrices of the same size is obtained by adding elements in the corresponding positions. v Matrices of different sizes can t be added.

Example 1 = û ù ë é - - - + û ù ë é - - 2 1 1 0 3 1 1 4 3 0 4 3 3 2 2 1 0 1 Example 2 13 û ù ë é - - - 2 5 2 3 1 3 2 4 4

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

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

Matrices Production 16 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 i th column of B. In other words, if AB = [c ij ], then c ij = a i1 b 1j + a i2 b 2j + + ai k b kj.

Matrices Production 17 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.

18 Matrices Production

19 AB=

Matrices Production Example: Let A 4X3 = and B 3X2 = Find AB if it is defined. AB = û ù ë é 2 2 0 0 1 3 1 1 2 4 0 1 û ù ë é 0 3 1 1 4 2 20 û ù ë é 2 8 13 7 9 8 4 14

Exercise 21 Consider the matrices A=,C=,B= Find the following: 2A= 4A + B = A+0=

Matrices Production 22 DEFINITION 5: 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: é1 1ù Let A 2x2 = and B 2x2 = ë2 1û Does AB = BA? Solution: é3 2ù AB = and BA = ë5 3û é4 ë3 3ù 2 û é2 ë1 1ù 1 û

Properties of Multiplication 23 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 For Example : A=4x5, B=5x6 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 For Example : A=4x5, B=5x4 3. AB and BA may both the same size, but not equal as matrices AB BA 4. AB = BA For Example : A=4x4, B=4x4

Basic Properties of Multiplication 24 The basic properties of matrix multiplication are given by the following theorem: a. A(BC) = (AB)C b. A(B + C)= AB + AC c. (A + B)C = AC + BC

Transpose Matrices 25 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 At = [b ij ], then b ij = a ji, for i = 1,2,,n and j = 1,2,,m. Example: The transpose of the matrix é1 ë4 2 5 3ù 6 û is the matrix é1 2 ë 3 4ù 5 6û

Properties for Transpose 26 If A and B are matrices, then 1. A % % = A 2. (A + B) % = A % + B % 3. (AB) % = B % A %

Exercises = = = 27 Consider the matrices : A=,B=,C= Find the following: C % (A + B) % 1 2 5 3 4 2 1 1 4 0 3 2 2 2 3 + 6 4 3 8 2 1 5 7 2 = 5 5 7 8 1 3 7 5 5

Symmetric Matrices 28 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. Example: The matrix é1 1 ë 0 1 0 1 0ù 1 0û is symmetric. Example

29 The Transpose of a Symmetric Matrix

Boolean Matrix Operation 30 A Boolean matrix is an m x n matrix whose entries are either zero or one. Example: 1 0 1 0 0 1 1 1 0

Boolean Matrix Operations (join) 31 v Let A = [a ij ] and B = [b ij ] be m x n Boolean matrices. v We define A v B = C = [ C ij ], 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

Example 32 Find the join of A and B: 1 0 1 A = 0 1 0 B = 0 1 0 1 1 0 A v B = 1v0 0v1 1v0 0v1 1v1 0v0 = 1 1 1 1 1 0

Boolean Matrix Operations (Meet) 33 v 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 v Meet & Join are the same as the addition procedure each element with the corresponding element in the other matrix Matrices have the same size

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

Boolean PRODUCT 35 The Boolean product of A and B, denoted, A B is the m x n Boolean matrix defined by Procedure: C ij = < 1, if a ik = 1 and bkj = 1 for some k,1 k p 0, Otherwise 1. Select row i of A and column j of B, and arrange them side by side. 2. Compare corresponding entries. If even a single pair of corresponding entries consists of two 1 s, then C ij = 1, otherwise C ij = 0

Example 36 Find the Boolean product of A and B: A B 3x3 = = 1 0 0 1 1 0 A 3x2 = B 2x3 = 1 1 0 0 1 1 (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) 1 1 0 0 1 1 1 1 0

Boolean Operations Properties 37 If A, B, and C are Boolean Matrices with the same sizes, then 1. A v B = B v A 2. A ^ B = B ^ A 3. (A v B) v C = A v (B v C) 4. (A ^ B) ^ C = A ^ (B ^ C)

= Exercises = 38 Find meet and join for A and B: Solution : Meet of A and B = join of A and B =

Find = Exercises = 39 Find A B Solution: A B =

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