Matrix Algebra

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

MATRIX ALGEBRA

Denition: A matrix A is a rectangular array of scalars (numbers), i.e., a collection of numbers

ordered by rows and columns. The ij th component of the matrix A, denoted by aij , is the number in
th th
the intersection of the i row and j column of A. The components (elements/entrie)s of a matrix are

usually enclosed in parentheses, brackets or braces. The matrix A is sometimes written as A = [aij ].
A matrix with all components equal to zero is called thezero matrix. For each matrix A = [aij ], there
corresponds a unique matrix −A = [−aij ], called the additive inverse of A, obtained by negating each

entry of A.
Denition: A matrix A is said to have order (shape /size ) m × n, read  m by n if A has m rows

and n columns. In this case, if m=n (i.e. A has same number of rows and columns), A is called a

square matrix; otherwise, A is said to be rectangular. A matrix consisting of a single row is called a
row vector, while a matrix consisting of a single column is called a column vector. Conventionally, a
1×1 matrix is a scalar and vice versa.

Denition: Two matrices A = [aij ] and B = [bij ] are equal if they have the same shape and

corresponding entries are equal, i.e., aij = bij for each i = 1, 2, · · · , m and j = 1, 2, · · · , n.

Matrix Addition
Let A = [aij ] and B = [bij ] be two m×nsum of A and B is the m × n matrix
matrices. Then the

A+B obtained by adding corresponding entries. Matrix subtraction is done in a similar manner except
that entries are subtracted instead of being added. For two matrices of the same shape, the dierence

A−B is the matrix A − B = A + (−B).


Example:
" # " #
1 −2 3 −1 0 2
Let A= and B= . Then
4 5 −6 −5 −4 5
" # " # " #
1 −2 3 −1 0 2 0 −2 5
A+B = + =
4 5 −6 −5 −4 5 −1 1 −1

and " # " # " #


1 −2 3 −1 0 2 2 −2 1
A−B = − = .
4 5 −6 −5 −4 5 9 9 −11

Properties of Matrix Addition


Let A, B , and C be m×n matrices. Then:

i A + B is an m × n matrix (closure property).


( )

(ii ) (A + B) + C = A + (B + C) (associative law for matrix addition).

(iii ) A + B = B + A (commutative law for matrix addition).

(iv ) There is an m × n matrix denoted by 0 consisting of all zeros (the zero matrix) such

that A+0=0+A=A (existence of additive identity).

1
v
( ) There is an m×n matrix (−A) such that A + (−A) = (−A) + A = 0 where 0 is the

zero matrix (existence of additive inverses).

Scalar Multiplication
Let A be an m×n matrix. The product of a scalar α times a matrix A, denoted by αA, is the matrix

obtained by multiplying each entry of A by α.


Example:
 
−5 0 2
Let A= 3 4 −3  and let α = −1/2. Then
 

1 −1 1
   
−5 0 2 5/2 0 −1
1
αA = −  3 4 −3  =  −3/2 −2 3/2 .
  
2
1 −1 1 −1/2 1/2 −1/2

Properties of Scalar Multiplication


Let A and B be a m×n matrices and let α and β be scalars. Then:

i αA is an m × n matrix (closure property).


( )

(ii ) (αβ) A = α (βA) (associative law for scalar multiplication).

(iii ) α (A + B) = αA + αB (scalar multiplication is distributive over matrix addition).

(iv ) (α + β) A = αA + βA (scalar multiplication is distributive over scalar addition).

(v ) 1A = A (identity property - the number 1 is an identity element under scalar


multiplication).

Transpose
Let A be an m×n matrix. The transpose of A, denoted by AT , is the n×m matrix obtained by
th th T
interchanging rows and columns of A, i.e., the i row of A is the i column of A and the j th column
th T
of A is the j row of A .

Example:  
  −1 2 3
−1 0 2 5  
T
 0 4 −1 
Let A= 2 4 −3 2 . Then A = .
 
 2 −3 0 
3 −1 0 −1
 
5 2 −1

Properties of the Transpose


Let A and B be a m×n matrices and let α be a scalar. Then:

i T T

( ) A = A.
(ii ) (A + B) = A + B .
T T T

(iii ) (αA) = α A
T T

.

