0% found this document useful (0 votes)
3 views

General Matrices

Uploaded by

Nizam Azhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

General Matrices

Uploaded by

Nizam Azhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

1

Matrices

Introduction

A matrix is a rectangular array of objects/elements. We usually used capital letters to name a

matrix. For example

 1 3 5
 
A   a b 7 .
0 9 1
 

The size of a matrix is given as number of rows by number of columns. So for the previous

matrix A the size is 3 by 3 ( or 3 X 3 ) .

Often to write and pinpoint the elements of a matrix we can write ( )


A = aij 3x 3
. ij means ith

row and jth column. So a23 is the element at 2nd row and 3rd column . For our example a23 =

7 and a33 = 1.

Equality of Matrices

Two matrices A and B are equal if they are of the same size and their corresponding

element/entries are identical.

For example if

 2 5 x y 5
B    C= xy 2 xy 6
8 6 8 x+y
tave and . Solving we get x = 4
and y = 2 .

1
2

Types of Matrices

Zero Matrix

A zero matrix has all elements 0.

Example

0 0
  0 0
O3x 2   0 0  O2x 2   
0 0 0 0
  are zero matrix. Note : O2x2 can also be written as O2 .

Square Matrix

A matrix with equal number of rows and columns. So if K is a matrix 4 by 4 then can be

written as K3

Identity Matrix

A square matrix with all 1 on the main diagonal and 0 everywhere else.

Example

1 0 0
1 0  
I2    I3   0 1 0 
0 1 0 0 1
,  

1 if i  j
 
I n  aij
n

0 if i  j
In general for identity matrix .

2
3

Transpose of A Matrix

Let A be a matrix of size m x n . Then AT is the matrix n x m whereby ith row of A becomes

ith column of AT .

For example if

3 0
   3 5 7
A  5 4 then AT   
7 1 0 4 1
 

In general if B = ( bij )mxn then BT = ( bji )nxm .

Some properties of transpose are :

a. ( AT )T = A

b. ( A + B )T = AT + BT

c. ( AB )T = BTAT , ( ABC )T = CTBTAT

d. ( kA )T = kAT .

Symmetric Matrices

A square matrix A is said to be symmetric if AT = A

This means the ith row of a symmetric matrix is the same as the ith column.

3
4

Example

2 6 9
  1 7
R   6 1 5 K   
9 5 7  7 5
 

are both symmetric matrices as RT = R and KT = K .

Skew Symmetric Matrices

A matrix A is said to be skew symmetric if AT = – A .

This means ith row of A is the negative of jth column of A.

Example

 0 3  7
 
B   3 0 1 
 7 1 0 
 
It is clear that BT = - B . So B is skew symmetric.

Theorem

Let A be any square matrix. Then A can written as sum of a symmetric matrix S and a

skew symmetric P whereby S = ½( A + AT ) and P = ½( A – AT) .

4
5

