Basic Matrix Operations Previously, matrices were used to solve systems of equations. There are also some basic operations of matrices. These include addition, subtraction, multiplication, transpose, and trace of matrices. Matrix Addition and Subtraction: Two or matrices can be added or subtracted if there dimensions are the same. If they are not the same, then the operation is not possible. 1 2 Example: A = 3 4 1 3 B= − 2 4 1 3 C = 0 − 1 2 1 Since both A and B are 2 x 2 matrices, then we can add and subtract them. To add or subtract matrices of the same size, add or subtract corresponding entries. 1 2 1 3 2 5 = + 3 4 − 2 4 1 8 A + B = 1 2 1 3 0 − 1 = − 3 4 − 2 4 5 0 A – B = If we try to add or subtract matrix A and C, per say, we will not be able to because there are different sizes. So the result will be undefined. Matrix Multiplication: Matrix multiplication behaves differently than that of matrix addition and subtraction. It requires the number of columns of the first matrix be equal to the number of rows in the second matrix. If they are not the same, then the operation is not possible. 1 2 Example: A = 3 4 1 3 B= − 2 4 1 C = 2 3 1 2 1 3 (1)(1) + (2)(−2) (1)(3) + (2)(4) − 3 11 − 2 4 = (3)(1) + (4)(−2) (3)(3) + (4)(4) = − 5 25 3 4 AB = (1)(2) + (3)(4) 10 14 1 3 1 2 (1)(1) + (3)(3) = \ = − 2 4 3 4 (−2)(1) + (4)(3) (−2)(2) + (4)(4) 10 12 BA = *Note: Notice that the product AB and BA are different results. Thus by this example, matrix multiplication is NOT communative, ie, AB ≠ BA. AC = UNDEFINED A is a 2 x 2 matrix whereas C is a 3 x 1 matrix. The number of columns in A doesn’t equal the number of row in C. 3 3C = 6 9 This is just scalar multiplication. To multiply a matrix by a constant, just multiply all the entries in the matrix by the number. Transpose: To transpose a matrix, take the rows of the matrix and turn them into columns or take the columns of the matrix and turn them into rows. It is denoted by AT. 1 − 2 1 −1 2 is just the matrix − 1 3 . Example: The transpose of the matrix − 2 3 − 3 2 − 3 1 3 1 3 is just itself, ie, Example: The transpose of the matrix 3 1 . Whenever this 3 1 happens, then we say that the matrix is symmetric. In other words, AT = A. 0 − 3 is just the negative of itself, ie, 3 0 Example: The transpose of the matrix 0 3 − 3 0 . 0 − 3 0 3 = −1 , then we say that the matrix is anti-symmetric. In other 3 0 − 3 0 Since words AT = -A. Trace: The trace of a matrix is defined as adding the diagonal entries of a matrix of a square matrix. If the matrix is not square, we can’t compute the trace of a matrix. 1 2 is just 1 + 4 = 5. 3 4 Example: The trace of the matrix 1 3 5 because it is not square. 2 4 6 Example: We can’t compute the trace of