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

Similar documents
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 maths for GMT

Phys 201. Matrices and Determinants

Matrices. Chapter Definitions and Notations

Matrix Operations: Determinant

Math Linear Algebra Final Exam Review Sheet

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

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.

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

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

Chapter 2 Notes, Linear Algebra 5e Lay

MATH2210 Notebook 2 Spring 2018

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Undergraduate Mathematical Economics Lecture 1

Graduate Mathematical Economics Lecture 1

1 Last time: determinants

Components and change of basis

CS 246 Review of Linear Algebra 01/17/19

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

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

Matrix Arithmetic. j=1

MATRICES The numbers or letters in any given matrix are called its entries or elements

Determinants Chapter 3 of Lay

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

Linear Algebra and Matrix Inversion

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

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

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

CHAPTER 8: Matrices and Determinants

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.

MATRICES AND MATRIX OPERATIONS

M. Matrices and Linear Algebra

a11 a A = : a 21 a 22

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

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

Linear Equations in Linear Algebra

System of Linear Equations

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

Determinants: summary of main results

Lecture 3: Matrix and Matrix Operations

Matrices and Linear Algebra

POLI270 - Linear Algebra

Chapter 7. Linear Algebra: Matrices, Vectors,

Elementary Row Operations on Matrices

LS.1 Review of Linear Algebra

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

Math 3108: Linear Algebra

Chapter 2: Matrices and Linear Systems

Linear Algebra M1 - FIB. Contents: 5. Matrices, systems of linear equations and determinants 6. Vector space 7. Linear maps 8.

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Linear Systems and Matrices

Things we can already do with matrices. Unit II - Matrix arithmetic. Defining the matrix product. Things that fail in matrix arithmetic

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

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

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

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

Linear Algebra: Lecture Notes. Dr Rachel Quinlan School of Mathematics, Statistics and Applied Mathematics NUI Galway

Inverses and Determinants

NOTES FOR LINEAR ALGEBRA 133

Lecture Notes in Linear Algebra

Matrix & Linear Algebra

MATH 1210 Assignment 4 Solutions 16R-T1

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

A Review of Matrix Analysis

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

ICS 6N Computational Linear Algebra Matrix Algebra

7.3. Determinants. Introduction. Prerequisites. Learning Outcomes

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

MATH 213 Linear Algebra and ODEs Spring 2015 Study Sheet for Midterm Exam. Topics

MAC Module 3 Determinants. Learning Objectives. Upon completing this module, you should be able to:

Fundamentals of Engineering Analysis (650163)

Digital Workbook for GRA 6035 Mathematics

1300 Linear Algebra and Vector Geometry

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

Matrix Multiplication

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

Introduction to Matrix Algebra

CP3 REVISION LECTURES VECTORS AND MATRICES Lecture 1. Prof. N. Harnew University of Oxford TT 2013

2. Every linear system with the same number of equations as unknowns has a unique solution.

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

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

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.

Matrix operations Linear Algebra with Computer Science Application

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Chapter 2. Square matrices

Matrix representation of a linear map

Linear Equations and Matrix

Matrices and Determinants

ECON 186 Class Notes: Linear Algebra

Math Camp Notes: Linear Algebra I

Math 240 Calculus III

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Homework Set #8 Solutions

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

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

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

and let s calculate the image of some vectors under the transformation T.

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Conceptual Questions for Review

Transcription:

Graphics 2009/2010, period 1 Lecture 4 Matrices

m n matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse The system of m linear equations in n variables x 1, x 2,..., x n a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. a m1 x 1 + a m2 x 2 + + a mn x n = b m can be written as a matrix equation by Ax = b, or in full a 11 a 12 a 1n x 1 b 1 a 21 a 22 a 2n x 2....... = b 2. a m1 a m2 a mn x n b m

m n matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse The matrix a 11 a 12 a 1n a 21 a 22 a 2n A =...... a m1 a m2 a mn has m rows and n columns, and is called an m n matrix.

Special cases Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse A square matrix (for which m = n) is called a diagonal matrix if all elements a ij for which i j are zero. If all elements a ii are one, then the matrix is called an identity matrix, denoted with I m (depending on the context, the subscript m may be left out). 1 0 0 0 1 0 I =...... 0 0 1 If all matrix entries are zero, then the matrix is called a zero matrix, denoted with 0.

Matrix addition Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse For two matrices A and B, we have A + B = C, with c ij = a ij + b ij : 1 4 7 10 8 14 2 5 + 8 11 = 10 16 3 6 9 12 12 18 Q: what are the conditions for the dimensions of the matrices A and B? Q: how do we define subtraction?

Matrix multiplication Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Multiplying a matrix with a scalar is defined as follows: ca = B, with b ij = ca ij. For example, 1 2 3 2 4 6 2 4 5 6 = 8 10 12 7 8 9 14 16 18

