You are on page 1of 50

CHAPTER 3

MATRIX ALGEBRA
(TEXT BOOK CHAPTER 5)

DR SURYANI KAMARUDIN
19 NOVEMBER 2013

1
Learning Outcomes
1. to identify VARIOUS TYPES of matrices
2. to find DETERMINANT and INVERSE of
matrices
3. to solve LINEAR EQUATIONS:
Gauss Elimination, Gauss Seidel, Jacobi
Iteration
4. to find EIGEN-VALUES and EIGEN-
VECTORS and use their PROPERTIES

2
MATRICES
A matrix is a rectangular or square array of values
arranged in rows and columns.
An m n matrix A, has m rows and n columns,
and has a general form of

3
VECTORS
A vector is a matrix with only one column (a column
vector) or,
only one row (a row vector)

4
TRANSPOSE MATRIX

Rows become columns and columns become rows


In general if A is m n, then A is n m, and aij = a ji
The transpose of a row vector is a column vector= A=AT

a11 a21 , , am1


T a12 a22 , , am 2
A' A

a1n a 2 n , , am n
5
DIAGONAL MATRIX

6
SQUARE MATRIX
Same number of rows and columns
Example 3x3, 2x2, 4x4

5 4 7
B 3 6 1
2 1 3
7
TRIANGULAR MATRIX

8
9
IDENTITY MATRIX
Square matrix - ones on the diagonal
and zeros elsewhere.

1 0 0 0
0 1 0 0
I
0 0 1 0
0 0 0 1
10
SYMMETRIC MATRIX

T
A=A =A
11
OTHERS INCLUDE

Skew-symmetric => aij = -aji except when i=j


Null or zero matrix => all elements = 0

Remember matrices give useful notation


for describing some problems and
organising calculations.
They dont give any new meanings to
solutions

12
MATRIX OPERATION -EQUALITY

2 matrices A and B are


EQUAL if their elements are
the same aij = bji and of THE
SAME ORDER
A = B

13
ADDITION AND SUBTRACTION
Matrices of the same size/order are added or
subtracted by adding or subtracting
corresponding elements.

Matrix addition is COMMUTATIVE & ASSOCIATIVE


1. A+ B = B + A
2. (A + B) + C = A + (B + C)
3. (A+B) = A+ B
4. D=A-B

Matrix subtraction also COMMUTATIVE AND


ASSOCIATIVE
1. Commutative: A B = A + (-B) = (-B) + A
14
15
16
MULTIPLICATION OF SCALAR

A = matrix (aij),
R = scalar (number)

Then RA is obtained by multiplying


each element A by R

If B = RA; then bij = Raij


17
MATRIX MULTIPLICATION

- Matrices A and B have these dimensions:

[r x c] and [s x d]
- Matrices A and B can be multiplied if:

[r x c] and [s x d]

18
c=s
MATRIX MULTIPLICATION

The resulting matrix will have the


dimensions:
[r x c] and [s x d]

rxd

19
COMPUTATION: A X B = C

a11 a12
A
a 21 a 22 [2 x 2]

b11 b12 b13


B
b 21 b 22 b 23
[2 x 3]

a11b11 a12b 21 a11b12 a12b 22 a11b13 a12b 23


C
a 21b11 a 22b 21 a 21b12 a 22b 22 a 21b13 a 22b 23
[2 x 3]
20
COMPUTATION: A X B = C

2 3
111
A 1 1 and B
1 0 2
1 0
[3 x 2] [2 x 3]
A and B can be multiplied

2 *1 3 *1 5 2 *1 3 * 0 2 2 *1 3 * 2 8 528
C 1*1 1*1 2 1*1 1* 0 1 1*1 1* 2 3 213
1*1 0 *1 1 1*1 0 * 0 1 1*1 0 * 2 1 111
Result is [3 x 3]
21
EXAMPLE OF MATRIX MULTIPLICATION

22
PROPERTIES OF MATRIX MULTIPLICATION

6. AI = A and IA = A (multiplying by identity matrix


is like multiplying with number 1)

23
DETERMINANTS OF A SQUARE
MATRIX

24
DETERMINANTS OF A SQUARE
MATRIX

25
DETERMINANTS OF A SQUARE
MATRIX

26
DETERMINANT AND EXAMPLE 2X2

ab
A det A ad bc
cd

Always = 0 if 2 rows are identical

27
MINORS AND COFACTORS
In order to solve large order matrice, we use minors
Minor of elements aij = Mij = determinants of a submatrix
obtained by deleting the ith row and jth column
Then the determinants is obtained for an norder matrix by
expansion by the elements of a row (or column) or expansion
by minors

.. ..
.. .. .. ..
There will also be a sign associated with a minor

28
EXAMPLES 3X3 MATRIX
a11 a12 a13
a22 a23 a21 a23 a21 a22
A a21 a22 a23 det A a11 a12 a13
a32 a33 a31 a33 a31 a32
a31 a32 a33

this is example of
expansion of the
determinant along
first row.
any row or column
will work

29
EXAMPLES 3X3 MATRIX

30
DETERMINANTS AND MINOR