2
Symmetry
Let A = [aij ] be an n×n matrix. Then A is said to be a symmetric matrix if A = AT , i.e., aij = aji .
In other words, A is symmetric if the entries of A are symmetrically located about the main diagonal
(the line from the upper-left-hand corner to the lower-right-hand corner).

Example:
 
1 −2 0
Let A =  −2 4 −3 . Then A is symmetric since A = AT .
 

0 −3 0

Trace
Let A = [aij ] be an n×n matrix. The trace of A, denoted by trace(A), is the sum of the entries on

the main diagonal. That is,

Xn
trace(A) = a11 + a22 + · · · + ann = aii .
i=1

Example:
 
−3 2 1
Let A= 4 −1 −2 . Then trace(A) = (−3) + (−1) + 0 = −4.
 

5 0 0

Linear Combinations
Let A1 , A2 , · · · , An be m×n matrices and let α1 , α2 , · · · , αn be scalars. Then, the expression

n
X
α1 A1 + α2 A2 + · · · + αn An = αi Ai
i=1

linear combination
is called a of the A1 , A2 , · · · , An .
Example:
" # " # " #
4 −1 −3 −6 0 6 1
Let A= , B= , and C= . Let α = 2, β = −1, and λ= 2 . Then
5 0 1 2 −2 −4
" # " # " #
4 −1 −3 −6 1 0 6
αA + βB + λC = 2 + (−1) +
5 0 1 2 2 −2 −4
" #
11 7
=
8 −4
=D

So, D is a linear combination of A, B , and C.

3
Matrix Multiplication
 
b1
b2
   
 
Let a= a1 a2 ··· an and b= .
 be two n-vectors. Then the scalar product
e  . 
e  . 
bn

Xn
a · b = a1 b1 + a2 b2 + · · · + an bn = ai bi
i=1
e e

forms the basis for matrix multiplication.

Denition: Let A = [aij ] be an m×n matrix and let and B = [bij ] be an s×t matrix. Then the

product AB exists if and only if n = s, i.e., if and only if A has exactly as many columns as B has

rows, and we say that A and B are compatible for multiplication in the order AB . In this case, AB is
th th th
the m×t matrix whose ij entry is the dot product of the i row of A and the j column of B.
Example: " # " #
0 1 −1 0
1. Let A= , and B= . Then, the product AB exists and has shape
0 1 −1 0
" #" # " #
0 1 −1 0 −1 0
2 × 2. In this case, AB = = .
0 1 −1 0 −1 0
The product BA is also dened and is the 2 × 2 matrix
" #" # " #
−1 0 0 1 0 −1
BA = = .
−1 0 0 1 0 −1
 
" # 2 −3 1 0
1 2 5
2. Let A = , and B =  8 −1 2 −3 . Then,
 
−3 −4 0
2 0 −1 −1
 
" # 2 −3 1 0 " #
1 2 −5  8 −5 10 −1
AB =  8 −1 2 −3  = .

−3 −4 0 −38 13 −11 12
2 0 −1 −1
 
2 −3 1 0 " #
1 2 −5
However, BA =  8 −1 2 −3  is not dened.
 
−3 −4 0
2 0 −1 −1
Remark : In either example above AB ̸= BA. This shows that matrix multiplication is not a

commutative operation.

Properties of MatrixMultiplication
For conformable matrices, we have the following:

i
( ) A (B + C) = AB + AC and (D + E) F = DF + EF (distributivity of matrix

multiplication over matrix addition).

4
(ii ) A (BC) = (AB) C (associative law).

(iii ) (AB) = B A .
T T T

Identity Matrix
 
1 0 ··· 0
0 1 ··· 0 
 

The n×n matrix In = 
 . .. . .
. . 
 with 1's on the main diagonal and 0's elsewhere is called
. .
 . . . 

0 0 ··· 1
the identity matrix of order n.
In the notation In , the subscript is suppressed if the size is obvious from the context. For every m×n
matrix, AIn = A and I m A = A.

ROW ECHELON FORM


Denition: A matrix E is in row echelon form if the following conditions hold:
(i ) all rows (if any) consisting entirely of zeros appear below non-zero rows (i.e., they

appear at the bottom of the matrix).

ii )
( each leading entry (pivot ), i.e., the rst (left-most) non-zero entry, of a row is in a
column to the right of the leading entry of the row above it.

iii ) all entries in a column, below a leading entry, are zero.