To show that S is symmetric we note that ST = (½( A + AT ))T = ½( AT+ (AT)T = ½( AT + A ) = S

showing S is symmetric while

PT = (½( A – AT) )T = ½( AT– (AT) T) = ½( AT– A) = – P , showing P is skew symmetric.

Consider

2 3 8
 
Q  5 0 1
6  1 7
  .

2 5 6
T
Q = 3 0 1
Then 8 1 7 . If S = ½( Q + QT) and P = ½( Q - QT) then it can be verified that

Q=S+P .

Diagonal Matrix

A diagonal matrix is a square matrix which has entries 0’s everywhere else except for the main

diagonal.

Example

2 0 0
 
0 0 0
D =  0 0 7 
is a diagonal matrix.

5
6

Upper and Lower Triangular Matrices

Upper triangular matrix has all 0’s for all entries under the main diagonal and lower triangular

matrix has 0’s for all entries above the main diagonal.

Example

2 1 0 2 0 0
   
0 0 8 0 0 0
U =  0 0 7   5 3 7
  is a lower triangular .
is an upper triangular and L =

Submatrices

Given a matrix A . A submatrix of A is a matix obtained from A by the removal of any number

of rows or columns.

2 4 6 
 
 3 3  1
Consider A =  9 1 7 
.

 3  1
 
The matrix R =  1 7 

is a submatrix obtained from A by removal first row and first column and

 4
 
 3
T =  1 
is a submatrix after removal of first and third column.

6
7

Row and Column Matrices

A row matrix is a matrix which has only one row while a column matrix has only one column.

Example

 4
 
 3  is a column matrix
 
R = ( 4 5 7 - 4 13 ) is a row matrix while C =  1 

Definition

Let u = ( u1 u2 u3……. un ) and v = ( v1 v2 v3……. vn ) be two vectors of equal size.

The norm of u is denoted by ǁuǁ = √( u12+u22 + u32 +……. + un2 ) and the dot product

between

u and v is u.v = u1v1 + u2v2 + u3v3 +……+ unvn .

Example

If u = ( 7 1 5 ) and v = ( -2 1 -2 ) then the norms of u and v are ǁuǁ =√75

and ІІ v ІІ = 3 respectively. Their dot product is u.v = 7(-2) + 1(1) + 5(-2) = -23.

7
8

An Orthogonal Matrix

Let A be an n x n matrix . Let the vectors v1, v2, v3, …,vn be the column vectors of the matrix.

Then if ІІ vi ІІ =1 for all i =1,….,n and vi .vj = 0 for i ≠ j then A is an orthogonal matrix.

One property of orthogonal matrices is the multiplication between itself and its transpose is an

identity matrix.

Example

2 2 1 
  
3 3 3 
2 1 2
A  
3 3 3
Suppose 1 2 2  .
 
3 3 3 

Then v1 = ( 2/3 2/3 1/3 ), v2 = ( -2/3 1/3 2/3 ), v3 = (1/3 -2/3 2/3 ) . You can show that

ІІ vi ІІ=1 and vi . vj = 0 for i ≠ j. ( v1.v2 =0, v1.v3 = 0, v2.v3 = 0 )

You can also check that A AT = I

8
9

Operations of Matrices

a) Addition and Subtraction.

We can add and subtract two matrices only if they are of equal size. We do it by adding and

subtracting their corresponding entries.

Example

 2 5  4  1 3 5 3 8 1 
     
Suppose A =  7 2 8  and B =   3 4 7  . Then A + B =  4 6 15 

1 2  9
 
Also A - B =  10  2 1 .

Notice that AT+ B is undefined since AT is of size 3 x 2 and B is 2 x 3.

Simple properties of addition

1. A + B = B + A

2. ( A + B ) + C = A + ( B + C )

9
10

b) Scalar Multiplication

We can multiply a matrix with a number ( scalar ). The multiplication is done by multiplying

each entry by the scalar.

3 8 1 
3 
 4 6 15 

Matrix Multiplication

Suppose A has size m x p and B has size p x n. Then AB is defined and has size m x n.

Example

 1 4
 
 3 2 1  1 2
   3 3
 4  3 5  

Properties of Matrix Multiplication

1. (AB)C = A(BC)

2. A( B + C )= AB + AC

3. ( A + B ) C = AC + BC

4. AB = O does not imply A = O or B = O

5. AB = AC does not imply B = C

10
11

6. A2 = A A, A3 = AAA, An = A A A….A ( n times )

7. AI = IA = A

 a 0 0  an 0 0
   n

 0 b 0 0 b 0
   
8. If D =  0 0 c  then Dn = 0 0 cn 

Trace of a Matrix

Suppose A is a square matrix. Then trace of A or written as tr( A ) is the sum of all entries on

the main diagonal.

2 4 6 
 
 3 3  1
9 1 7 
So if A =   then tr ( A ) =

Elementary Row Operations ( ERO)

Suppose we want to solve two simultaneous equations such as

2x + y = 3

x + 3y = 7

If we interchange the two equations so that it becomes x + 3y = 7

2x+ y =3

11
12

Surely this won’t change the solution.

Also if we multiply any of the equation with non zero number, still we get same solution.

