Lecture 3: Matrix and Matrix Operations

Similar documents
Phys 201. Matrices and Determinants

Linear Algebra (Review) Volker Tresp 2017

Linear Algebra (Review) Volker Tresp 2018

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Linear Algebra V = T = ( 4 3 ).

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

Matrices. Chapter Definitions and Notations

Review of Linear Algebra

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

ICS 6N Computational Linear Algebra Matrix Algebra

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

Lecture 3 Linear Algebra Background

Linear Algebra and Matrix Inversion

Matrices BUSINESS MATHEMATICS

Mathematics 13: Lecture 10

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

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

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

Review of linear algebra

Quantum Computing Lecture 2. Review of Linear Algebra

Section 12.4 Algebra of Matrices

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

Review of Linear Algebra

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

Chapter 2 Notes, Linear Algebra 5e Lay

Introduction to Matrix Algebra

Matrix operations Linear Algebra with Computer Science Application

Matrices and Linear Algebra

Arrays: Vectors and Matrices

Matrix Basic Concepts

Lecture 6: Geometry of OLS Estimation of Linear Regession

CS 246 Review of Linear Algebra 01/17/19

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

Computational Foundations of Cognitive Science. Addition and Scalar Multiplication. Matrix Multiplication

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

POLI270 - Linear Algebra

Matrix Arithmetic. j=1

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

Knowledge Discovery and Data Mining 1 (VO) ( )

Elementary maths for GMT

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

Matrices and Vectors

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

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

Two matrices of the same size are added by adding their corresponding entries =.

Elementary Row Operations on Matrices

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

Chapter 2. Matrix Arithmetic. Chapter 2

Basic Linear Algebra in MATLAB

Linear Equations and Matrix

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

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

MATRICES AND MATRIX OPERATIONS

Matrices. Chapter What is a Matrix? We review the basic matrix operations. An array of numbers a a 1n A = a m1...

CLASS 12 ALGEBRA OF MATRICES

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

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Matrix Multiplication

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

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

Matrix & Linear Algebra

Basic Concepts in Linear Algebra

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

Basic Concepts in Matrix Algebra

MATH 423 Linear Algebra II Lecture 33: Diagonalization of normal operators.

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

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

Review of Basic Concepts in Linear Algebra

Computational Foundations of Cognitive Science

Linear Equations in Linear Algebra

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Math 3191 Applied Linear Algebra

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

Lecture Notes in Linear Algebra

1 Matrices and matrix algebra

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

Appendix A: Matrices

Matrix Dimensions(orders)

A primer on matrices

Linear Algebra Review. Vectors

Raphael Mrode. Training in quantitative genetics and genomics 30 May 10 June 2016 ILRI, Nairobi. Partner Logo. Partner Logo

Calculus II - Basic Matrix Operations

Math 4377/6308 Advanced Linear Algebra

Matrix Algebra: Definitions and Basic Operations

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

All of my class notes can be found at

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

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

Matrix Algebra: Summary

2.1 Matrices. 3 5 Solve for the variables in the following matrix equation.

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Elementary Linear Algebra

* is a row matrix * An mxn matrix is a square matrix if and only if m=n * A= is a diagonal matrix if = 0 i

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

Matrix notation. A nm : n m : size of the matrix. m : no of columns, n: no of rows. Row matrix n=1 [b 1, b 2, b 3,. b m ] Column matrix m=1

Symmetric and anti symmetric matrices

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Matrices. Background mathematics review

Lecture notes on Quantum Computing. Chapter 1 Mathematical Background

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Transcription:

Lecture 3: Matrix and Matrix Operations Representation, row vector, column vector, element of a matrix. Examples of matrix representations Tables and spreadsheets Scalar-Matrix operation: Scaling a matrix Vector-Matrix operation: Multiplication of matrix and a vector. Computation as dot product between vectors Interpreting as linear combination of column vectors Properties of matrix-vector multiplication Matrix-Matrix operations Multiplication Example: Feedback control systems Example: Transitive closure Addition of matrices Transpose of a matrix Special Matrices Square Matrix Identity Matrix Diagonal Matrix Symmetric Matrix Anti-symmetric Matrix Upper/Lower Triangular Matrices Orthogonal Matrix 1

Matrix Representation Matrices can be assumed as a sequence of vectors of the same dimension. Representation is similar to a 2D array in programming. Example: a 1 = 2 1 0, a 2 = A = a 1 a 2 a 3 = B = b 1 b 2 = 2 1 0 1 1 1 2, a 3 = 2 1 0.5 1 1 5 0 2 1 0.5 5 1 (using Row vectors), b 1 = 2 1, b 2 = 0 1 (using Column vectors) 2

