ICS 6N Computational Linear Algebra Matrix Algebra

Similar documents
Matrix operations Linear Algebra with Computer Science Application

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Linear Equations in Linear Algebra

Math 4377/6308 Advanced Linear Algebra

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.

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

ICS 6N Computational Linear Algebra Vector Equations

Matrix Algebra & Elementary Matrices

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

Mathematics 13: Lecture 10

Matrix Multiplication

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

Matrices: 2.1 Operations with Matrices

Matrix Arithmetic. j=1

Linear Algebra and Matrix Inversion

Elementary maths for GMT

Chapter 2 Notes, Linear Algebra 5e Lay

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

Linear Algebra. Linear Equations and Matrices. Copyright 2005, W.R. Winfrey

Announcements Wednesday, October 10

Announcements Monday, October 02

Math 3191 Applied Linear Algebra

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

Lecture 3: Matrix and Matrix Operations

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

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

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

CS 246 Review of Linear Algebra 01/17/19

Phys 201. Matrices and Determinants

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

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

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

Elementary Row Operations on Matrices

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

CLASS 12 ALGEBRA OF MATRICES

Lecture 3 Linear Algebra Background

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

ICS 6N Computational Linear Algebra Vector Space

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

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

MATRICES AND MATRIX OPERATIONS

Review Let A, B, and C be matrices of the same size, and let r and s be scalars. Then

ELEMENTARY LINEAR ALGEBRA

Matrices. Chapter Definitions and Notations

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Basic Concepts in Linear Algebra

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

Linear Equations and Matrix

Linear Algebra Tutorial for Math3315/CSE3365 Daniel R. Reynolds

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

Matrix & Linear Algebra

MTH 35, SPRING 2017 NIKOS APOSTOLAKIS

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

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Foundations of Cryptography

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

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

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

Matrices BUSINESS MATHEMATICS

Linear algebra comments. Sophie Marques

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

ICS 6N Computational Linear Algebra Symmetric Matrices and Orthogonal Diagonalization

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

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

Graduate Mathematical Economics Lecture 1

Undergraduate Mathematical Economics Lecture 1

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

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

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

3 a 21 a a 2N. 3 a 21 a a 2M

ELEMENTARY LINEAR ALGEBRA

MATH2210 Notebook 2 Spring 2018

Chapter 2: Matrix Algebra

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

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Basic Linear Algebra in MATLAB

Linear Algebra Summary. Based on Linear Algebra and its applications by David C. Lay

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

Lecture Notes in Linear Algebra

POLI270 - Linear Algebra

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.

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Review of Basic Concepts in Linear Algebra

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

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

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

Math 1553 Introduction to Linear Algebra

MATH 2331 Linear Algebra. Section 2.1 Matrix Operations. Definition: A : m n, B : n p. Example: Compute AB, if possible.

MTH 464: Computational Linear Algebra

Matrices and Vectors

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

1 Matrices and matrix algebra

MAT 2037 LINEAR ALGEBRA I web:

Matrices and Linear Algebra

ELEMENTARY LINEAR ALGEBRA

Matrix Algebra. Learning Objectives. Size of Matrix

Section 1.6. M N = [a ij b ij ], (1.6.2)

Chapter 1 Matrices and Systems of Equations

Chapter 1 Vector Spaces

Transcription:

ICS 6N Computational Linear Algebra Matrix Algebra Xiaohui Xie University of California, Irvine xhx@uci.edu February 2, 2017 Xiaohui Xie (UCI) ICS 6N February 2, 2017 1 / 24

Matrix Consider an m n matrix a 11 a 12... a 1n a 21 a 22... a 1n A =...... = [ ] a 1 a 2... a n a m1 a m2... a mn a ij is the scalar entry in the ith row and jth column, called the (i, j)-entry. Each column is a vector in R m. Two matrices are equal if they have the same size and the corresponding entries are equal a 11, a 22,... are called the diagonal entries A is called diagonal if all non-diagonal entries are zero The identity matrix I n is a square diagonal matrix with diagonal being 1 The zero matrix is a matrix in which all entries are zero, written as 0. Xiaohui Xie (UCI) ICS 6N February 2, 2017 2 / 24