(

If a matrix E in echelon form satises the following additional conditions, then it is said to be in

reduced row echelon form.


(iv ) the leading entry in each non-zero row is 1.

(v ) each leading 1 is the only non-zero entry in its column.

Denition: Let A be an m × n matrix matrix with an echelon form E . Then a position corresponding
to a pivot of a nonzero row is called a pivot (pivotal ) position. The pivot columns of A, also called

basic columns of A, are the columns of A that contain the pivot positions.
Note : In the preceeding denition:
(i ) The basic columns are columns of A and not the echelon form E .

(ii ) Each nonbasic column in A is a linear combination of the basic columns in A.

(iii ) Because of the exibility in choosing row operations to reduce A to a row echelon

form E, the form E is not unique. However, the reduced row echelon form of A is

unique.

iv )
( The pivot positions in E are unique. Accordingly, the number of pivots in E, which

is equal to the number of basic columns in A, or the number of nonzero rows in E,


is a constant.

Denition: Let A be an m×n matrix with an echelon form E. Then the rank of A, denoted by

R(A), is the number of pivots in E.


Examples:

5
 
    −5 −1 0  
1 2 3 2 −3 2 1   1 0 0 0
 0 3 −2 
Matrices  01 5 ,  0 1 −4 8 , and   0 1 0 0 ,
 are in echelon form while 
    
 0 0 0 
5
00 0 0 0 0 0 0 0 0

2
0 0 0
 
  1 0 −1
1 0 2 5  
 0 1 2 
 0 1 3 6 , and  are in reduced echelon form.
  
 0 0 0 
0 0 0 0
 
0 0 0

Elementary Row Operations used in Reducing a Matrix to Echelon Form


i Multiply rows by non-zero constants.
( )

(ii ) Add a scalar multiple of one row to another.

(iii ) Permute (interchange) rows.

The process of applying these operations to simplify a matrix is called row reduction.
These elementary operations are used to determine the number of linearly independent vectors in a

given set of vectors. To do this, form a matrix using the vectors and then reduce the matrix to echelon

form. If one of the rows has all entries zero, then the set is linearly dependent. The number of linearly

independent vectors in the set is the number of non-zero rows in the echelon form matrix; this just the

rank of the matrix.

Theorem: The number of linearly independent columns of a matrix equals the number of linearly

independent rows.

Examples:
1. Determine the dimension of the space spanned by the vectors (1, 1, 2), (1, 0, 3), and

(1, 0, 1).
Solution :    
1 1 2 R1 − R2 1 1 2
 1 0 3  −→  0 1 −1 
   

1 0 1 R2 − R3 0 0 2
From the echelon form, R(A) = 3. So, the three rows (vectors) are linearly independent

and the dimension of the space spanned by the three vectors is 3. Therefore, the three

vectors form a basis for the vector space.

To obtain the reduced echelon form of the original matrix in Example 1 above:
     
1 1 2 R1 − R2 1 0 3 R2 + R3 1 0 0
 0 1 −1  −→  0 1 −1  −→  0 1 0 .
     
1
0 0 2 2 R3 0 0 1 R1 − 3R3 0 0 1
2. How many of the vectors (1, 2, 1, 4), (−1, 0, −1, 0), (3, 1, 3, 2), and (−1, −1, −1, −2) are

linearly independent?

Solution :

6
     
1 2 1 4 R1 + R2 1 2 1 4 1
1 2 1 4
    2 R2 − R3  
 −1 0 −1 0  −→  0 2 0 4   0 2 0 4 

 3
   −→  .
1 3 2  3R2 + R3  0 1 0 2   0 0 0 0 
R3 − R4
     
−1 −1 −1 −2 R2 − R4 0 1 0 2 0 0 0 0
In this case, two rows have not been reduced to all entries zero. So, only two rows are

linearly independent (however, the four, or any three of the vectors, are dependent).

In Example 2 above, the dimension of the space spanned by the four vectors is two. So,

the space spanned by the four vectors can also be spanned by only two of them. Hence,

a basis for this space is {(1, 2, 1, 4) , (−1, 0, −1, 0)} or even {(1, 2, 1, 4) , (0, 2, 0, 4)}.
To obtain the reduced echelon form of the original matrix in the preceeding example:
     
1 2 1 4 1 2 1 4 1 0 1 0
1
     
 0
 2 0 4 
 2 R2
 0
 1 0 2 
 R1 − 2R2  0
 1 0 2 
.
 0
 0 0 0 
 −→  0
 0 0 0 
 −→  0
 0 0 0 

0 0 0 0 0 0 0 0 0 0 0 0

THEORY OF DETERMINANTS
The determinant function is only dened for n×n (square) matrices. If A is an n×n matrix, the

determinant of A is denoted det A or |A|.


Denition (2 × 2 Determinant):
" #
a11 a12
Let A= be a 2×2 matrix. Then
a21 a22

a11 a12
det A =
a21 a22
= a11 a22 − a12 a21 . . . . . (1)

Denition (3 × 3 Determinant):
 
a11 a12 a13
Let A =  a21 a22 a23 . Then,
 

a31 a32 a33

a11 a12 a13


det A = a21 a22 a23
a31 a32 a33
a22 a23 a21 a23 a21 a22
= a11 − a12 + a13 . . . . . (2)
a32 a33 a31 a33 a31 a32

Take note of the minus sign before the second term on the right of (2).

Examples:
 
3 5 2
1. Let A= 4 2 3 . Calculate |A|.
 

−1 2 4
Solution :

3 5 2
|A| = 4 2 3
−1 2 4
2 3 4 3 4 2
=3 −5 +2
2 4 −1 4 −1 2
= 3 (2) − 5 (19) + 2 (10)
= −69.

2 −3 5
2. Calculate 1 0 4 .

3 −3 9
Solution :

2 −3 5
0 4 1 4 1 0
1 0 4 =2 − (−3) +5
−3 9 3 9 3 −3
3 −3 9
= 2 (12) + 3 (−3) + 5 (−3)
= 0.

There exists another method of calculating 3×3 determinants. From equation (2) above we have

det A = a11 (a22 a33 − a23 a32 ) − a12 (a21 a33 − a23 a31 ) + a13 (a21 a32 − a22 a31 )
= a11 a22 a33 + a12 a23 a31 + a13 a21 a32 − a11 a23 a32 − a12 a21 a33 − a13 a22 a31 . . . . . (3)

We write A and adjoin its rst two columns to it:

a11 a12 a13 a11 a12


a21 a22 a23 a21 a22
a31 a32 a33 a31 a32

We then calculate the six products, put minus signs before the products with arrows pointing upwards,

and add. This gives the sum in equation (3).

Example:

8
3 5 2
Calculate 4 2 3 .

−1 2 4
Solution :
3 5 2 3 5
Writing 4 2 3 4 2 and multiplying as indicated, we obtain

−1 2 4 −1 2

|A| = 3 (2) (4) + 5 (3) (−1) + 2 (4) (2) − (−1) (2) (2) − (2) (3) (3) − (4) (4) (5)
= 24 − 15 + 16 + 4 − 18 − 80
= −69.

Note : This method will not work for n×n determinants if n > 3.

Denition
 
a11 a12 a13 " #
a22 a23
Let A =  a21 a22 a23 . Then M11 = is the matrix obtained by deleting the rst
 
a32 a33
a31 a32 a33
" #
a21 a23
row and rst column ofA; M12 = is the matrix obtained by deleting the rst row and
a31 a33
" #
a21 a22
second column of A; M13 = is the matrix obtained by deleting the rst row and third
a31 a32
column of A. Let A11 = det M11 , A12 = − det M12 and A13 = det M13 . Then equation (2) above

becomes

det A = a11 A11 + a12 A12 + a13 A13 .

Denition (Minor ): Let A be an n × n matrix and let Mij be the (n − 1) × (n − 1) matrix obtained
from A by deleting the i th
row and j th
column of A. Then Mij is called the ij th minor of A.
Examples:
 
2 −1 4
1. Let A= 0 1 5 . Find M13 and M32 .
 

6 3 −4
Solution : " #
0 1
Deleting the rst row and third column of A, we obtain M13 = , and deleting
6 3
" #
2 4
the third row and second column of A, we obtain M32 = .
0 5
 
1 −3 5 6
 
 2 4 0 3 
2. Let A=
 1
. Find M24 and M32 .
 5 9 2 

4 0 2 7

9
Solution :  
1 −3 5
Deleting the second row and fourth column of A, we obtain M24 =  1 9 , 5 and
 

4 0 2
 
1 5 6
deleting the third row and second column of A, we obtain M32 =  2 0 3 .
 

4 2 7
Denition (Cofactor ): Let A be an n×n matrix. The ij th cofactor of A, denoted by Aij is given

by
i+j
Aij = (−1) |Mij | .

In other words, the ij th cofactor of A is obtained by taking the determinant of the ij th minor and
i+j
multiplying it by (−1) .

Note : 
1 if i + j is even
i+j
(−1) = .
−1 if i + j is odd

Examples:
1. In Example 1 above we have

1+3
A13 = (−1) |M24 |
0 1
= = −6
6 3

and

3+2
A32 = (−1) |M32 |
2 4
=− = −10.
0 5

2. In Example 2 above we have

2+4
A24 = (−1) |M24 |
1 −3 5
= 1 5 9 = −192
4 0 2

10
and

3+2
A32 = (−1) |M32 |
1 5 6
=− 2 0 3 = −8.
4 2 7

Denition (Triangular Matrix ): A square matrix is called upper triangular if all its components

below the diagonal are zero. It is lower triangular if all its components above the diagonal are zero.

A matrix is called diagonal if all its elements not on the diagonal are zero. In other words, A = [aij ]
is upper triangular if aij = 0 for i > j, lower triangular if aij = 0 for i < j, and diagonal if aij = 0 for

i ̸= j .
Note : A diagonal matrix is both upper and lower triangular.

Examples:  
  −2 3 0 1
2 1 7  
 0 0 2 4 
1. The matrices A= 0 2 −5  and B= are upper triangular;
  
 0 0 1 3 
0 0 1
 
0 0 0 −2
 
5 0 0 " #
0 0
C= 2 3 0  and D = are lower triangular; while the identity matrix
 
1 0
−1 2 4
 
2 0 0
I, and E =  0 −7 0  are diagonal.
 

0 0 −4
 
a11 0 0 0
 
 a21 a22 0 0 
2. Compute the determinant of the lower triangular matrix A=
 a
.
 31 a32 a33 0 
a41 a42 a43 a44

Solution :
det A = a11 A11 + 0A12 + 0A13 + 0A14
= a11 A11
a22 0 0
= a11 a32 a33 0
a42 a43 a44
a33 0
= a11 a22
a43 a44
= a11 a22 a33 a44 .

11
Theorem: Let A = [aij ] be an upper or lower triangular n×n matrix. Then

det A = a11 a22 a33 · · · ann

i.e., the determinant of a triangular matrix equals the product of its diagonal entries.

Examples:
The determinants of the six matrices in Example 1 above are

|A| = 2 (2) (1) = 4,

|B| = (−2) (0) (1) (−2) = 0,

|C| = 5 (3) (4) = 60,

|D| = 0 (0) = 0,

|I| = 1 (1) (1) · · · (1) = 1,

|E| = 2 (−7) (−4) = 56.

Properties of Determinants
Theorem: Let A and B be n×n matrices. Then det AB = det A det B , i.e., the determinant of the

product is the product of the determinants.

Example:
   
1 −1 2 1 −2 3
Let A= 3 1 4  and B= 0 4 . Then det A = 16 and det B = −8.
−1
   

0 −2 5 2 0 −2
    
1 −1 2 1 −2 3 5 −1 −5
Now, AB =  3 1 4  0 −1 4  =  11 −7 5  and
    

0 −2 5 2 0 −2 10 2 −18
det AB = −128 = 16 (−8) = det A det B .
Note : The determinant of the sum is not always equal to the sum of the determinants, i.e., if A and

B are n×n matrices, then det (A + B) ̸= det A + det B in general. So, the determinat function is not

linear.

Example:
" # " # " #
1 2 3 0 4 2
Let A= and B= . Then A+B = . In this case det A = −2,
3 4 −2 2 1 6
det B = 6, and det (A + B) = 22 ̸= 4 = det A + det B .
Theorem: Let A be an n×n matrix. Then det AT = det A.
Example:
   
1 −1 2 1 3 0
Let A= 3 1 4 . Then AT =  −1 1 −2 . By direct calculation, it can be veried
   

0 −2 5 2 4 5
that det A = det AT = 16.

13

You might also like