Size of a Matrix Size of a matrix is represented as (# of rows) (# of columns) Example: A = 2 1 0.5 1 1 5 0 2 1 B = 2 2 1 1 0 0 is a 3 3 matrix is a 3 2 matrix A i,j is the component of A in the i-th row and j-th column. In above example A 3,2 = 2 3

Matrix representation of vectors Vectors can also be considered as matrices. Row vectors are 1 n matrices, where n is the number of components. Column vectors are n 1 matrices, where n is the number of components. Example: Column vector Row vector 2 2 1 is a 3 1 matrix. 0 1 is 1 2 matrix. 4

When are two matrices equal? Two matrices are equal if their sizes and corresponding elements are equal. Example: 2 1 0.5 1 1 5 0 2 1 = 4 2 1 1 2 1 1 5 1 1 2 1, both are 3 3 matrices. 5

Scalar - Matrix Operations Scalars can be multiplied with matrices. Similar to scalar-vector multiplication, the scalar is multiplied with every element of the matrix Example: 2 2 3 2 1 0 1 = 4 6 4 2 0 2 1 2 0 0 2 = 2 0 0 2 6

Vector and Matrix Operations A vector can be multiplied with a matrix in two possible ways. i.e. Matrix-Vector multiplication or Vector-Matrix multiplication. Matrix-Vector Multiplication: Ab = c Matrix A m n can be multiplied with column vector b n 1 to get a column vector c m 1. Vector-Matrix Multiplication: ab = c Row vector a 1 n can be multiplied with matrix B n m to get a row vector c 1 m. 7

Matrix-Vector Multiplication Matrix A m n can be multiplied with column vector b n 1 to get a column vector c m 1. i-th component of c is dot product of i-th row of A with b. Ab = a 1 a 2 b a 11 a 12 a 1 13 a 21 a 12 a b 2 13 b 3 = a 1 b a 2 b 8

Matrix-Vector Multiplication Number of columns of the matrix and the dimension (number of components) of the column vector must be equal. 2 3 2 1 0 1 2 1 0 = 2 0 What if the column vector is orthogonal to the rows of the matrix? Obviously, the result is a zero vector, since the dot product of orthogonal vectors is zero. 2 1 4 2 1 2 = 0 0 9

Vector-Matrix Multiplication Row vector a 1 n can be multiplied with matrix B n m to get a row vector c 1 m. i-th component of c is dot product of a and the i-th column of B. b 1 b 2 ab = a 1 a 2 a 3 b 11 b 12 b 21 b 22 b 31 b 32 = a b 1 a b 2 10

Vector-Matrix Multiplication Number of components of the row vector and number of rows of the matrix must be equal. 1 0 2 2 0 3 1 1 = 2 2 0 What if the row vector is orthogonal to columns of matrix? The result is a zero vector. 1 2 2 4 1 2 = 0 0 11

Matrix - Matrix Operations Matrix-Matrix Multiplication AB Matrix-Matrix Addition A + B Matrix-Matrix Subtraction A B 12

Matrix-Matrix Multiplication Two matrices A n m and B k l can be multiplied as AB, only if m = k The result is a matrix of the size of n l (C n l ) Example: 2 1 2 1 0 3 2 1 2 1 0 3 1 0 1 1 0 1 1 0 0 1 is possible is NOT possible 13

Matrix-Matrix Multiplication Multiplication of matrices AB is nothing but the dot products of row vectors of A with the column vectors of B The component (i, j) of the resulting matrix is the result of the dot product of i-th row vector of A with the j-th column vector of B. If A n m and B m l, so A has n row vectors and B has l column vectors. Therefore, the result matrix is n l. 14

Matrix-Matrix Multiplication (as dot product) b 1 b 2 AB = a 1 a 2 b a 11 a 12 a 11 b 12 13 a 21 a 12 a b 21 b 22 = a 1 b 1 a 1 b 2 13 a b 31 b 2 b 1 a 2 b 2 32 15

Matrix-Matrix Multiplication (as linear combination) Each Column of AB is a linear combination of the columns of A using weights from the corresponding column of B. 16

Properties of Matrix Multiplication AB BA A(BC) = (AB)C A(B+C) = AB + AC (B+C)A = BA + CA r(ab) = (ra)b = A(rB) IA = AI = A (AB) T = B T A T -- not commutative -- associative law -- left distributive law -- right distributive law for any scalar r 17

Inner and Outer Products Inner Product: Inner product of two vectors results in a scalar. a T b = 1 0 1 2 1 2 = 2 + 0 2 = 4 Outer Product: Outer product of two vectors results in a matrix. ab T = 1 0 1 2 1 2 = 2 1 2 0 0 0 2 1 2 18

Matrix Addition Two matrices can be added only if they have the same dimension In matrix addition corresponding elements of the matrices are added. Example: 2 3 2 1 0 1 + 1 0 2 1 1 2 = 1 3 4 2 1 1 1 0.5 1 0 1 1 + 2 0 0 2 Cannot be added 19

Properties of Matrix Addition A + B = B + A A + (B + C) = (A + B) + C A + 0 = 0 + A = A A A = 0 (A + B) T = A T + B T -- commutative law -- associative law 20

Matrix Subtraction Two matrices can be subtracted only if they have the same dimension In matrix subtraction corresponding components of matrices are subtracted. Example: 2 3 2 1 0 1 1 0 2 1 1 2 = 3 3 0 0 1 3 1 0.5 1 0 1 1 2 0 0 2 Cannot be subtracted 21

Col 1 Col 2 Matrix Transpose Transpose of a matrix is a matrix where its rows are columns of the original matrix. (And its columns are the rows of the original matrix.) Row 1 Row 2 A A T Transpose converts row vectors to column vectors and vice-versa 22

Matrix Transpose Transpose of matrix A is noted as A T (NOT A to the power of T). If size of A is m n,then size of A T is n m. Component (i, j) in original matrix is the component (j, i) in the transpose matrix. Example: A = 2 2 1 1 0 0, A T = 2 1 0 2 1 0 23

Properties of Matrix Transpose Transpose of transpose of a matrix is the matrix itself (A T ) T = A Superposition property (A + B) T = A T + B T Scaling property (ca) T = ca T Transpose of a product of matrices equals the product of their transpose in the reverse order (AB) T = B T A T 24

Special Matrix Square Matrix Symmetric Matrix Anti-Symmetric Matrix Diagonal Matrix Identity Matrix Upper/Lower Triangular Matrix Orthogonal Matrix 25

Square matrix Square matrix is a matrix whose number of rows is equal to its number of columns. Square matrix A is a n n matrix. Example: 2 1 0.5 1 1 5 0 2 1 is a square 3 3 matrix. 2 1 0 1 is a square 2 2 matrix. 26

Symmetric matrix A symmetric matrix is a square matrix which is equal to its transpose. A = A T implies A is a symmetric matrix. Components (i, j) and (j, i) of the symmetric matrix are equal. (A i,j = A j,i ) Example: 2 0 0 1 2 1 0.5 1 1 5 0.5 5 1 27

Antisymmetric matrix An antisymmetric matrix is a square matrix which is equal to its transpose multiplied by 1. A = A T if A is an antisymmetric matrix. Components (i, j) and (j, i) of an antisymmetric matrix are equal in value and different in sign. (A i,j = A j,i ) Example: 0 1 1 0 0 1 0.5 1 0 5 0.5 5 0 28

Diagonal matrix A diagonal matrix is a square matrix whose non-diagonal components are all zero. Diagonal matrices are symmetric, as well. Example: 2 0 0 1 2 0 0 0 1 0 0 0 1 0 diagonal components 0 29

Identity matrix Identity matrix is a diagonal matrix whose diagonal values are all 1. Identity matrix is denoted by I. Example: 1 0 0 1 is a 2 2 identity matrix 1 0 0 0 1 0 0 0 1 is a 3 3 identity matrix. 30

Upper/Lower triangular matrix Upper triangular matrix is a square matrix whose elements below the diagonal are all 0. Lower triangular matrix is a square matrix whose elements above the diagonal are all 0. Example: 2 1 0.5 0 1 5 0 0 1 2 0 0 1 1 0 0.5 5 1 is an upper triangular matrix is a lower triangular matrix 31

Orthogonal/Orthonormal Matrix Matrix A is an orthonormal matrix if it is a square matrix and AA T = A T A = I, where I is an identity matrix. Every row is orthogonal to every other row, and every column is orthogonal to every other column. Every row and every column is a unit vector. AA T = a 11 a 21 a 12 a 22 a 13 a 23 a 31 a 32 a 33 a 11 a 21 a 31 a 12 a 22 a 32 = a 13 a 23 a 33 a 1 a 1 a 1 a 2 a 1 a 3 a 2 a 1 a 2 a 2 a 2 a 3 = a 3 a 1 a 3 a 2 a 3 a 3 1 0 0 0 1 0 0 0 1 32

Orthogonal/Orthonormal Matrix Example: 2 2 1 5 1 5 1 2 5 5 2 = 1 0 0 1 5 5 1 5 5 (Orthogonal matrices are a very important class of matrices. They have fascinating properties which we will see later. ) 33