Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

CSNB143 – Discrete Structure
Chapter Matrices Matrix Arithmetic
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.
1.7 Diagonal, Triangular, and Symmetric Matrices.
Mathematics. Matrices and Determinants-1 Session.
3_3 An Useful Overview of Matrix Algebra
Matrices MSU CSE 260.
Finding the Inverse of a Matrix
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
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.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
3.8 Matrices.
Chapter 1: Matrices Definition 1: A matrix is a rectangular array of numbers arranged in horizontal rows and vertical columns. EXAMPLE:
1.7 Diagonal, Triangular, and Symmetric Matrices 1.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
Overview Definitions Basic matrix operations (+, -, x) Determinants and inverses.
Matrices. Definitions  A matrix is an m x n array of scalars, arranged conceptually as m rows and n columns.  m is referred to as the row dimension.
13.1 Matrices and Their Sums
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
Company LOGO Chapter 1: Matrix, Determinant, System of linear equations Module 1: Matrix Natural Science Department Example 1: The following rectangular.
Matrices A matrix is a table or array of numbers arranged in rows and columns The order of a matrix is given by stating its dimensions. This is known as.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Chapter 6 Systems of Linear Equations and Matrices Sections 6.3 – 6.5.
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.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
Matrices: Simplifying Algebraic Expressions Combining Like Terms & Distributive Property.
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.
Unit 3 Matrix Arithmetic IT Disicipline ITD 1111 Discrete Mathematics & Statistics STDTLP 1 Unit 3 Matrix Arithmetic.
Matrices and Determinants
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.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
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.
MTH108 Business Math I Lecture 20.
CSE 504 Discrete Mathematics & Foundations of Computer Science
CSNB 143 Discrete Mathematical Structures
Matrices and Matrix Operations
MATRICES.
Linear Algebra Lecture 2.
Discrete Structures – CNS2300
1.5 Matricies.
Copyright © 2009 Dan Nettleton
Finding the Inverse of a Matrix
MATHEMATICS Matrix Multiplication
L6 matrix operations.
DETERMINANTS A determinant is a number associated to a square matrix. Determinants are possible only for square matrices.
Section 7.4 Matrix Algebra.
MATRICES MATRIX OPERATIONS.
2. Matrix Algebra 2.1 Matrix Operations.
MATRICES MATRIX OPERATIONS.
2.2 Introduction to Matrices
Matrices Introduction.
CS100: Discrete structures
Matrices and Matrix Operations
MATRICES Operations with Matrices Properties of Matrix Operations
Matrix Operations Chapter 4, Sections 1, 2, 3.
MATRICES MATRIX OPERATIONS.
Matrix Operations Ms. Olifer.
Applied Discrete Mathematics Week 4: Functions
Matrices and Determinants
Presentation transcript:

Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine

CSCI 1900 Lecture Lecture Introduction Reading –Rosen - Section 2.6 Definition of a matrix Examine basic matrix operations –Addition –Multiplication –Transpose Bit matrix operations –Meet –Join Matrix Inverse

CSCI 1900 Lecture Matrix M by N Matrix – a rectangular array of numbers arranged in m horizontal rows and n vertical columns, enclosed in square brackets We say A is a m by n matrix, written as m x n a 11 a 12 a a 1n a 21 a 22 a a 2n A = a m1 a m2 a m3 a mn

CSCI 1900 Lecture Matrix Example Let A = A has 2 rows and 3 columns –A is a 2 x 3 matrix First row of A is [1 3 5] The second column of A is 3

CSCI 1900 Lecture Matrix If m = n, then A is a square matrix of size n The main diagonal of a square matrix A is a 11 a 22 … a nn If every entry off the main diagonal is zero, i.e. a ik = 0 for i  k, then A is a diagonal matrix m = n = 7 square matrix and diagonal

CSCI 1900 Lecture Special Matrices Identity matrix – a diagonal matrix with 1’s on the diagonal; zeros elsewhere Zero matrix – matrix of all 0’s

CSCI 1900 Lecture Matrix Equality Two matrices A and B are equal when all corresponding elements are equal –A = B when a ik = b ik for all i, k 1  i  m, 1  k  n