If we multiply an equation by a number and add to the other equation, will we get same

solution ? The solution for the simultaneous equations is x = 2/5, y = 11/5.

Now let us multiply the second by -2 and add to the first to get 0 + ( -5y ) = -11 . Doing this

way we straight away get y = 11/5. To get the x value we substitute into second equation

x + 3y = 7, whence x = 2/5 .

So again this operation does not change the solution.

These observations lead us to the well known Elementary Row Operations ( ERO)

ERO contains 3 operations namely

Interchange two rows ( Ri↔Rj )

Multiply a row by a scalar ( kRi )

Multiple of a row is added to another row . ( kRi + Rj) only Rj changes .

Example

2 6 9 9 5 7 9 5 7  9 5 7 
  R 1 R 3   3R3   R2 R3  
 6 1 5    6 1 5   6 1 5    6 1 5 
9 5 7 2 6 9  6 18 27   0 17 22 
       

12
13

Now what we want to do with ERO is to change a given matrix to a form known as row echelon

matrix ( rem ). Basically rem is a non zero matrix that has the following form :

1. If the row does not contain entirely of zeros, then the first non zero number is a 1. ( we call

this leading 1 )

2. In any two successive non zero rows ( contain entirely zeros ), the leading 1 in the lower row

occurs farther to the right than the leading 1 in the higher row

3. All zero rows are grouped at the bottom of the matrix.

After arriving at rem we can go further to reduced row echelon matrix ( rrem ) which has the

additional form :

4. Each column that has leading 1 has zeros everywhere else .

Example

Which of the following are rem. State why if it is not.


1 2 3 1 2 0 1 0 1 3 1 2 3 0
     1  7 5 5    
0 0 0 0 1 3   0 1 3 1 0 1 3 0
0 0 1 0 0 0  0 0 1 3 0 0 2 4 0 1 1 0
(a)   (b)   (c) (d)   (e)  

1 1 0 3 1 1 0 1 1 3
   
0 0 1 1 0 0 1 0 0 2
0 0 0 0 0 1 0 0 0 0
(f)   (g)  

13
14

Example

Which is rrem. State why if it is not.


1 0 1 3 1 0 0 0 0 1 0 0 1 0 0 4
       
0 1 0 1 0 1 0 1 1 0 0 0 0 1 0 1
0 0 1 0 0 0 1 4 0 0 1 0 0 0 1 4
(a)   (b)   (c )   (d)  

Example
2 4 3 5
 
3 1 2 0
6 0 4 3
Use ERO to change the matrix   to rem.

Solution

= 3 + 4�
2 4 3 5 2 4 3 5 2 4 3 5  1R
  2R 2   3R1 R2 , 2R2 R3   10
2
 3 1 2 0  
  6 2 4 0         0  10  5  15   
6 0 4 3 6 0 4 3  0  12  5  12 
     

2 4 3 5  2 4 3 5  1R  1 2 3 2 5 2 
  12R2 R3   1  
0 1 1 2 3 2    0 1 1 2 3 2  2
 0 1 1 2 3 2 
 0  12  5  12  0 0 1 6  0 0 1 6 
    .

Example

14
15

Change the following matrix to rrem.


1  2 1 4 1 
 
1 3 7 2 2 
 1  12  11  16  1 
 

Solution
1  2 1 4 1  1  2 1 4 1 
  R1 R2 , R1 R3   2R  R
1 3 7 2 2       0 5 6 6 1  23 
 1  12  11  16  1   0  10  12  12  2 
   

 1  2 1  4 1  1R  1  2 1  4 1   1 0 17 5  8 5 7 5 
  5 2   2R 2  R 1  
 0 5 6 6 1    0 1 6 5 6 5 1 5    0 1 6 5 6 5 1 5 
0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 
    .

Solving a system of linear equations

We can use ERO to solve system of equations. By a system we mean when we have more than

one equation happened simultaneously. Oftenly we need to find the unknowns I.e solving the

system. We obtain the augmented matrix of the system and use ERO to change the matrix

