Matrices BUSINESS MATHEMATICS 1
CONTENTS Matrices Special matrices Operations with matrices Matrix multipication More operations with matrices Matrix transposition Symmetric matrices Old exam question Further study 2
MATRICES A matrix is a rectangular array of numbers or variables. We often use bold non-italic capital letters to refer to them, e.g., Q = 3 2 2 0 12.5 12.7, A = a 1,1 a 1,2 a 1,n a 2,1 a 2,2 a 2,n. a m,1 a m,2 a m,n 3
MATRICES A matrix is a rectangular array of numbers or variables. We often use bold non-italic capital letters to refer to them, e.g., Q = 3 2 2 0 12.5 12.7, A = a 1,1 a 1,2 a 1,n a 2,1 a 2,2 a 2,n. a m,1 a m,2 a m,n Terminology these matrices consist of 6 elements the order (or size is) 3 2 respectively m n when m = n, the matrix is a square matrix when m n, the matrix is rectangular 4
MATRICES.and even more on notation [recall Mathematics is a language ] You may use either brackets: or Elements are identified by indices: a ij or a i,j We define A = a ij m n as the matrix of order m n matrix with elements a ij, i = 1, m, j = 1,, n: a 11 a 12 a 1n a 21 a 22 a 2n A = a m1 a m2 a mn 5
MATRICES Conventions: element a row index,column index order m row n column when no ambiguity you write a ij instead of a i,j 6
MATRICES Conventions: element a row index,column index order m row n column when no ambiguity you write a ij instead of a i,j Note the order of the indices 7
MATRICES Conventions: element a row index,column index order m row n column when no ambiguity you write a ij instead of a i,j In Q = 3 2 2 0 12.5 12.7 the element q 2,1 refers to the cell at row 2 and column 1 so the value is 2 while q 1,2 is in row 1 and column 2 and has value 2 The order of Q is 3 2, not 2 3 8
MATRICES Conventions: element a row index,column index order m row n column when no ambiguity you write a ij instead of a i,j In Q = 3 2 2 0 12.5 12.7 the element q 2,1 refers to the cell at row 2 and column 1 so the value is 2 while q 1,2 is in row 1 and column 2 and has value 2 A column is vertical... The order of Q is 3 2, not 2 3 9
EXERCISE 1 Given is Z = z ij = 1 0 3 5 4 2. Find z 1,2 + z 2,2. 10
SPECIAL MATRICES Zero matrix: 0 = 0 0 0 0 0 0 0 0 0 for a matrix of any order 12
SPECIAL MATRICES Zero matrix: 0 = 0 0 0 0 0 0 0 0 0 for a matrix of any order 1 0 0 0 1 0 Identity matrix: I = 0 0 1 for a square matrix (so, m = n) 13
OPERATIONS WITH MATRICES We can define some basic operations with matrices, similar to the basic operations with vectors Addition A + B, through a + b ij = a ij + b ij Multiplication ca, through ca ij = c a ij Negative matrix A, through a ij = a ij Subtraction A B, through a b ij = a ij b ij Equality A = B, through a ij = b ij 14
OPERATIONS WITH MATRICES We can define some basic operations with matrices, similar to the basic operations with vectors Addition A + B, through a + b ij = a ij + b ij Multiplication ca, through ca ij = c a ij Negative matrix A, through a ij = a ij Subtraction A B, through a b ij = a ij b ij Equality A = B, through a ij = b ij The matrices A and B must be of equal order 15
OPERATIONS WITH MATRICES We can define some basic operations with matrices, similar to the basic operations with vectors Addition A + B, through a + b ij = a ij + b ij Multiplication ca, through ca ij = c a ij Negative matrix A, through a ij = a ij Subtraction A B, through a b ij = a ij b ij Equality A = B, through a ij = b ij But what about the inner product? Not available for matrices instead we have matrix multiplication. 16
EXERCISE 2 Given is A = 2 1 3 0 and B = 0 2 1 3. Find 2A B. 17
MATRIX MULTIPLICATION Let A and B be two matrices, of order m p respectively p n. We define the matrix product AB as AB ij = k=1 alternatively written as A B but do not write A B p a ik b kj, i = 1,, m, j = 1,, n 19
MATRIX MULTIPLICATION Let A and B be two matrices, of order m p respectively p n. We define the matrix product AB as p AB ij = k=1 a ik b kj, i = 1,, m, j = 1,, n alternatively written as A B but do not write A B The matrices A Element (i,j) and is given B must by be of row i times column equal order j 20
MATRIX MULTIPLICATION Let A and B be two matrices, of order m p respectively p n. We define the matrix product AB as AB ij = k=1 alternatively written as A B but do not write A B p a ik b kj, i = 1,, m, j = 1,, n Notice: the result of multiplication of two matrices is a matrix while the inner product of two vectors is number. 21
MATRIX MULTIPLICATION Illustration: AB 1,2 = σ2 k=1 a 1,k b k,2 = a 1,1 b 1,2 + a 1,2 b 2,2 AB 3,3 = σ2 k=1 a 3,k b k,3 = a 3,1 b 1,3 + a 3,2 b 2,3 22
MATRIX MULTIPLICATION Illustration: AB 1,2 = σ2 k=1 a 1,k b k,2 = a 1,1 b 1,2 + a 1,2 b 2,2 AB 3,3 = σ2 k=1 a 3,k b k,3 = a 3,1 b 1,3 + a 3,2 b 2,3 Recall: row times column 23
MATRIX MULTIPLICATION Notice the orders of the matrices: A m p B p n = AB m n so #columns in A should match #rows in B (here p) and #rows in AB is #rows in A (here m) and #columns in AB is #columns in B (here n) 24
MATRIX MULTIPLICATION Notice the orders of the matrices: A m p B p n = AB m n so #columns in A should match #rows in B (here p) and #rows in AB is #rows in A (here m) and #columns in AB is #columns in B (here n) Let s check: given a matrix A of order 3 3 and a matrix B of order 3 2, then AB exists and is of order 3 2 BA does not exist what about AA? and BB? and AB AB? 25
EXERCISE 3 Given is A = 2 1 3 0 and B = 0 2 1 3. Find A B. 26
MATRIX MULTIPLICATION It holds that for suitable A, B, and C A B + C = AB + AC (distributive property) AB C = A BC = ABC (associative property) But not that AB = BA (commutative property) 28
MATRIX MULTIPLICATION It holds that for suitable A, B, and C A B + C = AB + AC (distributive property) AB C = A BC = ABC (associative property) But not that AB = BA (commutative property) Example: take A = 1 2 3 6 AB = 0 0 0 0 2 8 and B = 1 4, then = 22 44 11 22 = BA 29
MATRIX MULTIPLICATION It holds that for suitable A, B, and C A B + C = AB + AC (distributive property) AB C = A BC = ABC (associative property) But not that AB = BA (commutative property) Example: take A = 1 2 3 6 AB = 0 0 0 0 2 8 and B = 1 4, then = 22 44 11 22 = BA Notice that in this example: AB = 0, while A 0 and B 0 while for numbers ab = 0 a = 0 or b = 0 30
MATRIX MULTIPLICATION Some properties (for suitable A, B, and C): A0 = 0 and 0A = 0 AI = A and IA = A AB = AC B = C 31
MATRIX MULTIPLICATION Some properties (for suitable A, B, and C): A0 = 0 and 0A = 0 AI = A and IA = A AB = AC B = C Let s examine this last property: A = 1 2 3 6, B = 3 4 2 3 1 4, and C = 1 1 Then, AB = AC = 1 2 3 6 32
MATRIX MULTIPLICATION What about powers of a matrix? We define A 2 = AA for any square matrix A [why square?] Likewise A 3 = AAA, and, in general, A n = ቊ A n = 1 n = 2,3, AA n 1 33
MATRIX MULTIPLICATION What about powers of a matrix? We define A 2 = AA for any square matrix A [why square?] Likewise A 3 = AAA, and, in general, A n = ቊ A n = 1 n = 2,3, AA n 1 mind the difference between a square matrix and a squared matrix 34
MATRIX MULTIPLICATION What about powers of a matrix? We define A 2 = AA for any square matrix A [why square?] Likewise A 3 = AAA, and, in general, A n = ቊ A n = 1 n = 2,3, AA n 1 So what might A 0 be? 35
EXERCISE 4 Given is A = 2 1 3 0 and B = 0 2 1 3. Find A 2 B. 36
MORE OPERATIONS WITH MATRICES Note that every matrix operation must be explicitly defined In matrix algebra mathematicians try to find a definition that is useful (why AB is useful will become clear later on) reduces to the similar operation for scalars 38
MORE OPERATIONS WITH MATRICES Note that every matrix operation must be explicitly defined In matrix algebra mathematicians try to find a definition that is useful (why AB is useful will become clear later on) reduces to the similar operation for scalars Note that no all scalar operations have an extension to matrices, for example, ln A, 1, A A all are not defined. 39
MORE OPERATIONS WITH MATRICES Note that every matrix operation must be explicitly defined In matrix algebra mathematicians try to find a definition that is useful (why AB is useful will become clear later on) reduces to the similar operation for scalars Note that no all scalar operations have an extension to matrices, for example, ln A, 1, A A all are not defined. We will soon introduce a sort of division by a matrix: matrix inversion 40
MATRIX TRANSPOSITION Consider A = A m n = a 1,1 a 1,2 a 1,n a 2,1 a 2,2 a 2,n a m,1 a m,2 a m,n The transpose of A, denoted by A is given by A = a 1,1 a 2,1 a m,1 a 1,2 a 2,2 a m,2 a 1,n a 2,n a m,n 41
MATRIX TRANSPOSITION Consider A = A m n = a 1,1 a 1,2 a 1,n a 2,1 a 2,2 a 2,n a m,1 a m,2 a m,n The transpose of A, denoted by A is given by reflection in the diagonal A = a 1,1 a 2,1 a m,1 a 1,2 a 2,2 a m,2 a 1,n a 2,n a m,n 42
MATRIX TRANSPOSITION Consider A = A m n = a 1,1 a 1,2 a 1,n a 2,1 a 2,2 a 2,n a m,1 a m,2 a m,n The transpose of A, denoted by A is given by A = a 1,1 a 2,1 a m,1 a 1,2 a 2,2 a m,2 a 1,n a 2,n a m,n In words, A has n rows and m columns so A is a (n m)-matrix and row i of A is column i of A 43
MATRIX TRANSPOSITION Some properties (for suitable A, B, and C): A = A A + B = A + B AB = B A and (therefore!) ABC = C B A [Check!] ca = ca 44
SYMMETRIC MATRICES Matrix A is symmetric if and only if A = A, i.e., if and only if a ij = a ji for all i, j Note: only a square matrix can be symmetric! 45
SYMMETRIC MATRICES Matrix A is symmetric if and only if A = A, i.e., if and only if a ij = a ji for all i, j Note: only a square matrix can be symmetric! Examples: A = 1 3 3 6 is symmetric 46
SYMMETRIC MATRICES Matrix A is symmetric if and only if A = A, i.e., if and only if a ij = a ji for all i, j Note: only a square matrix can be symmetric! Examples: A = 1 3 3 6 is symmetric You can see this for the example without even doing a calculation! 47
SYMMETRIC MATRICES Matrix A is symmetric if and only if A = A, i.e., if and only if a ij = a ji for all i, j Note: only a square matrix can be symmetric! Examples: A = 1 3 3 6 is symmetric If A = 1 2 1 3 6 5 then AA and A A are symmetric but A A AA 48
SYMMETRIC MATRICES Matrix A is symmetric if and only if A = A, i.e., if and only if a ij = a ji for all i, j Note: only a square matrix can be symmetric! Examples: A = 1 3 3 6 is symmetric If A = 1 2 1 3 6 5 then AA and A A are symmetric but A A AA In general A A and AA are symmetric for an arbitrary matrix A. 49
EXERCISE 5 Given is X = 4 2 5 0 3 1. Find X. 50
OLD EXAM QUESTION 22 October 2014, Q1d 52
OLD EXAM QUESTION 10 December 2014, Q1f 53
FURTHER STUDY Sydsæter et al. 5/E 9.2-9.3 Tutorial exercises week 3 matrices matrix addition, matrix multiplication, matrix transpose matrix multiplication is not commutative 54