31
USEFUL FACTS
1. Dont have to use 1st row, any row/column will work. But need
to take care of sign in front of minors (cofactors values!)
2. If a row/column consists entirely of zeros, then det = 0
3. If 2 rows/2 columns are identical, det = 0
4. If all elements in a single row or column are multiplied by a
number(scalar), then the det is multiplied by that number
5. Det (AB) = det A x det B
6. If any row/column is a multiple of another row/column, then
det = 0
7. Interchanging two rows/columns, changes the sign of the det
8. Det AT = A ; means expanding by 1st row/ 1st column gives the
same results
9. Adding multiple rows/columns together make no difference to
the determinants
32
MATRIX INVERSES
The inverse of a square matrix A is a matrix whose product
with A is the identity matrix I.
The inverse matrix is denoted by A1.
The concept of dividing by A in matrix algebra is replaced by
the concept of multiplying by the inverse matrix A1.
An inverse matrix A-1 has the following PROPERTIES
1. A-1A = AA-1 = I
2. A-1 unique for a given A
Conditions for existence of a Matrix inverse
1. A-1 can exist only when A is a square
2. A-1 can exist only if A 0

33
HOW TO FIND INVERSE?

1. Calculate det A
2. For each element aij of A, calculate
cofactors Cij. This make new matrix C
3. Take the tranpose (CT) of C (which is
known as adjoint A)
4. Then A-1 = adj A/ A
5. Finally check A-1A = I

34
35
36
37
38
ADJUGATE OR ADJOINT
An ADJUGATE or ADJOINT of a matrix A denoted by
adj A is obtained by replacing the elements in A by
their cofactors and then transposing it
1 1
A A
adj ( A)
T
A11 A12 A13
adjA A21 A22 A23
A31 A32 A33

adj (AB) = adj A x adj B =


A if i j
39
0 if i j
SOLUTIONS OF LINEAR EQUATION
DETERMINANT:
1. useful in finding the inverse of a non-singular matrix (or
invertible)
2. be used for solving linear equations systems for which matrix
coefficient is non-singular
Consider a linear system
AX=B A=matrix coefficient; B= non-homogeneous term;
X=unknown column matrix
The above linear system has a unique solutions if A is invertible.
In this case, solution is given by Cramers Formula

det( Ai )
Xi for i 1..., n
det A
Where Xi = unknowns of system
Ai = matrix obtained from A by replacing the ith column by the column B
40
SOLVING LINEAR EQUATION BY GAUSS ELIMINATION
Based on elimination methods
Elimination will change the equations to upper triangular form (matrix
coefficient has zeros in every positions below the diagonal )
Elimination procedures rely on the manipulation of the rows of the matrix
equation
Some elementary row operations can be used and do not alter the solutions
of the equations
1. Multiply a row with a constant
2. Interchange any two rows
3. Add or substract one row from another
There are many type of elimination procedures including Gauss Elimination.
Gauss Elimination Step
1. Use row operations on the augmented matrix to transform Ax=b into
an upper triangular problem
2. By back substitution, solve the upper triangular problem for
solutions
41
What is iteration?
2 types iteration methods
1. Jacobi Iteration methods
2. Gauss Seidel

42
GAUSS SIEDEL ITERATION

Use the Following Use the Following formula


formula in obtaining in obtaining the iteration
the iteration values values

1 ( r 1) 1
x ( r 1)
(1 y ) (r ) x (1 y (r ) )
2 2
1 1
y ( r 1)
(1 x (r ) (r )
z ) y (r 1)
(1 x(r 1)
z (r ) )
2 2
1 1
z ( r 1)
(1 y (r ) (r )
t ) z (r 1)
(1 y (r 1)
t (r ) )
2 2
1 1
t ( r 1)
( 2 (r )
z ) t (r 1)
( 2 z ( r 1) )
2 2
43
EIGENVALUES AND EIGENVECTORS
Consider equations
Ax = x
for x (a vector) and (a scalar),
A (square matrix) and solve for x.

When x=0, is arbitrary, there is one uninteresting


solution
When x0, then there is interesting solutions, x is called
eigenvector of A and is the corresponding
eigenvalue.
Any n x n matrix has at most n distinct eigenvalues
EIGENVALUE and EIGENVECTORS always occurs in
pairs
44
EIGENVALUES AND EIGENVECTORS
Eigenvalue (also known as a characteristic
root):
the consolidated variance of a square matrix
the variance accounted for by a linear
combination of the input variables.
can have values of zero.
Eigenvector (also known as a characteristic
vector):
a non zero vector that is a linear combination of a set
of variables maximizing shared variance among p
variables
45
EIGENVALUES AND EIGENVECTORS
Ax = x since (Ix=x)
Then (AI)x = 0

If the matrix (AI) is non-singular (inverse exists), Then


multiplying by (A-I)-1 gives x=0 as the only solutions.
When (A- I) is not invertible, x0; i.e. can get other
solutions
This happens when det (AI) = 0
Expand det|AI| = 0, it becomes a polynomial equation,
C() in or called as the characteristic equation of A.
C( )= n +Cn-1 n-1 + Cn-2 n-2 +..+ C1 +C0
The roots of the polynomial equation above =
eigenvalues of A
46
HOW TO GET
EIGENVALUES AND EIGENVECTORS?

Find eigenvalues
Det (A- I) = 0
get values of or the roots

Find eigenvectors
- Solve (A- I)x = 0; for every roots found
in step 1
- Find values of x

47
USEFUL PROPERTIES OF EIGENVALUES
n n

Sum of eigenvalues of A is i trace A aii


i 1 i 1

The product of the eigenvalues of A is i n1 i det A


The eigenvalues of the inverse matrix are
1/ 1 , 1/ 2, .., 1/ n
The eigenvalues of the transposed matrix are 1, 2, .., n
If k is a scalar, then the eigenvalues kA are
k 1 , k 2, .., k n
If k is a scalar, and I is the n x n identity matrix, then the
eigenvalues of A are kI are
1 k , 2 k, .., n k
If k is positive integer, then the eigenvalues of Ak are
k k k
1 , 2 , .., n
48
EXAMPLES OF EIGENVALUES

49
50

You might also like