either to rem or rrem.

Example

Given the system x-y=4 2x + y = 8. Solve the system using ERO.

15
16

Example

Given the system x - y + z = 2 2x + y - z = 5 4x + 3y -2z = 6. Solve using ERO.

Example

Solve x - y + 2z - w = 0 2x + y + 2w = 1 x + 2y + z - 2w = 2

16
17

Determinant of a Matrix

Every square matrix has a scalar function attached to it which is known as determinant. To be

extremely rigorous in understanding determinant we have to go through the process of

permutations of numbers which will be quite unsuitable here. So we will go around it and define

determinant in a nice and suitable fashion.

First we have to be familiarize with the symbol used.

a b c 
 
A  d e m
n r s 
If   is a general matrix 3 x 3 then its determinant is a scalar ( a real number )

a b c
A d e m
n r s
denoted by .

Definition

The determinant of a 1 x 1 matrix ( a ) is a.

Thus the determinant for ( 7 ) is 7 = 7 and determinant of (– 4 ) is 4= 4

Students shouldn’t be mixed up with the absolute sign used in literature.

17
18

Definition

a b a b
    ad  bc
c d c d
The determinant for a 2 x 2 matrix

7 2 5 2
So = 7(3) 2(5) = 11 and = 5(1) 2(6) = 7
5 3 6 1

Expansion of Cofactors

First we define the minor of a matrix and then the cofactor.

Definition

The minor matrix of a square matrix A denoted by Mij is a submatrix of A by the removal

of ith row and jth column of A. The minor is denoted by mij and is the determinant of Mij .

So mij = Mi j

Example

 3 1 5
 
A  6 0 4
 7 2 1
Given   . Find the minor matrix M11 and M32 . Hence find the minors m11

and m32

18
19

Solution.

0 4
M11 =  
1 2
Removing the first row and first column of A we get and

 3 5
M32   
 6 4
removal of third row and second column of A we get . As for the minors
0 4 3 5
 4  42
1 2 6 4
we get m11 = and m32 =

Definition

Cofactor of a square matrix A is denoted by cij and is defined as cij = (– 1)i+j mij where mij

is the minor of A .

For the previous matrix A c11 = (– 1)1+1(– 4 ) = – 4 c23 = (– 1)3+2(42 ) = – 42

Notice that the values of (– 1)i+j for the cofactors alternates between 1 and – 1 and

produces alternate + and – signs in the matrix i.e

  
 
  
  
 

19
20

Definition

Suppose a matrix A =(aij)3 x 3. Then determinant of A is defined as

A = a11c11 + a21c21 + a31c31 .

The determinant found by the above formula is also known as cofactor expansion along first

column since a11 a21 a31 are taken from first column. Infact we can choose any

column or row and still get the same value.

Of course the formula can be extended to n x n matrix.

Example

 3 1  2
 
B  6 0 4 
 5 2 1 
Given  

Find |B| using (i) cofactor expansion along first column

(ii) cofactor expansion along second row .

Solution

20
21

(i) We go to the first column of B and put the alternate signs + and – to take care of (–

1)i+j .

0 4 1 2 1 2
Then |B| = (+)3 + (–)(–6) 2 1 + (+)5 0 4 = 3(–8) + 6(5) + 5(4) = 26 .
2 1

(ii) We go to the second row of B and put the alternate signs + and – . Care should be

taken to start the signs with first entry at a11 .

1 2 3 1
Thus |B| = (–) (–6) 2 1 + 0 + (–)4 5 2 = 6( 5) – 4(1) = 26.

It is clear that no matter which column or row we choose the determinant is the same. Usually

we will choose column or row with the most 0 in it.

Example

5 0 10
 
4 3 0 0
T 
2 1  4 0
 
Find |T| if  0 3 2 
5

Solution

Since fourth column contains the most 0’s we expand along that column.

21
22

5 0 1
3 0 4 3
T =24 3 0 = 2 (5) + = 2(5( 12) + ( 2)) = 124
1 4 2 1
2 1 4

Example

