ICS141: Discrete Mathematics for Computer Science I

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

Phys 201. Matrices and Determinants

Mathematics 13: Lecture 10

Matrices BUSINESS MATHEMATICS

Matrices and systems of linear equations

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

Matrices. Chapter Definitions and Notations

Quantum Computing Lecture 2. Review of Linear Algebra

ICS141: Discrete Mathematics for Computer Science I

Stage-structured Populations

Matrices and Vectors

ICS 6N Computational Linear Algebra Matrix Algebra

1 Matrices and matrix algebra

Matrix Multiplication

Matrix representation of a linear map

What is the Matrix? Linear control of finite-dimensional spaces. November 28, 2010

ICS141: Discrete Mathematics for Computer Science I

Matrix representation of a linear map

ICS141: Discrete Mathematics for Computer Science I

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

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

CS 246 Review of Linear Algebra 01/17/19

Lecture 3 Linear Algebra Background

Elementary maths for GMT

Image Registration Lecture 2: Vectors and Matrices

Finite Math - J-term Section Systems of Linear Equations in Two Variables Example 1. Solve the system

Lecture 3: Matrix and Matrix Operations

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

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

Chapter 2 - Basics Structures

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

CSCI 239 Discrete Structures of Computer Science Lab 6 Vectors and Matrices

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

MATH2210 Notebook 2 Spring 2018

Linear Algebra V = T = ( 4 3 ).

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

ICS141: Discrete Mathematics for Computer Science I

Linear Algebra Review. Vectors

POLI270 - Linear Algebra

ICS141: Discrete Mathematics for Computer Science I

Matrices: 2.1 Operations with Matrices

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

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

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

Lecture Notes in Linear Algebra

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

ICS141: Discrete Mathematics for Computer Science I

Matrices and Determinants

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

10: Representation of point group part-1 matrix algebra CHEMISTRY. PAPER No.13 Applications of group Theory

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

Ma/CS 6b Class 20: Spectral Graph Theory

Countable and uncountable sets. Matrices.

Knowledge Discovery and Data Mining 1 (VO) ( )

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

CLASS 12 ALGEBRA OF MATRICES

Numerical Analysis Lecture Notes

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.

Elementary Row Operations on Matrices

Quick Tour of Linear Algebra and Graph Theory

Lecture 15 Review of Matrix Theory III. Dr. Radhakant Padhi Asst. Professor Dept. of Aerospace Engineering Indian Institute of Science - Bangalore

Matrix & Linear Algebra

A Review of Matrix Analysis

Ma/CS 6b Class 20: Spectral Graph Theory

is a 3 4 matrix. It has 3 rows and 4 columns. The first row is the horizontal row [ ]

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

Mathematical Principles for Scientific Computing and Visualization

DM559 Linear and Integer Programming. Lecture 3 Matrix Operations. Marco Chiarandini

Chapter 2. Linear Algebra. rather simple and learning them will eventually allow us to explain the strange results of

Getting Started with Communications Engineering. Rows first, columns second. Remember that. R then C. 1

Basic Linear Algebra in MATLAB

MAC Module 1 Systems of Linear Equations and Matrices I

ECS130 Scientific Computing. Lecture 1: Introduction. Monday, January 7, 10:00 10:50 am

Graphics (INFOGR), , Block IV, lecture 8 Deb Panja. Today: Matrices. Welcome

Computational Foundations of Cognitive Science. Definition of the Inverse. Definition of the Inverse. Definition Computation Properties

Matrix Arithmetic. j=1

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

Linear Algebra and Matrix Inversion

Lecture 9: Submatrices and Some Special Matrices

Cyclic Redundancy Check Codes

Quick Tour of Linear Algebra and Graph Theory

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

Countable and uncountable sets. Matrices.

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

MAT 2037 LINEAR ALGEBRA I web:

All of my class notes can be found at

Elementary Linear Algebra

MAC1105-College Algebra. Chapter 5-Systems of Equations & Matrices

CHAPTER 9: Systems of Equations and Matrices

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

MATH 320, WEEK 7: Matrices, Matrix Operations

ICS141: Discrete Mathematics for Computer Science I

A primer on matrices

Relations Graphical View

ELEMENTARY LINEAR ALGEBRA

This operation is - associative A + (B + C) = (A + B) + C; - commutative A + B = B + A; - has a neutral element O + A = A, here O is the null matrix

Definition 2.3. We define addition and multiplication of matrices as follows.

Review of Linear Algebra

Transcription:

ICS4: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by McGraw-Hill ICS 4: Discrete Mathematics I Fall -

Lecture 9 Chapter. The Fundamentals.8 Matrices ICS 4: Discrete Mathematics I Fall -

.8 Matrices n A matrix is a rectangular array of objects (usually numbers). n An m n ( m by n ) matrix has exactly m horizontal rows, and n vertical columns. 5 7 A matrix n Plural of matrix matrices (say MAY-trih-sees) n An n n matrix is called a square matrix ICS 4: Discrete Mathematics I Fall -