Matrix multiplication Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Multiplying two matrices is a bit more involved. We have AB = C with c ij = n k=1 a ikb kj. For example, ( 6 5 1 3 2 1 8 4 ) 1 0 0 ( ) 1 1 0 6 2 2 5 0 2 = 37 5 16 0 1 0

Matrix multiplication Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse AB = C with c ij = n k=1 a ikb kj. Q: what are the conditions for the dimensions of A and B? Q: what are the dimensions of C?

Properties of matrix multiplication Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Matrix multiplication is associative and distributive over addition: (AB)C = A(BC) A(B + C) = AB + AC (A + B)C = AC + BC However, matrix multiplication is not commutative: in general, AB BA.

Properties of matrix multiplication Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Matrix multiplication is not commutative: in general, AB BA. Also: if AB = AC, it doesn t necessarily follow that B = C (even if A is not the null matrix).

Identity and zero matrix revisited Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Identity matrix I m : 1 0 0 0 1 0 I =...... 0 0 1 Zero matrix 0:

Transposed matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse The transpose A T of an m n matrix A is an n m matrix that is obtained by interchanging the rows and columns of A: a 11 a 12 a 1n a 21 a 22 a 2n A =...... a m1 a m2 a mn a 11 a 21 a m1 A T a 12 a 22 a m2 =...... a 1n a 2n a mn

Transposed matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse Example: A = ( 1 2 ) 3 4 5 6 1 4 A T = 2 5 3 6

Transposed matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse For the transpose of the product of two matrices we have (AB) T = B T A T

Transposed matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse For the transpose of the product of two matrices we have (AB) T = B T A T

The dot product revisited Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse If we regard (column) vectors as matrices, we see that the inproduct of two vectors can be written as u v = u T v: 1 4 2 5 = ( 1 2 3 ) 4 5 = 32 3 6 6 (A 1 1 matrix is simply a number, and the brackets are omitted.)

Inverse matrices Matrices Definitions Diagonal, Identity, and zero matrices Addition Multiplication Transpose and inverse The inverse of a matrix A is a matrix A 1 such that AA 1 = I. Only square matrices possibly have an inverse. Note that the inverse of A 1 is A, so we have AA 1 = A 1 A = I

Solving systems of linear equations Inverting matrices Matrices are a convenient way of representing systems of linear equations: a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2 a m1 x 1 + a m2 x 2 + + a mn x n = b m If such a system has a unique solution, it can be solved with..

Solving systems of linear equations Inverting matrices Permitted operations in are interchanging two rows. multiplying a row with a (non-zero) constant. adding a multiple of another row to a row.

Solving systems of linear equations Inverting matrices Matrices are not necessary for, but very convenient, especially augmented matrices. The augmented matrix corresponding to the system of equations on the previous slides is a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2....... a m1 a m2 a mn b m

Solving systems of linear equations Inverting matrices : example Suppose we want to solve the following system: x + y + 2z = 17 2x + y + z = 15 x + 2y + 3z = 26 Q: what is the geometric interpretation of this system?

Solving systems of linear equations Inverting matrices : example Applying the rules in a clever order, we get 1 1 2 17 1 1 2 17 2 1 1 15 0 1 3 19 1 2 3 26 0 1 1 9 1 1 2 17 0 1 3 19 0 1 1 9 1 0 1 2 0 1 3 19 0 0 1 5 1 0 1 2 0 1 3 19 0 0 2 10 1 0 0 3 0 1 0 4 0 0 1 5

Solving systems of linear equations Inverting matrices : example The interpretation of the last augmented matrix 1 0 0 3 0 1 0 4 0 0 1 5 is the very convenient system of linear equations x = 3 y = 4 z = 5 Q: what is the geometric interpretation of this solution?

Solving systems of linear equations Inverting matrices Geom. interpretations: intersection of 2 planes Q: what is the geometric interpretation of this system? 1st: intersection of 2 planes

Solving systems of linear equations Inverting matrices Geom. interpretations: intersection of 3 planes

Solving systems of linear equations Inverting matrices Q: what if a system can not be reduced to a triangular form? Q: does this always mean that their is no valid solution?

Solving systems of linear equations Inverting matrices Note: In the literature you also find a slightly different procedure 1st step: Put 0 s in the lower triangle... 2nd step:.. then work your way back up 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Solving systems of linear equations Inverting matrices : inverting matrices The same procedure can also be used to invert matrices.