Matrix operations Given two m n matrices A and B, Sum: A + B is an m n matrix whose (i, j)-entry is a ij + b ij Multiplication by a scalar: ra = Ar is an m n matrix whose (i, j)-entry is ra ij, where r is a scalar. Matrix vector product: Ax = x 1 a 1 + x 2 a 2 +... + x n a n Xiaohui Xie (UCI) ICS 6N February 2, 2017 3 / 24

Examples Given A = A + B 2A A + C [ ] 1 2 3, B = 4 5 6 [ ] 1 0 1, C = 0 1 1 [ ] 1 0, compute 0 1 Xiaohui Xie (UCI) ICS 6N February 2, 2017 4 / 24

Examples [ ] 1 2 3 Given A =, B = 4 5 6 [ ] 2 2 4 A + B = 0 6 7 [ ] 2 4 5 2A = 8 10 12 A + C = Not defined. [ ] 1 0 1, C = 0 1 1 [ ] 1 0, 0 1 Xiaohui Xie (UCI) ICS 6N February 2, 2017 5 / 24

Properties of matrix operations Given A, B, C matrices of the same size, and scalars r and s, (A + B) + C = A + (B + C) A + B = B + A A + 0 = A r(a + B) = ra + rb (r + s)a = ra + sa r(sa) = (rs)a Xiaohui Xie (UCI) ICS 6N February 2, 2017 6 / 24

Matrix Multiplication When a matrix B multiplies a vector x, it transforms x into the vector Bx. If this vector is then multiplied in turn by a matrix A, the resulting vector is A(Bx). Thus A(Bx) is produced from x by a composition of mappings the linear transformations. Our goal is to represent this composite mapping as multiplication by a single matrix, denoted by AB, so that A(Bx) = (AB)x. Xiaohui Xie (UCI) ICS 6N February 2, 2017 7 / 24

Matrix Multiplication Suppose A is m n, B is n p, and x is in R p Denote B = [ b 1 b 2... b p ]. Xiaohui Xie (UCI) ICS 6N February 2, 2017 8 / 24

Matrix Multiplication Suppose A is m n, B is n p, and x is in R p Bx is a vector in R n, A(Bx) is a vector in R m Denote B = [ b 1 b 2... b p ]. Then Bx = x1 b 1 + x 2 b 2 +... + x p b p A(Bx) = A(x 1 b 1 + x 2 b 2 +... + x p b p ) = A(x 1 b 1 ) + A(x 2 b 2 ) +... + A(x p b p ) = x 1 (Ab 1 ) + x 2 (Ab 2 ) +... + x p (Ab p ) linear combination = [ Ab 1 Ab 2 Ab p ] x So AB = [ Ab 1 Ab 2 Ab p ], an m p matrix. Xiaohui Xie (UCI) ICS 6N February 2, 2017 9 / 24

MATRIX MULTIPLICATION Definition: If A is an m n matrix, and if B is an n p matrix with columns b 1,, b p, then the product AB is the m p matrix whose columns are Ab 1,, Ab p. That is AB = [ Ab 1 Ab 2 Ab p ] Each column of AB is a linear combination of the columns of A using weights from the corresponding column of B. Xiaohui Xie (UCI) ICS 6N February 2, 2017 10 / 24

Example Given A = [ ] 1 1 1 2 1 and B = 1 1, compute AB. 2 1 1 0 0 Xiaohui Xie (UCI) ICS 6N February 2, 2017 11 / 24

Example [ ] 1 1 1 2 1 Given A = and B = 1 1, compute AB. 2 1 1 0 0 Solution: AB = Ab 1 Ab 2 [ ] 1 [ ] [ ] 1 2 1 Ab 1 = 1 1 1 2 1 =, Ab 2 1 1 1 2 = 1 1 = 2 1 1 0 0 [ ] 1 3 So AB = 1 3 [ ] 3 3 Xiaohui Xie (UCI) ICS 6N February 2, 2017 12 / 24

