Matrix-Matrix Multiplication
|
|
- Augustus Wilcox
- 6 years ago
- Views:
Transcription
1 Chapter Matrix-Matrix Multiplication In this chapter, we discuss matrix-matrix multiplication We start by motivating its definition Next, we discuss why its implementation inherently allows high performance Motivating Example: Rotations Consider the transformation R : R R that, given a vector x R returns y Rx, where y is the vector x but rotated through an angle ρ Example The rotation R so defined is a linear transformation Rαx αrx: One can first scale x by a factor α and then rotate it through an angle ρ or one can first rotate x through an angle ρ and then scale the result by a factor α Rx + y Rx +Ry: One can first add the vectors and then rotate, or one can rotation each of them first, and then add the results We need a picture to accompany this! Now, let s see what the matrix is that represents R We need to determine how e 0 0 and e 0 are transformed by the transformation R Simple trigonometry tells cos ρ 0 sin ρ us that R and R We need a picture to 0 sin ρ cos ρ accompany this! Thus, cos ρ sin ρ Rx Ax where A sin ρ cos ρ 55
2 56 Chapter Matrix-Matrix Multiplication Next, let us consider the transformation S : R R that rotates vectors through an angle σ Then cos σ sin σ Sx Bx where B sin σ cos σ Finally, consider the transformation T that rotates vectors through an angle ρ + σ so that cosρ + σ sinρ + σ T x Cx where C sinρ + σ cosρ + σ We notice that T x RSx: rotating a vector through angle ρ + σ can be accomplished by first rotating that vector through angle σ and then rotating the result through angle ρ Thus, Cx ABx The question is, how are A, B, and C related when Cx ABx? Recall that the jth row of matrix C, c j, equals Ce j so that cos ρ sin ρ cos σ c 0 Ce 0 ABe 0 Ab 0 sin ρ cos ρ sin σ cos ρ cos σ sin ρ sin σ sin ρ cos σ + cos ρ sin σ cos ρ sin ρ c Ce ABe Ab sin ρ cos ρ sin ρ cos σ cos ρ sin σ cos ρ cos σ sin ρ sin σ sin σ cos σ so that cosρ + σ sinρ + σ cos ρ cos σ sin ρ sin σ sin ρ cos σ cos ρ sin σ C sinρ + σ cosρ + σ sin ρ cos σ + cos ρ sin σ cos ρ cos σ sin ρ sin σ This is consistent with what we learned in high school: from trigonometry we remember that cosρ + σ cos ρ cos σ sin ρ sin σ sinρ + σ sin ρ cos σ + cos ρ sin σ What we will see next, in more generality, is that C is the matrix product of A and B: C ABx ABx In other words, C is defined to be the matrix that represents the composition of transformations R and S, which is then written as C AB Composing Linear Transformations Theorem Let L A : R k R m and L B : R n R k both be linear transformations and, for all x R n, define the function L C : R n R m by L C x L A L B x Then L C x is a linear transformations
3 Composing Linear Transformations 57 Proof: Let x, y R n and α, β R Then L C αx + βy L A L B αx + βy L A αl B x+βl B y αl A L B x + βl A L B y αl C x+βl C y Now, let linear transformations L A, L B, and L C be represented by matrices A R m k, B R k n, and C R m n, respectively Then Cx L C x L A L B x ABx The matrix-matrix multiplication product is defined so that C A B AB It composes A and B into C just like L C is the composition of L A and L B Remark 3 If A is m A n A matrix, B is m B n B matrix, and C is m C n C matrix, then for C AB to hold it must be the case that m C m A, n C n B, and n A m B The question now becomes how to compute C given matrices A and B For this, we are going to use and abuse the unit basis vectors e j Let C γ 0,0 γ 0, γ 0,n α 0,0 α 0, α 0,k γ,0 γ, γ,n, A α,0 α, α,k γ m,0 γ m, γ m,n α m,0 α m, α m,k β 0,0 β 0, β 0,n β,0 β, β,n and B β k,0 β k, β k,n Recall that γ i,j e T i Ce j : Ce j picks out the jth column of C and e T i Ce j then picks out the ith element of the jth column Recall that C AB is defined to be the matrix such that Cx ABx for all x Then γ i,j e T i Ce j e T i ABe j The result of Be j is the jth column of B, b j Thus, e T i ABe j e T i Ab j which equals the ith element of the vector Ab j By the definition of matrix-vector multiplication, the ith element of vector Ab j is given by the dot product of the ith row of A viewed as a column vector with the vector b j Now, the ith row of A and jth column of B are respectively given by αi,0 α i, α i,k and β 0,j β,j β k,j,
4 58 Chapter Matrix-Matrix Multiplication so that k γ i,j e T i ABxe j α i,0 β 0,j + α i, β,j + + α i,k β k,j α i,p β p,j p0 Definition 4 Matrix-matrix multiplication Let A R m k, B R k n, and C R m n Then the matrix-matrix multiplication product C AB is computed by setting k γ i,j α i,p β p,j α i,0 β 0,j + α i, β,j + + α i,k β k,j p0 As a result of this definition Cx ABx ABx and can drop the parentheses, unless they are useful for clarity: Cx ABx Example 5 In 7 and Exercise 6, notice that Q P P Example 6 In we notice that cosρ + σ sinρ + σ cos ρ sin ρ cos σ sin σ C sinρ + σ cosρ + σ sin ρ cos ρ sin σ cos σ cos ρ cos σ sin ρ sin σ sin ρ cos σ cos ρ sin σ sin ρ cos σ + cos ρ sin σ cos ρ cos σ sin ρ sin σ Remark 7 We emphesize that for matrix-matrix multiplication to be a legal operations, the row and column dimensions of the matrices must obey certain constraints Whenever we talk about dimensions being conformal, we mean that the dimensions are such that the encountered matrix multiplications are valid operations The following triple-nested loops compute C : AB + C:
5 Composing Linear Transformations 59 for j 0,, n for i 0,, m for p 0,, k k γ i,j : α i,p β p,j + γ i,j γ i,j : α i,p β p,j +γ i,j p0 for j:n for i:m for p:k Ci,j + Ai,p * Bp,j; end end end Figure : Simple triple-nested loop for computing C : AB + C for j 0,, n for i 0,, m for p 0,, k γ i,j : ǎ T i b j + γ i,j for j:n for i:m Ci,j + SLAP_Dot Ai,:, B:,j ; end end Figure : Algorithm and M-script from Figure with inner loop replaced by a dot product for j 0,, n for i 0,, m for p 0,, k c j : Ab j + c j for j:n C:,j + SLAP_Gemv SLAP_NO_TRANSPOSE,, A, B:,j,, C:,j ; end Figure 3: Algorithm and M-script from Figure with inner two loops replaced by a matrix-vector multiplication for i 0,, m for j 0,, n for p 0,, k The two outer-most loops sweep over all elements in C, and the inner loop computes the inner product of the ith row of A with the jth column of B If originally C 0, then the above algorithm computes C : AB Remark 8 When computing C AB + C the three loops can be nested in 3! 6 different ways We will examine this more, later In Figures 3 we show how an ordering that places the loop indexed by j first, the triplenested loop can be viewed as a double nested loop with dot products as the body which
6 60 Chapter Matrix-Matrix Multiplication then implements the third loop or as a single loop with matrix-vector multiplications as its loop 3 Special Cases of Matrix-Matrix Multiplication We now show that if one treats scalars, column vectors, and row vectors as special cases of matrices, then many operations we encountered previously become simply special cases of matrix-matrix multiplication In the below discussion, consider C AB where C R m n, A R m k, and B R k n m n k scalar multiplication In this case, all three matrices are actually scalars: γ0,0 α0,0 β0,0 α0,0 β 0,0 so that matrix-matrix multiplication becomes scalar multiplication Example 9 Let A 4 and B 3 Then AB 4 3 n,k scal γ 0,0 γ,0 α 0,0 α,0 Now the matrices look like β0,0 α 0,0 β 0,0 α 0,0 β,0 β 0,0 α 0,0 β 0,0 α,0 β 0,0 α 0,0 α,0 γ m,0 α m,0 α 0,0 β m,0 β 0,0 α m,0 α m,0 In other words, C and A are vectors, B is a scalar, and the matrix-matrix multiplication becomes scaling of a vector Example 0 Let A AB 3 3 and B 4 Then
7 3 Special Cases of Matrix-Matrix Multiplication 6 m,k scal Now the matrices look like γ0,0 γ 0, γ 0,n α0,0 β0,0 β 0, β 0,n α 0,0 β0,0 β 0, β 0,n α 0,0 β 0,0 α 0,0 β 0, α 0,0 β 0,n In other words, C and B are just row vectors and A is a scalar The vector C is computed by scaling the row vector B by the scalar A Example Let A 4 and B 3 Then AB m,n dot The matrices look like γ0,0 α0,0 α 0, α 0,k β 0,0 β,0 β k,0 k α 0,p β p,0 p0 In other words, C is a scalar that is computed by taking the dot product of the one row that is A and the one column that is B Example Let A 3 and B Then 0 AB k outer product γ 0,0 γ 0, γ 0,n γ,0 γ, γ,n α 0,0 α,0 β0,0 β 0, β 0,n γ m,0 γ m, γ m,n α m,0
8 6 Chapter Matrix-Matrix Multiplication Example 3 Let A AB 3 3 and B α 0,0 β 0,0 α 0,0 β 0, α 0,0 β 0,n α,0 β 0,0 α,0 β 0, α,0 β 0,n α m,0 β 0,0 α m,0 β 0, α m,0 β 0,n Then n matrix-vector product γ 0,0 γ,0 α 0,0 α 0, α 0,k α,0 α, α,k β 0,0 β,0 γ m,0 α m,0 α m, α m,k β k,0 m row vector-matrix product γ0,0 γ 0, γ 0,n α0,0 α 0, α 0,k β 0,0 β 0, β 0,n β,0 β, β,n β k,0 β k, β k,n so that γ 0,j k p0 α 0,pβ p,j Example 4 Let A 0 0 and B Then AB 4 0 Exercise 5 Let e i R m equal the ith unit basis vector and A R m n Show that e T i A ǎ T i, the ith row of A
9 4 Properties of Matrix-Matrix Multiplication 63 4 Properties of Matrix-Matrix Multiplication Let us examine some properties of matrix-matrix multiplication: Theorem 6 Let A, B, and C be matrices of conforming dimensions Then ABC ABC In other words, matrix multiplication is associative Proof: Let e j equal the jth unit basis vector Then ABCe j ABc j ABc j ABCe j ABCe j Thus, the columns of ABC equal the columns of ABC, making the two matrices equal Theorem 7 Let A, B, and C be matrices of conforming dimensions Then A + BC AC + BC and AB + C AB + AC In other words, matrix multiplication is distributative Remark 8 Matrix-matrix multiplication does not commute: Only in very rare cases does AB equal BA Indeed, the matrix dimensions may not even be conformal Theorem 9 Let A R m k and B R k n Then AB T B T A T Before proving this theorem, we first note that Lemma 0 Let A R m n Then e T i A T Ae i T and A T e j e T j A T The proof of this lemma is pretty obvious: The ith row of A T is clearly the ith column of A, but viewed as a row, etc Proof: of Theorem 9 We prove that the i, j element of AB T equals the i, j element of B T A T : e T i AB T e j
10 64 Chapter Matrix-Matrix Multiplication < i, j element of C equals j, i element of C T > e T j ABe i < Associativity of matrix multiplication > e T j ABe i <x T y y T x> Be i T e T j A T < Lemma 0 > e T i B T A T e j 5 Multiplying partitioned matrices Theorem Let C R m n, A R m k, and B R k n Let m m 0 + m + m M, m i 0 for i 0,, M ; n n 0 + n + n N, n j 0 for j 0,, N ; and k k 0 + k + k K, k p 0 for p 0,, K Partition C 0,0 C 0, C 0,N A 0,0 A 0, A 0,K C,0 C, C,N C, A A,0 A, A,K C M,0 C M, C M,N A M,0 A M, B 0,0 B 0, B 0,N A M,K and B,0 B, B,N B, B K,0 B K, B K,N, with C i,j R m i n j, A i,p R m i k p, and B p,j R kp n j Then C i,j K p0 A i,pb p,j Remark If one partitions matrices C, A, and B into blocks, and one makes sure the dimensions match up, then blocked matrix-matrix multiplication proceeds exactly as does a regular matrix-matrix multiplication except that individual multiplications of scalars commute while in general individual multiplications with matrix blocks submatrices do not
11 5 Multiplying partitioned matrices 65 Example 3 Consider A If A , A, B , B 0, and AB : 0, and B 4 0 Then AB A 0 A B 0 B A 0 B 0 + A B : }{{}}{{} A B }{{} }{{} B 0 }{{} A } {{ } A 0 B } {{ } A B A 0 } 4 0 {{ } B } {{ } AB
12 66 Chapter Matrix-Matrix Multiplication Corollary 4 In Theorem partition C and B by columns and do not partition A In other words, let M, m 0 m; N n, n j, j 0,, n ; and K, k 0 k Then C c 0 c c n and B b 0 b b n so that c0 c c n C AB A b0 b b n Ab0 Ab Ab n Example By moving the loop indexed by j to the outside in the algorithm for computing C AB + C we observe that for j 0,, n for i 0,, m for p 0,, k c j : Ab j + c j or for j 0,, n for p 0,, k for i 0,, m c j : Ab j + c j
13 5 Multiplying partitioned matrices 67 Corollary 6 In Theorem partition C and A by rows and do not partition B In other words, let M m, m i i, i 0,, m ; N, n 0 n; and K, k 0 k Then C c T 0 c T and A ã T 0 ã T c T m ã T m so that c T 0 c T c T m C AB ã T 0 ã T ã T m B ã T 0 B ã T B ã T m B Example In the algorithm for computing C AB + C the loop indexed by i can be moved to the outside so that for i 0,, m for j 0,, n for p 0,, k c T i : ã T i B + ct i or for i 0,, m for p 0,, k for j 0,, n c T i : ã T i B + ct i
14 68 Chapter Matrix-Matrix Multiplication Corollary 8 In Theorem partition A and B by columns and rows, respectively, and do not partition C In other words, let M, m 0 m; N, n 0 n; and K k, k p, p 0,, k Then A a 0 a a k and B bt 0 bt bt k so that C AB a 0 a a k bt 0 bt bt k a 0 b T 0 + a bt + + a k bt k Example In the algorithm for computing C AB + C the loop indexed by p can be moved to the outside so that for p 0,, k for j 0,, n for i 0,, m C : a p bt p + C or for p 0,, k for i 0,, m for j 0,, n C : a p bt p + C Example 30 In Theorem partition C into elements scalars and A and B by rows and columns, respectively, and do not partition C In other words, let M m, m i,
15 5 Multiplying partitioned matrices 69 i 0,, m ; N N, n j, j 0,, n ; and K, k 0 k Then γ 0,0 γ 0, γ 0,n ã T 0 γ,0 γ, γ,n C, A ã T, and B b 0 b b n γ m,0 γ m, γ m,n ã T m so that γ 0,0 γ 0, γ 0,n γ,0 γ, γ,n C γ m,0 γ m, γ m,n ã T 0 b 0 ã T 0 b ã T 0 b n ã T b 0 ã T b ã T b n ã T m b 0 ã T m b ã T m b n ã T 0 ã T ã T m b0 b b n As expected, γ i,j ã T i b j : the dot product of the ith row of A with the jth row of B Example In the algorithm for computing C AB + C the loop indexed by p which computes the dot product of the ith row of A with the jth column of B can be moved to the inside so that
16 70 Chapter Matrix-Matrix Multiplication for j 0,, n for i 0,, m for p 0,, k γ i,j : ã T i b j + γ i,j or for i 0,, m for j 0,, n for p 0,, k γ i,j : ã T i b j + γ i,j Notice that the algorithm on the left already appeared after Example?? while the one on the right appeared after Example 7 6 Summing it all up Figure 4 summarizes how matrix-matrix multiplication can be implemented in terms of operations that we studies in the previous chapter It explains how the six different orderings of the loops exhibit themselves as matrix-matrix multiplication is viewed in a layered fashion
17 6 Summing it all up 7 for j 0,, n c j : Ab j + c j for j 0,, n for i 0,, m γ i,j : ǎ T i b j + γ i,j for j 0,, n for p 0,, k c j : β p,j a p + c j for j 0,, n for i 0,, m for p 0,, k for j 0,, n for p 0,, k for i 0,, m C AB + C for i 0,, m č T i : ǎ T i B +čt i for i 0,, m for j 0,, n γ i,j : ǎ T i b j + γ i,j for i 0,, m for p 0,, k č T i : α i,pˇbt p +č T i for i 0,, m for j 0,, n for p 0,, k for i 0,, m for p 0,, k for j 0,, n for p 0,, k C : a pˇbt p + C for p 0,, k for i 0,, m č T i : α i,pˇbt p +č T i for p 0,, k for j 0,, n c j : β p,j a p + c j for p 0,, k for i 0,, m for j 0,, n for p 0,, k for j 0,, n for i 0,, m Figure 4: Algorithms for implementing C : AB + C
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.
Matrix Arithmetic There is an arithmetic for matrices that can be viewed as extending the arithmetic we have developed for vectors to the more general setting of rectangular arrays: if A and B are m n
More informationICS 6N Computational Linear Algebra Matrix Algebra
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
More informationLinear Algebra and Matrix Inversion
Jim Lambers MAT 46/56 Spring Semester 29- Lecture 2 Notes These notes correspond to Section 63 in the text Linear Algebra and Matrix Inversion Vector Spaces and Linear Transformations Matrices are much
More informationMatrix-Matrix Multiplication
Week5 Matrix-Matrix Multiplication 51 Opening Remarks 511 Composing Rotations Homework 5111 Which of the following statements are true: cosρ + σ + τ cosτ sinτ cosρ + σ sinρ + σ + τ sinτ cosτ sinρ + σ cosρ
More informationFrom Matrix-Vector Multiplication to Matrix-Matrix Multiplication
Week4 From Matrix-Vector Multiplication to Matrix-Matrix Multiplication here are a LO of programming assignments this week hey are meant to help clarify slicing and dicing hey show that the right abstractions
More informationMAT 2037 LINEAR ALGEBRA I web:
MAT 237 LINEAR ALGEBRA I 2625 Dokuz Eylül University, Faculty of Science, Department of Mathematics web: Instructor: Engin Mermut http://kisideuedutr/enginmermut/ HOMEWORK 2 MATRIX ALGEBRA Textbook: Linear
More informationMatrix operations Linear Algebra with Computer Science Application
Linear Algebra with Computer Science Application February 14, 2018 1 Matrix operations 11 Matrix operations If A is an m n matrix that is, a matrix with m rows and n columns then the scalar entry in the
More informationa 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.
Chapter 1 LINEAR EQUATIONS 11 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,, a n, b are given real
More informationPhys 201. Matrices and Determinants
Phys 201 Matrices and Determinants 1 1.1 Matrices 1.2 Operations of matrices 1.3 Types of matrices 1.4 Properties of matrices 1.5 Determinants 1.6 Inverse of a 3 3 matrix 2 1.1 Matrices A 2 3 7 =! " 1
More informationMath 4377/6308 Advanced Linear Algebra
2.3 Composition Math 4377/6308 Advanced Linear Algebra 2.3 Composition of Linear Transformations Jiwen He Department of Mathematics, University of Houston jiwenhe@math.uh.edu math.uh.edu/ jiwenhe/math4377
More informationLecture 4: Products of Matrices
Lecture 4: Products of Matrices Winfried Just, Ohio University January 22 24, 2018 Matrix multiplication has a few surprises up its sleeve Let A = [a ij ] m n, B = [b ij ] m n be two matrices. The sum
More informationA primer on matrices
A primer on matrices Stephen Boyd August 4, 2007 These notes describe the notation of matrices, the mechanics of matrix manipulation, and how to use matrices to formulate and solve sets of simultaneous
More informationELEMENTARY LINEAR ALGEBRA
ELEMENTARY LINEAR ALGEBRA K R MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND First Printing, 99 Chapter LINEAR EQUATIONS Introduction to linear equations A linear equation in n unknowns x,
More informationA matrix over a field F is a rectangular array of elements from F. The symbol
Chapter MATRICES Matrix arithmetic A matrix over a field F is a rectangular array of elements from F The symbol M m n (F ) denotes the collection of all m n matrices over F Matrices will usually be denoted
More informationJim Lambers MAT 610 Summer Session Lecture 1 Notes
Jim Lambers MAT 60 Summer Session 2009-0 Lecture Notes Introduction This course is about numerical linear algebra, which is the study of the approximate solution of fundamental problems from linear algebra
More informationLemma 8: Suppose the N by N matrix A has the following block upper triangular form:
17 4 Determinants and the Inverse of a Square Matrix In this section, we are going to use our knowledge of determinants and their properties to derive an explicit formula for the inverse of a square matrix
More informationStage-structured Populations
Department of Biology New Mexico State University Las Cruces, New Mexico 88003 brook@nmsu.edu Fall 2009 Age-Structured Populations All individuals are not equivalent to each other Rates of survivorship
More information10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )
c Dr. Igor Zelenko, Fall 2017 1 10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections 7.2-7.4) 1. When each of the functions F 1, F 2,..., F n in right-hand side
More informationNotes on vectors and matrices
Notes on vectors and matrices EE103 Winter Quarter 2001-02 L Vandenberghe 1 Terminology and notation Matrices, vectors, and scalars A matrix is a rectangular array of numbers (also called scalars), written
More informationChapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in
Chapter 4 - MATRIX ALGEBRA 4.1. Matrix Operations A a 11 a 12... a 1j... a 1n a 21. a 22.... a 2j... a 2n. a i1 a i2... a ij... a in... a m1 a m2... a mj... a mn The entry in the ith row and the jth column
More informationKevin James. MTHSC 3110 Section 2.1 Matrix Operations
MTHSC 3110 Section 2.1 Matrix Operations Notation Let A be an m n matrix, that is, m rows and n columns. We ll refer to the entries of A by their row and column indices. The entry in the i th row and j
More informationMatrices. Chapter Definitions and Notations
Chapter 3 Matrices 3. Definitions and Notations Matrices are yet another mathematical object. Learning about matrices means learning what they are, how they are represented, the types of operations which
More informationTwo matrices of the same size are added by adding their corresponding entries =.
2 Matrix algebra 2.1 Addition and scalar multiplication Two matrices of the same size are added by adding their corresponding entries. For instance, 1 2 3 2 5 6 3 7 9 +. 4 0 9 4 1 3 0 1 6 Addition of two
More informationMatrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.
2 Matrix Algebra 2.1 MATRIX OPERATIONS MATRIX OPERATIONS m n If A is an matrixthat is, a matrix with m rows and n columnsthen the scalar entry in the ith row and jth column of A is denoted by a ij and
More informationAnnouncements Wednesday, October 10
Announcements Wednesday, October 10 The second midterm is on Friday, October 19 That is one week from this Friday The exam covers 35, 36, 37, 39, 41, 42, 43, 44 (through today s material) WeBWorK 42, 43
More informationELEMENTARY LINEAR ALGEBRA
ELEMENTARY LINEAR ALGEBRA K R MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND Second Online Version, December 998 Comments to the author at krm@mathsuqeduau All contents copyright c 99 Keith
More informationWorking with Block Structured Matrices
Working with Block Structured Matrices Numerical linear algebra lies at the heart of modern scientific computing and computational science. Today it is not uncommon to perform numerical computations with
More informationELEMENTARY LINEAR ALGEBRA
ELEMENTARY LINEAR ALGEBRA K. R. MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND Second Online Version, December 1998 Comments to the author at krm@maths.uq.edu.au Contents 1 LINEAR EQUATIONS
More informationWe 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
Week 22 Equations, Matrices and Transformations Coefficient Matrix and Vector Forms of a Linear System Suppose we have a system of m linear equations in n unknowns a 11 x 1 + a 12 x 2 + + a 1n x n b 1
More informationELEMENTARY LINEAR ALGEBRA
ELEMENTARY LINEAR ALGEBRA K. R. MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND Corrected Version, 7th April 013 Comments to the author at keithmatt@gmail.com Chapter 1 LINEAR EQUATIONS 1.1
More informationLinear Algebra. Linear Equations and Matrices. Copyright 2005, W.R. Winfrey
Copyright 2005, W.R. Winfrey Topics Preliminaries Systems of Linear Equations Matrices Algebraic Properties of Matrix Operations Special Types of Matrices and Partitioned Matrices Matrix Transformations
More informationMATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.
MATH 311-504 Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product. Determinant is a scalar assigned to each square matrix. Notation. The determinant of a matrix A = (a ij
More informationReview of Matrices and Block Structures
CHAPTER 2 Review of Matrices and Block Structures Numerical linear algebra lies at the heart of modern scientific computing and computational science. Today it is not uncommon to perform numerical computations
More informationMatrices: 2.1 Operations with Matrices
Goals In this chapter and section we study matrix operations: Define matrix addition Define multiplication of matrix by a scalar, to be called scalar multiplication. Define multiplication of two matrices,
More informationThe Cross Product. Philippe B. Laval. Spring 2012 KSU. Philippe B. Laval (KSU) The Cross Product Spring /
The Cross Product Philippe B Laval KSU Spring 2012 Philippe B Laval (KSU) The Cross Product Spring 2012 1 / 15 Introduction The cross product is the second multiplication operation between vectors we will
More informationMatrix-Vector Operations
Week3 Matrix-Vector Operations 31 Opening Remarks 311 Timmy Two Space View at edx Homework 3111 Click on the below link to open a browser window with the Timmy Two Space exercise This exercise was suggested
More informationAppendix C Vector and matrix algebra
Appendix C Vector and matrix algebra Concepts Scalars Vectors, rows and columns, matrices Adding and subtracting vectors and matrices Multiplying them by scalars Products of vectors and matrices, scalar
More informationA Review of Matrix Analysis
Matrix Notation Part Matrix Operations Matrices are simply rectangular arrays of quantities Each quantity in the array is called an element of the matrix and an element can be either a numerical value
More information7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.
7.5 Operations with Matrices Copyright Cengage Learning. All rights reserved. What You Should Learn Decide whether two matrices are equal. Add and subtract matrices and multiply matrices by scalars. Multiply
More informationAnnouncements Monday, October 02
Announcements Monday, October 02 Please fill out the mid-semester survey under Quizzes on Canvas WeBWorK 18, 19 are due Wednesday at 11:59pm The quiz on Friday covers 17, 18, and 19 My office is Skiles
More informationMatrix Arithmetic. j=1
An m n matrix is an array A = Matrix Arithmetic a 11 a 12 a 1n a 21 a 22 a 2n a m1 a m2 a mn of real numbers a ij An m n matrix has m rows and n columns a ij is the entry in the i-th row and j-th column
More information1 Matrices and matrix algebra
1 Matrices and matrix algebra 1.1 Examples of matrices A matrix is a rectangular array of numbers and/or variables. For instance 4 2 0 3 1 A = 5 1.2 0.7 x 3 π 3 4 6 27 is a matrix with 3 rows and 5 columns
More informationMath113: Linear Algebra. Beifang Chen
Math3: Linear Algebra Beifang Chen Spring 26 Contents Systems of Linear Equations 3 Systems of Linear Equations 3 Linear Systems 3 2 Geometric Interpretation 3 3 Matrices of Linear Systems 4 4 Elementary
More informationChapter 2. Matrix Arithmetic. Chapter 2
Matrix Arithmetic Matrix Addition and Subtraction Addition and subtraction act element-wise on matrices. In order for the addition/subtraction (A B) to be possible, the two matrices A and B must have the
More informationL. Vandenberghe EE133A (Spring 2017) 3. Matrices. notation and terminology. matrix operations. linear and affine functions.
L Vandenberghe EE133A (Spring 2017) 3 Matrices notation and terminology matrix operations linear and affine functions complexity 3-1 Matrix a rectangular array of numbers, for example A = 0 1 23 01 13
More informationElementary maths for GMT
Elementary maths for GMT Linear Algebra Part 2: Matrices, Elimination and Determinant m n matrices 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
More informationSection 3.2. Multiplication of Matrices and Multiplication of Vectors and Matrices
3.2. Multiplication of Matrices and Multiplication of Vectors and Matrices 1 Section 3.2. Multiplication of Matrices and Multiplication of Vectors and Matrices Note. In this section, we define the product
More informationMatrix-Vector Operations
Week3 Matrix-Vector Operations 31 Opening Remarks 311 Timmy Two Space View at edx Homework 3111 Click on the below link to open a browser window with the Timmy Two Space exercise This exercise was suggested
More informationn 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
n 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
More informationDM559 Linear and Integer Programming. Lecture 3 Matrix Operations. Marco Chiarandini
DM559 Linear and Integer Programming Lecture 3 Matrix Operations Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline and 1 2 3 and 4 2 Outline and 1 2
More informationA primer on matrices
A primer on matrices Stephen Boyd August 4, 2007 These notes describe the notation of matrices, the mechanics of matrix manipulation, and how to use matrices to formulate and solve sets of simultaneous
More informationftdt. We often drop the parentheses and write Tf instead of Tf. We could also write in this example Tfx 0
Linear algebra: The study of linear transformations on vector spaces. Q: What s a linear transformation? What s a vector space? Linear transformations and matrices: We first discuss linear transformations
More informationSubmatrices and Partitioned Matrices
2 Submatrices and Partitioned Matrices Two very important (and closely related) concepts are introduced in this chapter that of a submatrix and that of a partitioned matrix. These concepts arise very naturally
More informationLinear Equations in Linear Algebra
1 Linear Equations in Linear Algebra 1.7 LINEAR INDEPENDENCE LINEAR INDEPENDENCE Definition: An indexed set of vectors {v 1,, v p } in n is said to be linearly independent if the vector equation x x x
More informationMatrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices
Matrices A. Fabretti Mathematics 2 A.Y. 2015/2016 Table of contents Matrix Algebra Determinant Inverse Matrix Introduction A matrix is a rectangular array of numbers. The size of a matrix is indicated
More informationChapter 3. Vector spaces
Chapter 3. Vector spaces Lecture notes for MA1111 P. Karageorgis pete@maths.tcd.ie 1/22 Linear combinations Suppose that v 1,v 2,...,v n and v are vectors in R m. Definition 3.1 Linear combination We say
More informationChapter 3 - From Gaussian Elimination to LU Factorization
Chapter 3 - From Gaussian Elimination to LU Factorization Maggie Myers Robert A. van de Geijn The University of Texas at Austin Practical Linear Algebra Fall 29 http://z.cs.utexas.edu/wiki/pla.wiki/ 1
More informationIntroduction. Vectors and Matrices. Vectors [1] Vectors [2]
Introduction Vectors and Matrices Dr. TGI Fernando 1 2 Data is frequently arranged in arrays, that is, sets whose elements are indexed by one or more subscripts. Vector - one dimensional array Matrix -
More information. a m1 a mn. a 1 a 2 a = a n
Biostat 140655, 2008: Matrix Algebra Review 1 Definition: An m n matrix, A m n, is a rectangular array of real numbers with m rows and n columns Element in the i th row and the j th column is denoted by
More informationMAT 610: Numerical Linear Algebra. James V. Lambers
MAT 610: Numerical Linear Algebra James V Lambers January 16, 2017 2 Contents 1 Matrix Multiplication Problems 7 11 Introduction 7 111 Systems of Linear Equations 7 112 The Eigenvalue Problem 8 12 Basic
More informationMatrix & Linear Algebra
Matrix & Linear Algebra Jamie Monogan University of Georgia For more information: http://monogan.myweb.uga.edu/teaching/mm/ Jamie Monogan (UGA) Matrix & Linear Algebra 1 / 84 Vectors Vectors Vector: A
More informationMathematics for Graphics and Vision
Mathematics for Graphics and Vision Steven Mills March 3, 06 Contents Introduction 5 Scalars 6. Visualising Scalars........................ 6. Operations on Scalars...................... 6.3 A Note on
More informationLecture 3 Linear Algebra Background
Lecture 3 Linear Algebra Background Dan Sheldon September 17, 2012 Motivation Preview of next class: y (1) w 0 + w 1 x (1) 1 + w 2 x (1) 2 +... + w d x (1) d y (2) w 0 + w 1 x (2) 1 + w 2 x (2) 2 +...
More informationMTH 35, SPRING 2017 NIKOS APOSTOLAKIS
MTH 35, SPRING 2017 NIKOS APOSTOLAKIS 1. Linear transformations Definition 1. A function T : R n R m is called a linear transformation if, for any scalars λ,µ R and any vectors u,v R n we have: T(λu+µv)
More informationLecture Notes in Linear Algebra
Lecture Notes in Linear Algebra Dr. Abdullah Al-Azemi Mathematics Department Kuwait University February 4, 2017 Contents 1 Linear Equations and Matrices 1 1.2 Matrices............................................
More informationMATRICES. a m,1 a m,n A =
MATRICES Matrices are rectangular arrays of real or complex numbers With them, we define arithmetic operations that are generalizations of those for real and complex numbers The general form a matrix of
More informationBasic Linear Algebra in MATLAB
Basic Linear Algebra in MATLAB 9.29 Optional Lecture 2 In the last optional lecture we learned the the basic type in MATLAB is a matrix of double precision floating point numbers. You learned a number
More informationMTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)
MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018) COURSEWORK 3 SOLUTIONS Exercise ( ) 1. (a) Write A = (a ij ) n n and B = (b ij ) n n. Since A and B are diagonal, we have a ij = 0 and
More informationBasic Concepts in Linear Algebra
Basic Concepts in Linear Algebra Grady B Wright Department of Mathematics Boise State University February 2, 2015 Grady B Wright Linear Algebra Basics February 2, 2015 1 / 39 Numerical Linear Algebra Linear
More informationIntroduction to Matrix Algebra
Introduction to Matrix Algebra August 18, 2010 1 Vectors 1.1 Notations A p-dimensional vector is p numbers put together. Written as x 1 x =. x p. When p = 1, this represents a point in the line. When p
More informationChapter 2: Matrix Algebra
Chapter 2: Matrix Algebra (Last Updated: October 12, 2016) These notes are derived primarily from Linear Algebra and its applications by David Lay (4ed). Write A = 1. Matrix operations [a 1 a n. Then entry
More information[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of
. Matrices A matrix is any rectangular array of numbers. For example 3 5 6 4 8 3 3 is 3 4 matrix, i.e. a rectangular array of numbers with three rows four columns. We usually use capital letters for matrices,
More informationDefinition 2.3. We define addition and multiplication of matrices as follows.
14 Chapter 2 Matrices In this chapter, we review matrix algebra from Linear Algebra I, consider row and column operations on matrices, and define the rank of a matrix. Along the way prove that the row
More information7 Matrix Operations. 7.0 Matrix Multiplication + 3 = 3 = 4
7 Matrix Operations Copyright 017, Gregory G. Smith 9 October 017 The product of two matrices is a sophisticated operations with a wide range of applications. In this chapter, we defined this binary operation,
More informationSection 5.5: Matrices and Matrix Operations
Section 5.5 Matrices and Matrix Operations 359 Section 5.5: Matrices and Matrix Operations Two club soccer teams, the Wildcats and the Mud Cats, are hoping to obtain new equipment for an upcoming season.
More informationENGINEERING MATH 1 Fall 2009 VECTOR SPACES
ENGINEERING MATH 1 Fall 2009 VECTOR SPACES A vector space, more specifically, a real vector space (as opposed to a complex one or some even stranger ones) is any set that is closed under an operation of
More informationChapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations
Chapter 1: Systems of linear equations and matrices Section 1.1: Introduction to systems of linear equations Definition: A linear equation in n variables can be expressed in the form a 1 x 1 + a 2 x 2
More informationReview of Basic Concepts in Linear Algebra
Review of Basic Concepts in Linear Algebra Grady B Wright Department of Mathematics Boise State University September 7, 2017 Math 565 Linear Algebra Review September 7, 2017 1 / 40 Numerical Linear Algebra
More informationDeterminants - Uniqueness and Properties
Determinants - Uniqueness and Properties 2-2-2008 In order to show that there s only one determinant function on M(n, R), I m going to derive another formula for the determinant It involves permutations
More informationMathematics 13: Lecture 10
Mathematics 13: Lecture 10 Matrices Dan Sloughter Furman University January 25, 2008 Dan Sloughter (Furman University) Mathematics 13: Lecture 10 January 25, 2008 1 / 19 Matrices Recall: A matrix is a
More information3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions
A. LINEAR ALGEBRA. CONVEX SETS 1. Matrices and vectors 1.1 Matrix operations 1.2 The rank of a matrix 2. Systems of linear equations 2.1 Basic solutions 3. Vector spaces 3.1 Linear dependence and independence
More information1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )
Direct Methods for Linear Systems Chapter Direct Methods for Solving Linear Systems Per-Olof Persson persson@berkeleyedu Department of Mathematics University of California, Berkeley Math 18A Numerical
More informationMatrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices
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
More informationVectors and Matrices
Vectors and Matrices Scalars We often employ a single number to represent quantities that we use in our daily lives such as weight, height etc. The magnitude of this number depends on our age and whether
More informationCS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:
CS100: DISCRETE STRUCTURES Lecture 3 Matrices Ch 3 Pages: 246-262 Matrices 2 Introduction DEFINITION 1: A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m x n
More informationSystems of Linear Equations and Matrices
Chapter 1 Systems of Linear Equations and Matrices System of linear algebraic equations and their solution constitute one of the major topics studied in the course known as linear algebra. In the first
More informationThis last statement about dimension is only one part of a more fundamental fact.
Chapter 4 Isomorphism and Coordinates Recall that a vector space isomorphism is a linear map that is both one-to-one and onto. Such a map preserves every aspect of the vector space structure. In other
More informationMath 416, Spring 2010 Matrix multiplication; subspaces February 2, 2010 MATRIX MULTIPLICATION; SUBSPACES. 1. Announcements
Math 416, Spring 010 Matrix multiplication; subspaces February, 010 MATRIX MULTIPLICATION; SUBSPACES 1 Announcements Office hours on Wednesday are cancelled because Andy will be out of town If you email
More informationLecture 9. Econ August 20
Lecture 9 Econ 2001 2015 August 20 Lecture 9 Outline 1 Linear Functions 2 Linear Representation of Matrices 3 Analytic Geometry in R n : Lines and Hyperplanes 4 Separating Hyperplane Theorems Back to vector
More informationMatrices BUSINESS MATHEMATICS
Matrices BUSINESS MATHEMATICS 1 CONTENTS Matrices Special matrices Operations with matrices Matrix multipication More operations with matrices Matrix transposition Symmetric matrices Old exam question
More informationWorksheet 3: Matrix-Vector Products ( 1.3)
Problem 1: Vectors and Matrices. Worksheet : Matrix-Vector Products ( 1.) (c)015 UM Math Dept licensed under a Creative Commons By-NC-SA.0 International License. Let us TEMPORARILY think of a vector as
More informationBLAS: Basic Linear Algebra Subroutines Analysis of the Matrix-Vector-Product Analysis of Matrix-Matrix Product
Level-1 BLAS: SAXPY BLAS-Notation: S single precision (D for double, C for complex) A α scalar X vector P plus operation Y vector SAXPY: y = αx + y Vectorization of SAXPY (αx + y) by pipelining: page 8
More informationSystems of Linear Equations and Matrices
Chapter 1 Systems of Linear Equations and Matrices System of linear algebraic equations and their solution constitute one of the major topics studied in the course known as linear algebra. In the first
More informationWhat is the Matrix? Linear control of finite-dimensional spaces. November 28, 2010
What is the Matrix? Linear control of finite-dimensional spaces. November 28, 2010 Scott Strong sstrong@mines.edu Colorado School of Mines What is the Matrix? p. 1/20 Overview/Keywords/References Advanced
More informationKnowledge Discovery and Data Mining 1 (VO) ( )
Knowledge Discovery and Data Mining 1 (VO) (707.003) Review of Linear Algebra Denis Helic KTI, TU Graz Oct 9, 2014 Denis Helic (KTI, TU Graz) KDDM1 Oct 9, 2014 1 / 74 Big picture: KDDM Probability Theory
More informationEE263 Review Session 1
EE263 Review Session 1 October 5, 2018 0.1 Importing Variables from a MALAB.m file If you are importing variables given in file vars.m, use the following code at the beginning of your script. close a l
More informationa11 a A = : a 21 a 22
Matrices The study of linear systems is facilitated by introducing matrices. Matrix theory provides a convenient language and notation to express many of the ideas concisely, and complicated formulas are
More informationLinear Equations and Matrix
1/60 Chia-Ping Chen Professor Department of Computer Science and Engineering National Sun Yat-sen University Linear Algebra Gaussian Elimination 2/60 Alpha Go Linear algebra begins with a system of linear
More informationMath 304 (Spring 2010) - Lecture 2
Math 304 (Spring 010) - Lecture Emre Mengi Department of Mathematics Koç University emengi@ku.edu.tr Lecture - Floating Point Operation Count p.1/10 Efficiency of an algorithm is determined by the total
More informationINSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES
1 CHAPTER 4 MATRICES 1 INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES 1 Matrices Matrices are of fundamental importance in 2-dimensional and 3-dimensional graphics programming
More information