Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c)2001-2004 Michael P. Frank Modified by (c) 2004-2005 Haluk Bingöl 1/21 Module.

Slides:



Advertisements
Similar presentations
CSNB143 – Discrete Structure
Advertisements

Chapter Matrices Matrix Arithmetic
Applied Informatics Štefan BEREŽNÝ
Mathematics. Matrices and Determinants-1 Session.
MF-852 Financial Econometrics
Maths for Computer Graphics
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 12 System of Linear Equations.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
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”)
Economics 2301 Matrices Lecture 13.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
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.
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
1 Statistical Analysis Professor Lynne Stokes Department of Statistical Science Lecture 5QF Introduction to Vector and Matrix Operations Needed for the.
Compiled By Raj G. Tiwari
February 25, 2002Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers How do we (humans) add two integers? Example: 7583.
ECON 1150 Matrix Operations Special Matrices
 Row and Reduced Row Echelon  Elementary Matrices.
2015 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) 행렬 (Matrices)
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
8.1 Matrices & Systems of Equations
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 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.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Module #9: Matrices Rosen 5 th ed., §2.7 Now we are moving on to matrices, section 7.
Discrete Mathematics 1 Kemal Akkaya DISCRETE MATHEMATICS Lecture 16 Dr. Kemal Akkaya Department of Computer Science.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Chapter 6 Systems of Linear Equations and Matrices Sections 6.3 – 6.5.
Notes 7.2 – Matrices I. Matrices A.) Def. – A rectangular array of numbers. An m x n matrix is a matrix consisting of m rows and n columns. The element.
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
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.
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.
CSNB143 – Discrete Structure Topic 3 – Matrices. Learning Outcomes Students should understand all matrices operations. Students should be able to differentiate.
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
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.
CS 450: COMPUTER GRAPHICS TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Section 2.4. Section Summary  Sequences. o Examples: Geometric Progression, Arithmetic Progression  Recurrence Relations o Example: Fibonacci Sequence.
MATRICES. Introduction Matrix algebra has several uses in economics as well as other fields of study. One important application of Matrices is that it.
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
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.
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices.
MTH108 Business Math I Lecture 20.
CSE 504 Discrete Mathematics & Foundations of Computer Science
Linear Algebraic Equations and Matrices
Discrete Structures – CNS2300
Rosen 5th ed., §2.7 ~18 slides, ~1 lecture
Sequences and Summations
MATRICES MATRIX OPERATIONS.
CS100: Discrete structures
Matrix Algebra.
[MATRICES ].
Discrete Mathematics and its Applications
Rosen 5th ed., §2.7 ~18 slides, ~1 lecture
[MATRICES ].
Applied Discrete Mathematics Week 4: Functions
Presentation transcript:

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/21 Module #10 - Matrices Bogazici University Department of Computer Engineering CmpE 220 Discrete Mathematics 10. Matrices Haluk Bingöl

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 2/21 Module #10 - Matrices Module #10: Matrices Rosen 5 th ed., §2.7 ~18 slides, ~1 lecture

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 3/21 Module #10 - Matrices §2.7 Matrices A matrix is a rectangular array of objects (usually numbers). An m  n (“m by n”) matrix has exactly m horizontal rows, and n vertical columns. Plural of matrix = matrices (say MAY-trih-sees) An n  n matrix is called a square matrix, whose order or rank is n. a 3  2 matrix Note: The singular form of “matrices” is “matrix,” not “MAY-trih-see”! Not our meaning!

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 4/21 Module #10 - Matrices Applications of Matrices Tons of applications, including: Solving systems of linear equations Computer Graphics, Image Processing Models within many areas of Computational Science & Engineering Quantum Mechanics, Quantum Computing Many, many more…

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 5/21 Module #10 - Matrices Matrix Equality Two matrices A and B are considered equal iff they have the same number of rows, the same number of columns, and all their corresponding elements are equal.

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 6/21 Module #10 - Matrices Row and Column Order The rows in a matrix are usually indexed 1 to m from top to bottom. The columns are usually indexed 1 to n from left to right. Elements are indexed by row, then column.

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 7/21 Module #10 - Matrices Matrices as Functions An m  n matrix A = [a i,j ] of members of a set S can be encoded as a partial function f A : N  N → S, such that for i<m, j<n, f A (i, j) = a i,j. By extending the domain over which f A is defined, various types of infinite and/or multidimensional matrices can be obtained.

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 8/21 Module #10 - Matrices Matrix Sums The sum A+B of two matrices A, B (which must have the same number of rows, and the same number of columns) is the matrix (also with the same shape) given by adding corresponding elements of A and B. A+B = [a i,j +b i,j ] A+B = [a i,j +b i,j ]

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 9/21 Module #10 - Matrices Matrix Products For an m  k matrix A and a k  n matrix B, the product AB is the m  n matrix: I.e., the element of AB indexed (i,j) is given by the vector dot product of the ith row of A and the jth column of B (considered as vectors). Note: Matrix multiplication is not commutative!

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 10/21 Module #10 - Matrices Matrix Product Example An example matrix multiplication to practice in class:

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 11/21 Module #10 - Matrices n n Identity Matrices The identity matrix of order n, I n, is the rank-n square matrix with 1’s along the upper-left to lower-right diagonal, and 0’s everywhere else. Kronecker Delta 1≤i,j≤n1≤i,j≤n

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 12/21 Module #10 - Matrices Review: §2.6 Matrices, so far Matrix sums and products: A+B = [a i,j +b i,j ] A+B = [a i,j +b i,j ] Identity matrix of order n: I n = [  ij ], where  ij =1 if i=j and  ij =0 if i  j.

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 13/21 Module #10 - Matrices Matrix Inverses For some (but not all) square matrices A, there exists a unique multiplicative inverse A −1 of A, a matrix such that A −1 A = I n. If the inverse exists, it is unique, and A −1 A = AA −1. We won’t go into the algorithms for matrix inversion...

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 14/21 Module #10 - Matrices Matrix Multiplication Algorithm procedure matmul(matrices A: m  k, B: k  n) for i := 1 to m for j := 1 to n begin c ij := 0 for q := 1 to k c ij := c ij + a iq b qj end {C=[c ij ] is the product of A and B} What’s the  of its time complexity?  (m)·  (n)·(  (1)+  (k) ·  (1)) Answer:  (mnk)

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 15/21 Module #10 - Matrices Powers of Matrices If A is an n  n square matrix and p  0, then: A p :  AAA···A (and A 0 :  I n ) Example: p times

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 16/21 Module #10 - Matrices If A=[a ij ] is an m  n matrix, the transpose of A (often written A t or A T ) is the n  m matrix given by A t = B = [b ij ] = [a ji ] (1  i  n,1  j  m) Matrix Transposition Flip across diagonal

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 17/21 Module #10 - Matrices Symmetric Matrices A square matrix A is symmetric iff A=A t. I.e.,  i,j  n: a ij = a ji. Which of the below matrices is symmetric?

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 18/21 Module #10 - Matrices Zero-One Matrices Useful for representing other structures. E.g., relations, directed graphs (later in this course) All elements of a zero-one matrix are either 0 or 1 Representing False & True respectively. The join of A, B (both m  n zero-one matrices): A  B :  [a ij  b ij ] The meet of A, B: A  B :  [a ij  b ij ] = [a ij b ij ] The 1’s in A join the 1’s in B to make up the 1’s in C. Where the 1’s in A meet the 1’s in B, we find 1’s in C.

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 19/21 Module #10 - Matrices Boolean Products Let A=[a ij ] be an m  k zero-one matrix, & let B=[b ij ] be a k  n zero-one matrix, The boolean product of A and B is like normal matrix , but using  instead of + in the row-column “vector dot product”: A⊙BA⊙B

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 20/21 Module #10 - Matrices Boolean Powers For a square zero-one matrix A, and any k  0, the kth Boolean power of A is simply the Boolean product of k copies of A. A [k] :  A ⊙ A ⊙ … ⊙ A A [0] :  I n k times

Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 21/21 Module #10 - Matrices References Rosen Discrete Mathematics and its Applications, 5e Mc GrawHill, 2003Rosen Discrete Mathematics and its Applications, 5e Mc GrawHill, 2003