Row-column rule for computing AB Now let s check the (i, j)-entry of AB: (AB) ij = the i-th entry of the j-th column = the i-th entry of Ab j = b j (the i-th row of A) = a i1 b 1j + a i2 b 2j +... + a in b nj The (i, j)-entry of AB is the sum of the products of corresponding entries from row i of A and column j of B (AB) ij = a i1 b 1j + a i2 b 2j +... + a in b nj = n a ik b kj k=1 Xiaohui Xie (UCI) ICS 6N February 2, 2017 13 / 24

Example Given A = [ ] 1 1 1 2 3, B = 1 0, compute AB. 4 5 6 0 1 Xiaohui Xie (UCI) ICS 6N February 2, 2017 14 / 24

Example Given A = Solution: [ ] 1 1 1 2 3, B = 1 0, compute AB. 4 5 6 0 1 Are the sizes consistent? Yes Based on definition, AB = Ab 1 Ab 2 = Or we can also calculate this entry by entry (AB) 11 = [ 1 2 3 ] [ 1 1 0 ] = 3 (AB) 21 = [ 4 5 6 ] [ 1 1 0 ] = 9 And so[ on until ] we get 3 2 AB = 9 2 [ ] 3 2 9 2 Xiaohui Xie (UCI) ICS 6N February 2, 2017 15 / 24

Special Cases An nx1 matrix can be viewed as a vector in R n (column vector) A row vector can be viewed as a 1xn matrix. (Dot product) A row vector times a column vector produces a scalar if they are of the same size. b 1 [ ] b 2 a1 a 2... a n. = a 1b 1 + a 2 b 2 +... + a n b n b n Xiaohui Xie (UCI) ICS 6N February 2, 2017 16 / 24

Special Cases (Out product) A column vector times a row vector produces a matrix. a 1 a 1 b 1 a 1 b 2... a 1 b n a 2. [ ] a 2 b 1 a 2 b 2... a 2 b n b 1 b 2... b n =...... a m a m b 1 a m b 2... a m b n Xiaohui Xie (UCI) ICS 6N February 2, 2017 17 / 24

Special cases Let A be an mxn matrix, AI n = A = I m A A0 = 0. Xiaohui Xie (UCI) ICS 6N February 2, 2017 18 / 24

Theorems If the sizes are consistent a) (AB)C = A(BC) b) A(B + C) = AB + AC c) (B + C)A = BA + BC d) (ra)b = A(rB) e) I m A = AI n Xiaohui Xie (UCI) ICS 6N February 2, 2017 19 / 24

Warnings AB BA in general. They are not even of the same size! Example Even[ if they ] are the [ same ] size it is in general not true 1 1 0 1 A =, B = 0 0 1 0 [ ] [ ] 1 1 0 0 AB =, BA = 0 0 1 1 If AB = BA then A and B are commutable, but in general they are not. Xiaohui Xie (UCI) ICS 6N February 2, 2017 20 / 24

Warnings If AB = AC and A 0, we cannot conclude B = C Example Even[ if they ] are the [ same ] size it is[ in general ] not true 1 1 1 2 3 4 A =, B =, C = 1 1 1 2 3 4 [ ] [ ] 0 0 0 0 AB =, BA = 0 0 0 0 But we can clearly see B C Xiaohui Xie (UCI) ICS 6N February 2, 2017 21 / 24

Powers of a matrix Definition: If A is an n n matrix and if k is a positive integer, then A k denotes the product of k copies of A. A k = A A (k times) A 0 = I by convention. Xiaohui Xie (UCI) ICS 6N February 2, 2017 22 / 24

Transpose Given an mxn matrix A, the transpose of A is the nxm matrix, denoted by A T, whose columns are formed from the corresponding rows of A. a 11 a 12... a 1n a 11 a 21... a n1 a 21 a 22... a 2n If A =......, then a 12 a 22... a n2 AT =...... a m1 a m2... a mn a 1m a 2m... a nm (A T ) ij = a ji Xiaohui Xie (UCI) ICS 6N February 2, 2017 23 / 24

Properties of matrix transpose If the sizes are consistent (A T ) T = A (A + B) T = A T + B T (ra) T = ra T (ra)b = A(rB) (AB) T = B T A T (note the reverse order!) Xiaohui Xie (UCI) ICS 6N February 2, 2017 24 / 24