5 0 0
Find 4 3 0
2 1 4

Solution

5 0 0
3 0
4 3 0 5  5(12)  60
1 4
2 1 4
.

You can see that for the above lower triangular matrix the determinant is the same

as the product of all entries on the main diagonal. Infact this is true for all

triangular matrix including the diagonal matrix.

Example

4 7 8 6
4 0 0
0 1 8 9
 4(7)(3)  84 0 9 0   36
0 0 7 4
and 0 0 1
0 0 0 3

22
23

Cramer’s Rule

In solving a square system we can use Cramer’s Rule. The rule states that :

A system ax + by = e

cx + dy = f

e b a e
f d c f
x= y=
a b a b
will have solution c d and c d

Example

Solve by Cramer’s Rule the system x-y=5 x+y=3

Example

Solve for z if 2x - 3y + z = 5 3x + 2y + 3z = 0 5x +2y + 4z = 3

23
24

Example

Three men M1, M2 and M3 when combined can do a job in 15 days, and when only

M1 and M2 combined can do the same job in 25 days. When M2 and M3 combined can

do the job in 20 days. How many days will it take if only M3 alone do the job ?

24
25

Inverse of a Matrix

Definition

An inverse of a square matrix A is denoted by A–1 and has the property that A A–1 = A–1 A =

I .

If A has an inverse then A is said to be invertible or not singular. We can readily show

that if this inverse exist it must be unique.

So suppose B and C are both inverses for A. Then BA = CA = I.

So BA = CA . Thus BAB = CAB which implies B = C as AB = I . So inverse is unique.

First let us look at some simple properties of inverse and prove them.

Theorem

1. |A–1| = 1/ |A | .

2. ( A–1)–1 = A

3. ( AB )–1 = B–1A–1

4. ( AT )–1 = ( A–1)T

25
26

5. If A–1 exists if and only if |A |≠ 0.

6. ( k A )–1 = (1/k) A–1

7. If A is symmetric then A-1 is also symmetric .

Proof

1. We have A A–1 = I. Hence |AA–1| = 1. Thus |A||A–1|=1 . So |A–1| = 1/|A|.

2. From A A–1 = I means A–1 is the inverse of A. But this also means the inverse of A–1 is

A.

So (A–1)–1 = A .

3. We consider (AB)(B–1A–1) =A(BB–1)A–1 = AA–1 = I, showing that (AB)–1 = B–1A–1 .

4. IT = ( AA–1 )T = (A–1)TAT which implies (A–1)TAT = I . This means the inverse of AT is (A–1)T

or

or ( AT )–1 = ( A–1)T .

26
27

5.If A–1 exists then |A–1| = 1/ |A |. But if |A |= 0 then 1/ |A | cannot exist, showing that

A–1 cannot exist .

6. Consider (k A)((1/k) A–1) = k(1/k) A A–1 = I showing that ( k A )–1 = (1/k) A–1 .

7. Suppose A is symmetric. Then since A = AT we must have A–1 = ( AT )–1 = ( A–1)T by 4.

above.

So A–1 is symmetric.

Finding Inverses By The Method of Cofactor ( Adjoint Matrix Method )

First let us define the adjoint matrix associated with matrix A denoted by adj( A ) .

Definition

Let A be a square matrix and let C be the cofactor matrix of A where C is given as

 c11 c12 c13 


 
C   c21 c22 c23 .
c c3 2 c33 
 31 Then adjoint matrix of A denoted by adj( A ) = C T .

27
28

Because there are many cofactors we want to find it is advisable to write out the matrix with

alternate signs as to take care of the (– 1) i+j and then write out the minors of the matrix.

Example

2 4 2
 
A  1 3 6
3 5 7
Consider the matrix   . To find matrix C we first write C
 ( )  ( )  ( )
 
( )  ( )  ( )
 )  ( )  . Then fill in the empty spaces with the appropriate minors. For example
