This document provides an introduction to basic matrix theory. It defines key matrix concepts like matrices, vectors, transpose, addition and subtraction of matrices, and multiplication of matrices. Worked examples are provided to demonstrate how to perform operations like addition, subtraction and multiplication on matrices.
This document provides an introduction to basic matrix theory. It defines key matrix concepts like matrices, vectors, transpose, addition and subtraction of matrices, and multiplication of matrices. Worked examples are provided to demonstrate how to perform operations like addition, subtraction and multiplication on matrices.
This is the first of two tutorials on matrix theory. On completion you should be able to do the following.
Define a matrix.
Explain arrays and column vectors.
Define the trace of a matrix.
Define the diagonal matrix.
Define the unit matrix.
Define the zero matrix.
Define the transpose matrix.
Add and subtract matrices.
Multiply matrices.
1. INTRODUCTION
In maths we have many ways of expressing numbers and each method uses its own rules of manipulation (Algebra). For example, vector algebra is quite different but logical and very useful in the solution of problems. Complex numbers is another way of using numbers that lets us solve problems that cannot be solved by normal algebra. This is closely linked with vector algebra. Matrix theory is another tool that helps us solve problems of a particular kind in Engineering and Science and is also linked to vector theory. The theory is quite difficult to understand and the rules used to manipulate a matrix are quite complex. It will help if you have studied vector theory. In order to fully appreciate matrix theory, you will need to have studied maths to quite an advanced level. This tutorial is only a beginning. D.J . Dunn 1
2. MATRIX DESCRIPTION
A matrix is an array of numbers or elements arranged in columns and rows. Each element is designated by a letter followed by the row number and column number as shown. The matrix shown might be labelled as A and all the elements as a.
The size of the array is always stated as: (the number of rows) x (number of columns) The one shown is a 4 x 3 matrix.
3. REPRESENTING A VECTOR AS A MATRIX
Consider a vector v in a three coordinate system x, y and z. The three coordinates are the elements of the single row a 11 , a 12 and a 13 . These are simply numbers
In vector algebra we define the vector as: v =a 11 x +a 12 y +a 13 z
In matrix notation we represent the vector as
When you have learned the rules of multiplication we will show that this is consistent with the rule for multiplying arrays.
A single vector is represented as a single row or column but column vectors are the normal.
It is normal to designate a vector with a bold lower case letter (such as v) except when it is X Y or Z and the print type used is Sans Serif.
We might designate the single row as matrix A and the single column as vector X. We could then write the vector as: A X =v 4. MATRIX BASICS
ARRAY
An array is a set of data arranged in m rows and n columns as shown and designated with a capital letter (Sans Serif) corresponding to the lower case used for each element.
SIZE
The size of the array is designated as m x n so the above array is a 3 x 3 array.
SQUARE ARRAY
A square array or matrix has the same number of rows and columns. The array above is a square array 3 x 3.
D.J . Dunn 2 TRACE
In a square matrix, the diagonal with elements a 11 , a 22 , a 33 ...... is called the LEADING DIAGONAL (also called the main or principal diagonal). The sum of these elements is called the TRACE and has a use in further studies. Trace A =a 11 +a 22 +a 33 + ...... DIAGONAL MATRIX
This is a matrix in which all the elements are zero except the leading diagonal.
UNIT MATRIX
This is a special case of the diagonal matrix in which all the leading elements are 1. This is the matrix shown. It will be found that any array multiplied by the unit matrix is unchanged. The unit matrix is usually designated I.
ZERO MATRIX
This is also called the null matrix and every element in it is zero. It will be found that any array multiplied by the zero matrix has zero for every element.
TRANSPOSED MATRIX
This a matrix in which row 1 becomes column 1; row 2 becomes column 2 and so on. The transpose of matrix A is designated as A T . An example is shown.
Note that the transpose of a unit matrix is still a unit matrix.
5. ADDING and SUBTRACTING MATRICES
Consider how we add two similar equations (2x +3y +5 z) +(3x +4y - 2 z) We arrange them so the variables line up in columns and then add the coefficients.
2x +3y +5 z 3x +4y 2 z Add 5x +7y +3z To show this as a matrix operation we would write the following.
In other words we simply add or subtract the elements in the same position in each array. (So it follows that the arrays must be the same size). When we add and subtract two matrices, we dont need to write in the column vector as it is the same for each part so we only need to write
D.J . Dunn 3
WORKED EXAMPLE No.1
Add and subtract the two arrays shown
6. MULTIPLACTION
SCALAR
If an equation is multiplied by a constant (scalar) every coefficient will be multiplied by that constant so a matrix may be easily multiplied or divided by a scalar.
VECTOR
Consider how we multiply a matrix A by a column vector X to obtain a column vector b. We are trying to find A X =b
We want the result to be three equations a 11 x +a 12 y +a 13 z =b 1 a 21 x +b 22 y +c 23 z =b 2
a 31 x +b 32 y +c 33 z =b 3
It follows that the rule is (column 1 of A) x (row 1 of X) (column 2 of A) x (row 2 of X) (column 3 of A) x (row 3 of X)
It will be seen next that this is a special case of multiplication of arrays in general. For two arrays the rule is more complex. D.J . Dunn 4 ARRAY MULTIPLICATION
Consider how we multiply an array A by another array B to obtain a new array C.
Each element in C is obtained as follows. c 11 =a 11 b 11 +a 12 b 21 c 12 =a 11 b 12 +a 12 b 12 c 21 =a 21 b 11 +a 22 b 21 c 22 =a 21 b 12 +a 22 b 22 This is the general rule. Note that a row x column produces a row. For element c 11 , take the first row of A and multiply by the first column of B.
For element c 12 , take the first row of A and multiply by the second column of B.
For element c 21 , take the second row of A and multiply by the first column of B.
For element c 22 , take the second row of A and multiply by the second column of B.
The rule may be summarised as follows and extended to larger arrays.
Important points to note: the product AB produces a different result to the product BA The rule only works if the number of columns in A are equal to the number of rows in B
OTHER USEFUL RULES
It can be shown that the normal rules of multiplication may be observed if the order of the matrices A, B, C ..... are maintained on the left side of the equality sign.
A(BC) = (AB)C (A + B)C = AC + BC A(B + C) = AB + AC
It can also be shown that (AB) T = B T A T D.J . Dunn 5
WORKED EXAMPLE No.2
Determine the result of multiplying a Row vector A by the Column vector B
SOLUTION
There is only one row and one column so the resulting is a single number obtained as follows:
(2 x 4) +(3 x 1) +(4 x 5) =31
WORKED EXAMPLE No.3
Determine the result of multiplying a Row vector x, y, z by the Column vector x,y,z.
SOLUTION
There is only one row and one column so is a single element found as follows. a 11 =(x)(x) +(y)(y) +(z)(z) =x 2 +y 2 +z 2
Note the row vector is the transpose of the column vector so it follows that X T X =square of the length of the vector.
WORKED EXAMPLE No.4
Given matrix A and unit matrix I
Show that A I =A where I is the unit matrix.
D.J . Dunn 6
SOLUTION
The rule is row x column so the first row of the new matrix is: Element 1,1 is (2 x 1) +(5 x 0) +(7 x 0) =2 Element 1,2 is (2 x 0) +(5 x 1) +(7 x 0) =5 Element 1,3 is (2 x 0) +(5 x 0) +(7 x 1) =7
The second row of the new matrix is: Element 2,1 is (4 x 1) +(8 x 0) +(3 x 0) =4 Element 2,2 is (4 x 0) +(8 x 1) +(3 x 0) =8 Element 2,3 is (4 x 0) +(8 x 0) +(3 x 1) =3
The third row of the new matrix is: Element 3,1 is (9 x 1) +(1 x 0) +(4 x 0) =9 Element 3,2 is (9 x 0) +(1 x 1) +(4 x 0) =1 Element 3,3 is (9 x 0) +(1 x 0) +(4 x 1) =4
WORKED EXAMPLE No.5
Find the product of the A and B and the product of B and A
SOLUTION
The rule is row x column so the first row of the new matrix is: Element 1,1 is (2 x 7) +(8 x 3) =38 Element 1,2 is (2 x -4) +(8 x 12) =88
The second row of the new matrix is: Element 2,1 is (5 x 7) +(-6 x 3) =17 Element 2,2 is (5 x -4) +(-6 x 12) =-92
Repeating the process for B A we get the following.
D.J . Dunn 7
WORKED EXAMPLE No.6
Find the product of the A and B.
SOLUTION
WORKED EXAMPLE No.7
Find the product of A and B.
SOLUTION
Remember the first element is Row 1 Col 1
The next element is Row 1 Col 2
The next element is Row 2 Col 1
Continue Row 2 Col 2, then Row 3 Col 1 then Row 3 Col 2 to get the final array
D.J . Dunn 8
WORKED EXAMPLE No.8
Given A and B (the same as the last example) show that (AB) T = B T A T
SOLUTION
It has already been shown that:
Transpose:
Now transpose A and B:
Now multiply B T and A T and find:
This is the same as (AB) T .
D.J . Dunn 9
SELF ASSESSMENT EXERCISE No.1
1. Find the transpose of the following.
2. Given
Find (i) C = A + B (ii) C = A B (iii) A T (iv) B T (v) C= AB (vi) C= B A