General Matrices
General Matrices
Matrices
Introduction
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
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
For example if
2 5 x y 5
B C= xy 2 xy 6
8 6 8 x+y
tave and . Solving we get x = 4
and y = 2 .
1
2
Types of Matrices
Zero Matrix
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
a. ( AT )T = A
b. ( A + B )T = AT + BT
d. ( kA )T = kAT .
Symmetric Matrices
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
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
4
5
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 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
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
The norm of u is denoted by ǁuǁ = √( u12+u22 + u32 +……. + un2 ) and the dot product
between
Example
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
8
9
Operations of Matrices
We can add and subtract two matrices only if they are of equal size. We do it by adding and
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 .
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
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
1. (AB)C = A(BC)
2. A( B + C )= AB + AC
3. ( A + B ) C = AC + BC
10
11
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
2 4 6
3 3 1
9 1 7
So if A = then tr ( A ) =
2x + y = 3
x + 3y = 7
2x+ y =3
11
12
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
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 .
These observations lead us to the well known Elementary Row Operations ( ERO)
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
After arriving at rem we can go further to reduced row echelon matrix ( rrem ) which has the
additional form :
Example
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
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
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 23
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
.
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
Example
15
16
Example
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
permutations of numbers which will be quite unsuitable here. So we will go around it and define
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
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
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 .
Notice that the values of (– 1)i+j for the cofactors alternates between 1 and – 1 and
19
20
Definition
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
Example
3 1 2
B 6 0 4
5 2 1
Given
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
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
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
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
Example
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
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
Proof
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 .
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
6. Consider (k A)((1/k) A–1) = k(1/k) A A–1 = I showing that ( k A )–1 = (1/k) A–1 .
above.
So A–1 is symmetric.
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
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
( 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
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
29
30
Theorem
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 .
Solution
9 18 18
11 8 10
2
a. Matrix A has been given above. It was found that adj (A) = 4 2
9 18 18
1
11 8 10
18
So A-1 = 4 2 2 .
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
matrix form as
Or AX = B where A= X= B=
32
33
Example
Example
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
Definition
eigenvector v .
Av - kv = 0
( A - k I )v = 0
34
35
Example
3 0
.
8 1
A=
Example
3 2 0
2 3 0 .
0 5
Repeat the above example for B = 0
35
36
36