=  ( )  (

for the minor at first row, first column should be –9 and the minor at second row third column

should be –2. If you do it correctly you should get

  ( 9 )  (  11)  ( 4 )    9 11  4 
   
  (18 )  (8 )  ( 2 )     18 8 2 
  (2 )   18  10 2 
C =   (18 )  (10 )

  9  18 18 
 
 11 8  10 
 2 
Thus adj(A) = C T =   4 2

28
29

One of the nicest property an adjoint matrix has is that its product with the original matrix will

always give a diagonal matrix.

  9  18 18   2 4 2   18 0 0 
    
 11 8  10   1 3 6   0 18 0 
 2   3 5 7  =  0 0 18 
As such adj( A ) A =   4 2  .

The number 18 on the main diagonal is actually the value of the determinant of A .

A 0 0 1 0 0
   
0 A 0 A 0 1 0
 A  =  0 0 1  .
In general we have adj( A ) A =  0 0

Hence 1 . This shows that A-1 = 1


adj(A)A = I adj(A) .
A A

29
30

Theorem

Suppose A is an invertible matrix. Then A-1 =


1 where adj(A) is the adjoint
adj(A)
A
matrix of A.

Example

Given A = a b . Find a formula for the inverse of A and state the condition for
c d
existence.

Solution

T
  ( d )  (c )   d  b 
    
  ( b )  (a )    c a 
|A| = ad – bc . adj ( A ) = .

1  d  b
A 1   
ad  bc   c a 
Thus with the condition that ad – bc ≠ 0.

30
31

Example

2 4 2 1 1 2 
   
A  1 3 6 T  1 3 0
3 5 7 3 3 2
Matrix A and T are given as    

a. Find A-1 .

b. If matrix M is such that MA = T find M .

Solution

  9  18 18 
 
 11 8  10 
 2 
a. Matrix A has been given above. It was found that adj (A) =   4 2

and |A| = 2(21 – 30) –1(28 – 10)+3(24 – 6) = 18.

  9  18 18 
1 
 11 8  10 
18 
So A-1 =  4 2 2  .

b. MA = T . So MAA-1 = TA-1 which implies

31
32

1 1 2   9  18 18 
1   1  
M  TA  1 3 0  11 8  10 
 3 3 2  18   4 2 2 
  

 1 1 2    9  18 18 
1    
  1 3 0   11 8  10 
18   
3 3 2   4 2 2 

6 6 12  3 3 6 
1   1 
  24 6  12    12 3  6
18   9   1  13 14 
  2  26 28   

Note : In b. above extra precaution has to be taken in order not to multiply A-1 to the left as matrix

multiplication is not commutative. Also the fraction can be carried to the most left so as to avoid fraction and thus

the multiplication involved only integers.

Solving A Square System Using Inverses.

If a system ax + by = e and cx + dy = f is given then the system can be written in

matrix form as

Or AX = B where A= X= B=

To find X we multiply AX = B by A-1 to get

32
33

Example

Solve the system 2x - y = 4 3x + y = 5

Example

Solve the system 2x + 4y + 2z = 0 x + 3y + 6z = 1 3x + 5y + 7z = -1.

Find also the corresponding inputs (x, y, z ) to the changes of outputs from ( 0, 1, -1) to (1,1,2)

to (1, 1, 0) to (1,1,-1).

33
34

Eigenvalues and Eigenvectors

Definition

Let A be an n x n matrix. A non zero vector v in Rn is called an eigenvector of A if

Av = kv for some k in R. The scalar k is called eigenvalue of A corresponding to the

eigenvector v .

To find v we need to find k first

We note that from Av = kv

Av - kv = 0

( A - k I )v = 0

For v to be non zero we require det ( A -kI ) = 0

The equation A _ kI = 0 is known as characteristic equation of A .

To find the eigenvector v corresponding to k we need to solve the equation

( A - kI )v = 0 for v by substituting the value of k and solve for v .

34
35

Example

Find the characteristic equation, eigenvalues, eigenvectors of the matrix

3 0 
 .
 8  1
A=

Example

 3  2 0
 
  2 3 0 .
 0 5 
Repeat the above example for B =  0

35
36

36

You might also like