CSCI 1900 Lecture Sum of Two Matrices To add two matrices, they must be the same size –Each position in the resultant matrix is the sum of the corresponding positions in the original matrices Properties –A+B = B+A –A+(B+C) = (A+B)+C –A+0 = 0+A (0 is the zero matrix)

CSCI 1900 Lecture Sum Example = ABResult

CSCI 1900 Lecture Sum Row 1 Col = ABResult = 15

CSCI 1900 Lecture Sum Row 1 Col = ABResult = 18

CSCI 1900 Lecture Sum Row 2 Col = ABResult = 16

CSCI 1900 Lecture Sum - Complete = ABResult = 20

CSCI 1900 Lecture Product of Two Matrices If A is a m x k matrix, then multiplication is only defined for B which is a k x n matrix –The result is an m x n matrix –If A is 5 x 3, then B must be a 3 x k matrix for any number k >0 –If A is a 56 x 31 and B is a 31 x 10, then the product AB will by a 56 x 10 matrix Let C = AB, then c 12 is calculated using the first row of A and the second column of B

CSCI 1900 Lecture Product Example 1 Example: Multiply a 3 x 2 matrix by a 2 x 3 matrix –The product is a 3 by 3 matrix

CSCI 1900 Lecture Product Example * = AB Result

CSCI 1900 Lecture Product Row 1 Col * = AB Result 2 * * 9 = 78

CSCI 1900 Lecture Product Row 1 Col * = AB Result 2 * * 11 = 98

CSCI 1900 Lecture Product Row 1 Col * = AB Result 2 * * 13 = 118

CSCI 1900 Lecture Product Row 2 Col * = AB Result 4 * * 9 = 102

CSCI 1900 Lecture Product - Complete * = AB Product 6 * * 13 = 198

CSCI 1900 Lecture Product Example 2 Let’s look at a 4 by 2 matrix and a 2 by 3 matrix Their product is a 4 by 3 matrix

CSCI 1900 Lecture Product Example *= ABProduct

CSCI 1900 Lecture Product Row 1 Col *= AB 2 * * 9 = 78 Product

CSCI 1900 Lecture Product Row 1 Col *= AB 2 * * 11 = 98 Product

CSCI 1900 Lecture Product Row 1 Col *= AB 2 * * 13 = 118 Product

CSCI 1900 Lecture Product Row 2 Col *= AB 4 * * 9 = 102 Product

CSCI 1900 Lecture Product - Complete *= AB 5 * * 13 = 74 Product

CSCI 1900 Lecture Summary of Matrix Multiplication In general, AB  BA –BA may not even be defined Properties –A(BC)=(AB)C –A(B+C)=AB+AC –(A+B)C=AC+BC

CSCI 1900 Lecture Boolean (Bit Matrix) Each element is either a 0 or a 1 Very common in CS Easy to manipulate

CSCI 1900 Lecture Join of Bit Matrices (OR)  = BRA

CSCI 1900 Lecture Meet of Bit Matrices (AND)  = BRA

CSCI 1900 Lecture Transpose The transpose of A, denoted A T, is obtained by interchanging the rows and columns of A Example T =

CSCI 1900 Lecture Transpose (cont) (A T ) T =A (A+B) T = A T +B T (AB) T = B T A T If A T =A, then A is symmetric

CSCI 1900 Lecture Inverse If A and B are n x n matrices and AB=I, we say B is the inverse of A The inverse of a matrix A, denoted A -1 It is not possible to define an inverse for every matrix

CSCI 1900 Lecture Inverse Matrix Example R1 C1:1* * *6 = 1 R1 C2:1*2 + 0*0 + 2*-1 = 0 R1 C3:1*2 + 0*1 + 2*-1 = 0 R2 C1:2* * *6 = 0 R2 C2:2*2 + -1* 0 + 3*-1 = 1 R2 C3:2*2 + -1* 1 + 3*-1 = 0 R3 C1:4* * *6 = 0 R3 C2:4*2 + 1*0 + 8*-1 = 0 R3 C3:4*2 + 1* 1 + 8*-1 = 1

CSCI 1900 Lecture Key Concepts Summary Definition of a matrix Examine basic matrix operations –Addition –Multiplication –Transpose Bit matrix operations –Meet –Join Matrix Inverse