Matrix

Matrix Operations

The rules for addition, substraction, multiplications and divisions between matrices are as follows. Let first assume that matrix A and B are used to construct matrix Z. It must follows that for

The rules for multiplication and division of a matrix by a scalar (a real number) are simpler. If matrix Z is constructed by multiplying all elements of matrix A by a scalar c, then its elements are zij = c*aij. In an analogous manner, dividing matrix A by c gives zij = (1/c)*aij.

All these operations are illustrated in Figure 1. Let's revisit these one by one.

Figure 1. Some matrix operations.

Addition and Substraction of Matrices

To add or substract matrices these must be of identical order. This just means that the matrices involved must have the same number of rows and columns. If they don't have the same number of rows and columns we cannot add or substract these.

The expression

zij = aij + bij

means "to element in row i, column j of matrix A add element in row i, column j of matrix B". If we do this with each element of A and B we end with matrix Z. An example is given in Figure 2.

Figure 2. Addition operation.

Substraction is performed in analogous manner. The expression

zij = aij - bij

means "to element in row i, column j of matrix A deduct element in row i, column j of matrix B". If we do this with each element of A and B we end with matrix Z. See Figure 3.

Figure 3. Substraction operation.

Multiplication of Matrices

Consider two matrices A and B with the following characteristics: the number of columns in A equals the number of rows in B. These are conformable with respect to one another, and they can be multiplied together to form a new matrix Z.

The expression

zij = ai1* b1j + ai2* b2j + ai3* b3j + ... aim* bnj

means "add the products obtained by multiplying elements in each i row of matrix A by elements in each j column of matrix B". Figure 4 illustrates what we mean by this statement.

Figure 4. Multiplication operation.

Matrix multiplication has a catch as we mentioned before. The order in which we multiply terms does matter. The reason for this is that we need to multiply row elements by column elements and one by one. Therefore A*B and B*A can produce different results. We say "can produce" because there exist special cases in which the operation is conmutative (order does not matter). An example of this is when we deal with diagonal matrices. Diagonal matrices were described in Part 1.

Multiplication and Division of Matrices by a Scalar

The rules for multiplication and division of a matrix by a scalar are similar. Since multiplying a number x by 1/c is the same as dividing x by c, lets consider these operations at once.

If all elements of matrix A are multiplied by a scalar c to construct matrix Z, hence zij = c*aij. Similarly dividing matrix A by c gives zij = (1/c)*aij. The expression

zij = c*aij

means "multiply each element in row i column j times c", and the expression

zij = 1/c*aij = aij/c

means "divide each element in row i column j by c". These two operations are shown in Figure 5, where c = 2.

Figure 5. Multiplication and division of a matrix by a scalar.

Figure 6 shows that a scalar matrix is obtained when an identity matrix is multiplied by a scalar. As we will see in Part 3 of this tutorial, deducting a scalar matrix from a regular matrix is an important operation.

Figure 6. Scalar matrix obtained by multiplying an identity matrix by a scalar.

Orthogonal Matrices

A regular matrix (one whose determinant is not equal to zero) M is said to be orthogonal if when multiplied by its transpose the identity matrix I is obtained; i.e., M*MT = I. Orthogonal matrices have interesting properties. If M is orthogonal:

Conversely, a square matrix (one with same number of rows and columns) is orthogonal if the following conditions both exist:

As we can see, it is quite easy to determine if a regular or square matrix is orthogonal. Just look for any of these properties.

Transpose and Inverse Properties

The following transpose properties are observed in matrices

(ABC)T =CTBTAT

(ABCT)T = (CT)TBTAT = CBTAT

The following inverse properties are observed in matrices

(ABC)-1 =C-1B-1A-1

(ABC-1)-1 = (C-1)-1B-1A-1 = CB-1A-1

A-1A = AA-1 = I = 1

Since matrix division is not defined, it is impossible to divide a matrix expression by a given matrix. However, the desired effect is achieved by multiplying the expression by the inverse of the given matrix (2).

Determinants

Although the following is an incomplete definition, a determinant (det) can be described as a function that associates a scalar to a square matrix. This can assume any real value including zero. A matrix with a nonzero determinant is an invertible matrix (we can calculate its inverse matrix). If the determinat is zero (det = 0) is called a non invertible matrix. Don't worry about matrix inversions, yet.

To indicate that we are referring to determinant A and not to matrix A we surround the symbol A by pipes ("|"). The symbolic definition of a determinant for a matrix A is shown in Figure 7 and for m = n = 2 and m = n = 3

Figure 7. Some determinants.

In the figure, the second subscripts are all distinct, the number of terms is n! and v is the number of inversions of the second subscripts. Thus, the determinant of a matrix of order n=2 has two terms and 1 negative sign and the determinant of a matrix of order n=3 has 6 terms and 3 negative signs. Sample calculations are given in Figure 8.

Figure 8. Sample calculations of determinants.

There are other methods for solving determinants (triangularization, reduction methods, etc). For large matrices there are plenty of software solutions to choose from.