By the end of this chapter, you will be able to:
Mastering these skills will help you solve real-world engineering problems confidently and precisely, making your work reliable and effective.
A matrix is a compact way of organising numbers in rows and columns so that large amounts of related data can be stored, compared and processed together. Businesses, schools, hospitals and farms already keep such data in tables, such as stock sheets, mark lists and feed schedules. Matrix algebra gives us rules for working with whole tables at once instead of one number at a time. This topic builds the vocabulary, notation and basic operations that the rest of the chapter depends on.
A matrix is a rectangular arrangement of numbers, called elements or entries, set out in horizontal rows and vertical columns and enclosed in brackets. The size of a matrix is called its order, written m × n, where m is the number of rows and n is the number of columns. The number of rows is always stated first.
Example: A secondary school records the marks of three students in Mathematics, English and Kiswahili.
Maths English Kiswahili
Asha [ 72 65 80 ]
Brian [ 58 70 66 ]
Cheri [ 81 77 69 ]
The matrix of marks is the block of nine numbers inside the brackets. It has 3 rows and 3 columns, so its order is 3 × 3. The words in the margins are labels for our understanding and are not part of the matrix.
The key terms are:
In running text, a matrix is sometimes written on one line with semicolons separating the rows. For example, [2 5; 7 1] means the matrix with first row 2, 5 and second row 7, 1.
Matrices are named according to their order and the pattern of their elements. Recognising the type quickly tells you which operations and shortcuts are available. For instance, only square matrices have a main diagonal, and this idea is used throughout the later topics.
Mathematicians use a fixed notation so that any matrix and any one of its elements can be named without ambiguity. The notation is the same for small tables and for very large ones, and it is the language used in every later topic.
The conventions are:
Example: A hotel records the number of rooms booked from Monday to Thursday.
C = [ 12 15 9 14 ] Single
[ 20 25 18 22 ] Double
[ 4 6 5 8 ] Suite
The matrix has 3 rows and 4 columns, so C has order 3 × 4 and 12 elements. The element c12 = 15 means that 15 single rooms were booked on Tuesday. The element c23 = 18 means that 18 double rooms were booked on Wednesday. The element c34 = 8 is the number of suites booked on Thursday.
Equality can be used to find unknown elements. If [x 3; 5 y] = [2 3; 5 7], the matrices have the same order, so corresponding elements must be equal. This gives x = 2 and y = 7.
Matrices can be added, subtracted and multiplied by an ordinary number, called a scalar. Addition and subtraction work position by position, so they are possible only when the matrices have exactly the same order. Scalar multiplication affects every element and is always possible.
To add two matrices of the same order, add the elements in corresponding positions. The result has the same order as the matrices being added.
Example: A SACCO records its monthly collections in Ksh thousands. Rows show shares and savings, and columns show Branch 1, Branch 2 and Branch 3.
January J = [ 120 95 80 ] February F = [ 110 100 90 ]
[ 60 45 70 ] [ 55 50 65 ]
Formula: J + F = [jij + fij]
Substitution and working:
J + F = [ 120+110 95+100 80+90 ]
[ 60+55 45+50 70+65 ]
Result:
J + F = [ 230 195 170 ]
[ 115 95 135 ]
The total collected over the two months by Branch 2 for savings is 95 thousand, that is Ksh 95,000.
The procedure for adding or subtracting matrices is:
Subtraction follows the same rule as addition: the elements of the second matrix are subtracted from the corresponding elements of the first. The order of the matrices matters, because A − B is generally not equal to B − A.
Example: A hardware company with three outlets records opening stock S and units sold D. The rows are cement bags and iron sheets, and the columns are Outlet 1, Outlet 2 and Outlet 3.
S = [ 200 150 80 ] D = [ 45 60 30 ]
[ 120 90 60 ] [ 25 40 20 ]
Formula: S − D = [sij − dij]
Substitution and working:
S − D = [ 200−45 150−60 80−30 ]
[ 120−25 90−40 60−20 ]
Result:
S − D = [ 155 90 50 ]
[ 95 50 40 ]
The closing stock of iron sheets at Outlet 2 is 50 sheets.
To multiply a matrix by a scalar k, multiply every element of the matrix by k. The order of the matrix does not change. Scalar multiplication is useful for scaling data, for example converting a per-unit table to a total for many units.
Example: On a dairy farm, one cow is fed per day the following amounts in kg. The rows are morning and evening, and the columns are hay and silage.
R = [ 4 6 ]
[ 3 5 ]
Formula: 8R = [8 × rij]
Substitution and working:
8R = [ 8×4 8×6 ]
[ 8×3 8×5 ]
Result:
8R = [ 32 48 ]
[ 24 40 ]
The herd of 8 cows therefore needs 48 kg of silage each morning.
Multiplying by −1 changes the sign of every element. This shows that subtraction can be written as addition: A − B = A + (−1)B. As a further illustration, 3 × [2 -1 4; 0 5 -3] = [6 -3 12; 0 15 -9].
For matrices A, B and C of the same order, and scalars k and m, the following hold:
Some square matrices have patterns in their elements that make them especially useful. They simplify calculations and represent real situations such as distances between places or balances between people. This section studies four of them in detail.
All four matrices below are square. Each is recognised by the relationship between its elements and the main diagonal.
Identity matrix:
The identity matrix of order n, written In or simply I, plays the role that the number 1 plays in ordinary arithmetic. When matrix multiplication is introduced later in this chapter, multiplying any matrix by an identity matrix of a suitable order will be seen to leave it unchanged. Its main properties are:
I2 = [ 1 0 ] I3 = [ 1 0 0 ]
[ 0 1 ] [ 0 1 0 ]
[ 0 0 1 ]
Diagonal matrix:
In a diagonal matrix the elements on the main diagonal may be any numbers, including zero, but every other element must be zero. The pattern is preserved by the basic operations: adding, subtracting or scaling diagonal matrices of the same order always gives another diagonal matrix.
Example:
[ 2 0 ] [ 5 0 ] [ 7 0 ]
[ 0 3 ] + [ 0 -1 ] = [ 0 2 ]
Only the diagonal entries need to be calculated, because the zeros in all other positions remain zeros. This makes diagonal matrices very quick to handle.
Symmetric matrix:
A square matrix is symmetric when each element equals its mirror image across the main diagonal, that is, aij = aji for every i and j. The rows read the same as the corresponding columns. To test a matrix, compare the element in row 1, column 2 with that in row 2, column 1, and continue for every pair of positions above and below the diagonal.
Example: The road distances in km between three depots of a transport contractor are given below (illustrative figures only).
D = [ 0 160 350 ]
[ 160 0 190 ]
[ 350 190 0 ]
The distance from depot 1 to depot 3 is the same as from depot 3 to depot 1, so d13 = d31 = 350. The same holds for every pair, so D is symmetric. The diagonal of zeros shows that each depot is 0 km from itself. The sum of two symmetric matrices of the same order is also symmetric.
Skew-symmetric matrix:
A square matrix is skew-symmetric when aij = −aji for every i and j. Each element is the negative of its mirror image across the main diagonal. Putting i = j gives aii = −aii, which can only be true if aii = 0, so every main diagonal element of a skew-symmetric matrix must be zero.
Example: Three members of a SACCO settle their small debts to each other. The element aij is the net amount in Ksh hundreds that member j owes member i, so a negative value means member i owes member j.
N = [ 0 4 -2 ]
[ -4 0 6 ]
[ 2 -6 0 ]
Here n12 = 4 and n21 = −4, which describes the same debt from the two points of view. The same is true of n13 = −2 and n31 = 2, and of n23 = 6 and n32 = −6. Every diagonal entry is 0, because nobody owes themselves anything.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountAt the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.