Solving systems of linear equations Inverting matrices : inverting matrices Example: 1 1 2 1 0 0 1 3 4 0 1 0 0 2 5 0 0 1 1 1 2 1 0 0 0 2 2 1 1 0 0 2 5 0 0 1 1 1 2 1 0 0 1 0 1 1 1 0 1 1 1 2 1 2 0 1 2 2 0 0 1 1 1 1 2 2 0 0 2 5 0 0 1 0 0 3 1 1 1 1 0 1 1 1 2 1 7 2 0 1 0 0 0 1 1 1 6 1 6 2 6 1 2 2 0 0 1 0 5 5 1 0 0 1 3 1 6 6 2 6 1 2 3 3 0 0 1 6 2 2 6 6

Solving systems of linear equations Inverting matrices : inverting matrices The last augmented matrix tells us that the inverse of 1 1 2 1 3 4 0 2 5 equals 7 1 2 1 5 5 2 6 2 2 2

Matrices Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II The determinant of a matrix is the signed volume spanned by the column vectors. The determinant det A of a matrix A is also written as A. For example, ( ) a11 a A = 12 a 21 a 22 det A = A = a 11 a 12 a 21 a 22 (a 12, a 22 ) (a 11, a 21 )

Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II : geometric interpretation In 2D: deta is the oriented area of the parallelogram defined by the 2 vectors. det A = A = a 11 a 12 a 21 a 22 (a 12, a 22 ) In 3D: deta is the oriented area of the parallelepiped defined by the 3 vectors. (a 11, a 21 )

Computing determinants Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II can be computed as follows: The determinant of a matrix is the sum of the products of the elements of any row or column of the matrix with their cofactors If only we knew what cofactors are...

Cofactors Matrices Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Take a deep breath... The cofactor of an entry a ij in an n n matrix a is the determinant of the (n 1) (n 1) matrix A that is obtained from A by removing the i-th row and the j-th column, multiplied by 1 i+j. Right: long live recursion! Q: what is the bottom of this recursion?

Cofactors Matrices Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Example: for a 4 4 matrix A, the cofactor of the entry a 13 is A = a 11 a 12 a 13 a 14 a 21 a 22 a 23 a 24 a 31 a 32 a 33 a 34 a 41 a 42 a 43 a 44 a 21 a 22 a 24 a c 13 = a 31 a 32 a 34 a 41 a 42 a 44 and A = a 12 a c 12 + a 22a c 22 + a 32a c 32 + a 42a c 42

and cofactors Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Example 0 1 2 3 4 5 6 7 8 = 0 4 5 7 8 1 3 5 6 8 + 2 3 4 6 7 = 0(32 35) 1(24 30) + 2(21 24) = 0.

Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Systems of linear equations and determinants Consider our system of linear equations again: x + y + 2z = 17 2x + y + z = 15 x + 2y + 3z = 26 Such a system of n equations in n unknowns can be solved by using determinants. In general, if we have Ax = b, then x i = Ai A. where Ai is obtained from A by replacing the i-th column with b.

Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Systems of linear equations and determinants In general, if we have Ax = b, then x i = Ai A. where Ai is obtained from A by replacing the i-th column with b.

Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II and systems of linear equations So for our system x + y + 2z = 17 2x + y + z = 15 x + 2y + 3z = 26 we have x = 17 1 2 15 1 1 26 2 3 1 1 2 2 1 1 1 2 3 y = 1 17 2 2 15 1 1 26 3 1 1 2 2 1 1 1 2 3 z = 1 1 17 2 1 15 1 2 26 1 1 2 2 1 1 1 2 3

and inverse matrices Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II can also be used to compute the inverse A 1 of an invertible matrix A: A 1 = 1 A à where à is the adjoint of A, which is the transpose of the cofactor matrix of A. The cofactor matrix of A is obtained from A by replacing every entry a ij by its cofactor a c ij.

Computing determinants differently Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II 3x3 matrices: a b c d e f g h i = a e f h i... = (aei + bfg + cdg) (hfa + idb + gec)

Computing determinants differently Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II 3x3 matrices: a b c d e f g h i = a e f h i... = (aei + bfg + cdg) (hfa + idb + gec) 2x2 matrices: a b c d = ad bc Note: This does not generalize to higher dimensions!

Computing determinants differently Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II can also be computed by a method that resembles : if A is obtained from A by exchanging two rows, then A = A. if A is obtained from A by multiplying a row with a scalar c, then A = c A. if A is obtained from A by adding a multiple of one row of A to another, then A = A. I = 1 if A contains any row or column with only zeros, then A = 0

Computing determinants differently Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II Example 0 1 2 3 4 5 6 7 8 = 1 2 0 1 2 6 8 10 6 7 8 = 1 2 0 1 2 6 7 8 6 7 8 = 1 2 0 1 2 0 0 0 6 7 8 = 1 2 0 = 0.

Volume Computing determinants: cofactors Solving systems of linear equations II Inverting matrices II Computing determinants II