Applications of Matrices n Tons of applications, including: n Solving systems of linear equations n Computer Graphics, Image Processing n Games n Models within many areas of Computational Science & Engineering n Quantum Mechanics, Quantum Computing n Many, many more ICS 4: Discrete Mathematics I Fall -4

Row and Column Order n n n The rows in a matrix are usually indexed to m from top to bottom. The columns are usually indexed to n from left to right. Elements are indexed by row, then by column. A [ a ij ] a a a m a a a m a a a n n mn ICS 4: Discrete Mathematics I Fall -5

Matrix Equality n 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. 6 6 ICS 4: Discrete Mathematics I Fall -6

Matrix Sums n 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 ij + b ij ] 6 + 9 9 8 5 ICS 4: Discrete Mathematics I Fall -7

Matrix Products n For an m k matrix A and a k n matrix B, the product AB is the m n matrix: AB c ij C a i b [ c j ij + ] a i b j + + a n I.e., the element of AB indexed (i, j) is given by the vector dot product of the i-th row of A and the j-th column of B (considered as vectors). n Note: Matrix multiplication is not commutative! ik b kj k a i b j ICS 4: Discrete Mathematics I Fall -8

-9 ICS 4: Discrete Mathematics I Fall Matrix Product Example + + + + + + + + ) ( ) ( ) ( ) (

Matrix Product Example A and B n Because A is a matrix and B is a matrix, the product AB is not defined. ICS 4: Discrete Mathematics I Fall -

Matrix Multiplication: Non-Commutative n Matrix multiplication is not commutative! n A: m n matrix and B: r s matrix n n n n n AB is defined when n r BA is defined when s m When both AB and BA are defined, generally they are not the same size unless m n r s If both AB and BA are defined and are the same size, then A and B must be square and of the same size Even when A and B are both n n matrices, AB and BA are not necessarily equal ICS 4: Discrete Mathematics I Fall -

- ICS 4: Discrete Mathematics I Fall Matrix Product Example 5 AB 4 BA B A and

Matrix Multiplication Algorithm procedure matmul(matrices A: m k, B: k n) for i : to m Θ(m) { for j : to n begin c ij : for q : to k Θ(n) ( Θ()+ Θ(k) What s the Θ of its time complexity? Answer: Θ(mnk) c ij : c ij + a iq b qj Θ())} end {C [c ij ] is the product of A and B} ICS 4: Discrete Mathematics I Fall -

Identity Matrices n The identity matrix of order n, I n, is the rank-n square matrix with s along the upper-left to lower-right diagonal, and s everywhere else. i, j n I [ δ ] n ij Kronecker Delta if if i i j j n ICS 4: Discrete Mathematics I Fall n -4

Matrix Inverses n For some (but not all) square matrices A, there exists a unique multiplicative inverse A of A, a matrix such that A A I n. n If the inverse exists, it is unique, and A A AA. n We won t go into the algorithms for matrix inversion... ICS 4: Discrete Mathematics I Fall -5

-6 ICS 4: Discrete Mathematics I Fall Powers of Matrices If A is an n n square matrix and p, then: n A p AAA A (and A I n ) n Example: p times 4

-7 ICS 4: Discrete Mathematics I Fall Matrix Transposition n 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 ] ( i n, j m) t

-8 ICS 4: Discrete Mathematics I Fall Symmetric Matrices n A square matrix A is symmetric iff A A t. I.e., i, j n: a ij a ji. n Which of the below matrices is symmetric?

Zero-One Matrices n Useful for representing other structures. n E.g., relations, directed graphs (later on) n All elements of a zero-one matrix are either or. n E.g., representing False & True respectively. n The join of A, B (both m n zero-one matrices): n A B [a ij b ij ] n The meet of A, B: n A B [a ij b ij ] [a ij b ij ] ICS 4: Discrete Mathematics I Fall -9

- ICS 4: Discrete Mathematics I Fall Join and Meet Example B A B A and B A

Boolean Products n Let A [a ij ] be an m k zero-one matrix and B [b ij ] be a k n zero-one matrix, n The boolean product of A and B is like normal matrix multiplication, but using instead of +, and instead of in the row-column vector dot product : A B k C [ cij] a i b j ICS 4: Discrete Mathematics I Fall -

Boolean Products Example n Find the Boolean product of A and B, where A B ( ) ( ) ( ) ( ) ( ) ( ) A B ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ICS 4: Discrete Mathematics I Fall -

Boolean Powers n For a square zero-one matrix A, and any k, the k-th Boolean power of A is simply the Boolean product of k copies of A. A [k] A A A k times A [] I n ICS 4: Discrete Mathematics I Fall -

Matrices as Functions n An m n matrix A [a ij ] 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 ij. n By extending the domain over which f A is defined, various types of infinite and/or multidimensional matrices can be obtained. ICS 4: Discrete Mathematics I Fall -4