ce26 lecture on matrices
TRANSCRIPT
-
8/9/2019 CE26 Lecture on Matrices
1/23
2/18/20
CE 26
Lecture on Matrices
A. Matrix: Definition
B. Special Types of Matrices
C. Equality of Matrices
D. Elementary Operations on Matrices1. Matrix Addition
2. Scalar Multiplication
3. Matrix Subtraction
4. Matrix Multiplication
5. Transposition of a Matrix
E. Determinant of a Square Matrix
F. Adjoint of a Matrix
G. Inverse of a Matrix
H. Solution to System of Linear Equations(Direct Methods)
1. Inverse Method
2. Cramers Rule
3. LU Factorization
4. Gaussian Elimination
5. Gauss-Jordan Reduction Method
Matrix
A matrixis a rectangular array of numbers orfunctions arranged in rows and columnsusually designated by a capital letter andenclosed by brackets, parentheses or double
bars. A matrix may be denoted by:
=
mn2m1m
n22221
n11211
a...aa
:::
a...aa
a...aa
A
Unless stated, we assume that all ourmatrices are composed of real numbers.
The horizontal groups of elements are calledthe rowsof the matrix. The ith row of A is
[ ] ( )mi1a...aain2i1i
-
8/9/2019 CE26 Lecture on Matrices
2/23
2/18/20
The vertical groups of elements are called thecolumnsof the matrix. The jth column of A is
( )nj1
a
:
a
a
j3
j2
j1
The size of a matrixis denoted by m x n (mby n) where m is the number of rows and n is
the number of columns.
We refer to aij as the entryor the elementinthe ith row and jth column of the matrix.
We may often write a given matrix as
A = [aij].
Example:
4x38197
4110
5235
A
=
Columns
Rows
9 is element a32 located at3rd row and 2nd column ofmatrix A.
Size of Matrix A
Special Types of Matrices
A.A.A.A. Row Matrix or Row VectorRow Matrix or Row VectorRow Matrix or Row VectorRow Matrix or Row Vector is a matrixconsisting of only one row.
=
m
.
.
.i
.
.
.2
1
c
c
c
c
C
B = [b1 b2 . . . bj . . . bn]
B.B.B.B. Column Matrix or ColumnColumn Matrix or ColumnColumn Matrix or ColumnColumn Matrix or ColumnVectorVectorVectorVector is a matrix consistingof only one column.
C.C.C.C. Square MatrixSquare MatrixSquare MatrixSquare Matrix is a matrix in which the no.of rows equals the no. of columns.
Order of a Square Matrix is the number ofrows or columns of the matrix. Thus, we canjust refer to a 3x3 matrix as a square matrixof order 3.
3x3750
411
302
A
=
-
8/9/2019 CE26 Lecture on Matrices
3/23
2/18/20
C.C.C.C. Square MatrixSquare MatrixSquare MatrixSquare Matrix is a matrix in which the no.of rows equals the no. of columns.
Principal Diagonal or Main Diagonal of aSquare Matrix consists of the elements a11,a22, a33, ann.
3x3750
411302
A
=
C.C.C.C. Square MatrixSquare MatrixSquare MatrixSquare Matrix is a matrix in which the no.of rows equals the no. of columns.
The Trace of a Square Matrix is the sumof the elements on the main diagonal of thematrix. In the above matrix, trace = 2 + 1+ 7 = 10.
3x3750
411302
A
=
D.D.D.D. Upper Triangular MatrixUpper Triangular MatrixUpper Triangular MatrixUpper Triangular Matrix a square matrixall elements of which below the principaldiagonal are zero (aij = 0 for i>j).
=
33
2322
131211
u00
uu0
uuu
U
E.E.E.E. Lower Triangular MatrixLower Triangular MatrixLower Triangular MatrixLower Triangular Matrix a square matrixall elements of which above the principaldiagonal are zero (aij = 0 for i
-
8/9/2019 CE26 Lecture on Matrices
4/23
2/18/20
H.H.H.H. Identity MatrixIdentity MatrixIdentity MatrixIdentity Matrix represented by In, it is adiagonal matrix where all the elements
along the main diagonal are equal to 1 orunity.
=
100
010
001
I3
I.I.I.I. Null MatrixNull MatrixNull MatrixNull Matrix represented by is a matrix inwhich all the elements are zero.
=
0...00
:::
0...00
0...00
J.J.J.J. Symmetric MatrixSymmetric MatrixSymmetric MatrixSymmetric Matrix a square matrix whoseelement aij = aji.
=
354
522
421
S
K.K.K.K. Skew Symmetric MatrixSkew Symmetric MatrixSkew Symmetric MatrixSkew Symmetric Matrix a square matrixwhose element aij = -aji
=
054
502
420
T
Equality of Matrices
Two matrices A = (aij) and B = (bij) are equalif and only if the following conditions aresatisfied:
a) They have equal number of rows.
b) They have equal number of columns.
c) All elements in A agree with theelements in B. (aij=bij, for all i and j.)
-
8/9/2019 CE26 Lecture on Matrices
5/23
2/18/20
Example: The matrices
are equal if and only if x = 2, y = 1, z = 2, a =3, b = 4 and c = 1.
+
+
=
+
=
1c43
22b1x
112
Band
zb3
21ya
2c1x
A Elementary Operations onMatrices
A. MATRIX ADDITIONA. MATRIX ADDITIONA. MATRIX ADDITIONA. MATRIX ADDITION
If A = (aij) and B = (bij) are matrices of thesame size m x n, then the sum A + B isanother m x n matrix C = [cij] where cij = aij+ bij for i = 1 to m and j = 1 to n.
Matrix addition is accomplished by addingalgebraically corresponding elements in Aand B.
Example: Given two 2x3 matrices A and B
=
=
114
223B
123
421A
=
+++
+++=
+
=+
211
204
11)1(243
)2(42231
114
223
123
421BA
B. SCALAR MULTIPLICATIONB. SCALAR MULTIPLICATIONB. SCALAR MULTIPLICATIONB. SCALAR MULTIPLICATION
If A = (aij) is an m x n matrix and k is a realnumber (or a scalar), then the scalar multiple
of A by k is the m x n matrix C = [cij] where cij= k*aij for all i and j.
In other words, the matrix C is obtained bymultiplying each element of the matrix by thescalar k.
Examples:
=
156912
9306
5234
31023
=
28168
4820
1248
742
125
312
4
-
8/9/2019 CE26 Lecture on Matrices
6/23
2/18/20
C. MATRIX SUBTRACTIONC. MATRIX SUBTRACTIONC. MATRIX SUBTRACTIONC. MATRIX SUBTRACTION
If A and B are m x n matrices, the differencebetween A and B denoted as A B is obtainedfrom the addition of A and (-1)B.
A B = A + (-1)B
Matrix subtraction is accomplished bysubtracting from the elements of the firstmatrix the elements of the second matrixcorrespondingly.
Example:
Note: We can only add or subtract matriceswith the same number of rows and columns.
=
=
383
412B
475
243A
=
=
+
=
718
651
3487)3(5
42)1(423
383412
475243BA
D. MATRIX MULTIPLICATIOND. MATRIX MULTIPLICATIOND. MATRIX MULTIPLICATIOND. MATRIX MULTIPLICATION
If A = (aij) is an m x n matrix and B = (bij) isan n x p matrix, then the product of A and B,AB = C = [cij] is an m x p matrix where
for i = 1 to m and j = 1 to p
=
=n
1k
kjikijbac
The formula tells us that in order to get theelement cij of the matrix C, get the elementsof the ith row of A (the pre-multiplier) andthe elements on the jth column of B (the postmultiplier). Afterwards, obtain the sum of theproducts of corresponding elements on thetwo vectors.
Note:
The product is defined only if the number ofcolumns of the first factor A (pre-multiplier) is
equal to the number of rows of the secondfactor B (post-multiplier). If this is satisfied,we say that the matrices are conformable inthe order AB.
The formula An will be defined as A A A A
Examples:
=
=
13
42B
43
21A
=
++
++=
=
++
++=
20
1210BA
)4)(1()2(3)3)(1()1(3
)4)(4()2(2)3)(4()1(2BA
1618
68
AB
)1(4)4(3)3(4)2(3
)1(2)4(1)3(2)2(1AB
Note: Although AB andBA are defined it is notnecessary that AB = BA.
-
8/9/2019 CE26 Lecture on Matrices
7/23
-
8/9/2019 CE26 Lecture on Matrices
8/23
2/18/20
Determinant
Another very important number associatedwith a square matrix A is the determinantdeterminantdeterminantdeterminant of
A which we will now define. This uniquenumber associated to a matrix A is useful inthe solutions of linear equation.
Permutation:
Let S={1, 2, 3, , n} be the set of integersfrom 1 to n, arranged in increasing order. Arearrangement a1a2a3an of the elements in Sis called a permutation of S.
By the Fundamental Principle of Counting wecan put any one of the n elements of S in thefirst position, any one of the remaining (n-1)elements in the second position, any one ofthe remaining (n-2) elements in the thirdposition, and so on until the nth position.Thus there are n(n-1)(n-2)3*2*1 = n!permutations of S. We refer to the set of allpermutations of S by Sn.
Examples:
If S = {1, 2, 3} then S3 = {123, 132, 213, 231,312, 321}
If S = {1, 2, 3, 4} then there are 4! = 24elements of S4.
Odd and Even Permutations
A permutation a1a2a3an is said to have aninversion if a larger number precedes asmaller one. If the total number of inversionin the permutation is even, then we say that
the permutation is even, otherwise it is odd.
Examples: ODD and EVEN Permutation
S1 has only one permutation; that is 1, which iseven since there are no inversions.
In the permutation 35241, 3 precedes 2 and 1,5 precedes 2, 4 and 1, 2 precedes 1 and 4precedes 1. There is a total of 7 inversions,thus the permutation is odd.
S3 has 3! = 6 permutations: 123, 231and 312are even while 132, 213, and 321 are odd.
S4 has 4! = 24 permutations: 1234, 1243,1324, 1342, 1423, 1432, 2134, 2143, 2314,
2341, 2413, 2431, 3124, 3142, 3214, 3241,3412, 3421, 4123, 4132, 4213, 4231, 4312,4321.
For any Sn, where n>1 it contains n!/2 evenpermutations and n!/2 odd permutations.
-
8/9/2019 CE26 Lecture on Matrices
9/23
-
8/9/2019 CE26 Lecture on Matrices
10/23
2/18/20
METHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANT
B. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHOD
Complementary Minor,Complementary Minor,Complementary Minor,Complementary Minor, detdetdetdet((((MijMijMijMij) or) or) or) or MijMijMijMij The complementary minor or simply minor of
an element aij of the matrix A is thatdeterminant of the sub-matrix Mij obtainedafter eliminating the ith row and jth columnof A
METHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANT
B. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHOD
Algebraic Complement or Cofactor,Algebraic Complement or Cofactor,Algebraic Complement or Cofactor,Algebraic Complement or Cofactor, AAAAijijijij The algebraic complement or cofactor of an
element aij of the matrix A is that signedminor obtained from the formula (-1)i+j Mij
METHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANT
B. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHOD
The determinant of a square matrix maybeobtained using expansion about a row orexpansion about a column. The followingformulas maybe used in getting thedeterminant:
(expansion about the ith row)
=
=+++=n
1kikikinin2i2i1i1i
AaAa...AaAa)Adet(
METHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANT
B. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHOD
The determinant of a square matrix maybeobtained using expansion about a row orexpansion about a column. The followingformulas maybe used in getting thedeterminant:
(expansion about the jth column)
=
=+++=n
1k
kjkjnjnjj2j2j1j1AaAa...AaAa)Adet(
METHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANTMETHODS IN GETTING THE DETERMINANT
B. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHODB. COFACTOR METHOD
Note: We may choose any row or any column
in getting the determinant of a given matrix.
Example: Evaluate the given matrix
01300423
1412
0301
It is best to expand about the fourth row because it has the mostnumbers of zeros. The optimal course of action is to expandabout the row or column that has the largest number of zeros,because in that case the cofactors Aij of those aij which are zeroneed not be evaluated since the product of a ijAij = (0)Aij = 0.
4444343424241414AaAaAaAa +++=
24
42
242424M)1(aAa +==
( )( ) ( )( )012027021
130
423301
116
++=
=
13=
-
8/9/2019 CE26 Lecture on Matrices
11/23
2/18/20
Adjoint
The Adjoint of a square matrix A=[aij] of order n isthat square matrix with the same order n denoted
by adj(A)=[Aji] where Aij is the cofactor of theelement aij of matrix A. The adjoint of a matrix isthe transpose of the matrix of cofactors of theelements of A.
Input: Square MatrixOutput: Square Matrix (with the same size as theoriginal matrix)
Notation: adj A, adj B
Step 1:Step 1:Step 1:Step 1: Get the cofactors of all the elementsin the original matrix.
Recall: the cofactor of an element aij can bedenoted as Aij and is defined by:
ij
ji
ijM)1(A +=
Step 2:Step 2:Step 2:Step 2: Set up the adjoint matrix by takingthe transpose of the matrix of cofactors.
Example:
If A = then adj(A) =
[ ]Tij
AAadj =
dc
ba
ac
bd
Inverse
The inverse of a square matrix A = [aij] oforder n is that matrix B = [bij] of the sameorder n such that AB = BA = In. We denotethe inverse matrix of A by A-1. Thus, we
define the inverse of A as that matrix A-1
such that
A(A-1) = (A-1)A = In.
-
8/9/2019 CE26 Lecture on Matrices
12/23
2/18/20
Not all matrices has its inverse. However, ifthe inverse of a matrix exists, it is unique.
If the inverse of a matrix exists, we say thatthe matrix is invertible or non-singular.Otherwise, we say that the matrix is non-invertible or singular.
Matrix Inversion applies only to square
matrices and can be produced using theadjoint matrix and the determinant.
Notation: A-1, B-1
A
adjAA 1 =
From the above formula for inverse, it ishighly suggested that the determinant becomputed first. If it so happened that thematrix is singular (i.e., the determinant iszero), then the inverse of the matrix is said tobe non-existent.
Note that it is a waste of effort to stillproduce the adjoint if the matrix is singular.Therefore, it is advised that you first check
for singularity.
Example 1Example 1Example 1Example 1: Find A-1 if
Compute first the determinant using thediagonal method
Since matrix A is singular, as evidenced by itszero determinant, it can thus be concludedthat the Inverse of A (or A-1) does not exist.
=
771
252
111
A
01414514235A =+++=
Example 2:Example 2:Example 2:Example 2: Set up the inverse of the given matrix
Compute first the determinant using the diagonalmethod
Since the determinant is not zero, then matrix Ais said to be non-singular. In this case, theinverse exists and there is a need to set up theadjoint.
=
324
321
111
A
73682126A =++=
ij
ji
ijM)1(A +=
1232
32
)1(A
2
11=
=
934
31
)1(A
3
12== 10
24
21)1(A 413 =
=
132
11)1(A 3
21=
= 1
34
11)1(A 422 == 224
11)1(A 5
23=
=
532
11)1(A 4
31=
= 2
31
11)1(A 5
32== 3
21
11)1(A 6
33=
=
Getting the cofactors of all theelements in the original matrix.
=
324
321
111
A
[ ]
=
325
211
10912
A ijThus, the cofactormatrix Aij is
-
8/9/2019 CE26 Lecture on Matrices
13/23
2/18/20
Cofactor Matrix from the previous slide
[ ]
=
325
21110912
A ij
Therefore the adjoint of A is
=
3210
219
5112
AadjTij
AAadj =
Consequently, the inverse of A is
AAadjA 1 =
=
3210
219
5112
71A 1
To check if A-1 is correct, use n1 IAA =
3
1 I
100
010
001
324
321
111
3210
219
5112
7
1AA =
=
=
)IAAor(n
1 =
Solution to System ofLinear Equations(Direct Methods)
In general, we can think of a system of linearequations as a set of m equations thatcontains n unknowns. There are severalforms by which a system of equations can bewritten.
A. Equation Form
B. Matrix Form
We can have the equation form
where aij are constant coefficients of theunknowns xj and bj are the constants
mnmn33m22m11m
3nn3333232131
2nn2323222121
1nn1313212111
bxaxaxaxa
bxaxaxaxa
bxaxaxaxa
bxaxaxaxa
=++++
=++++
=++++
=++++
L
MMMMM
L
L
L
Or we can transform that to the matrix form:
=
m
3
2
1
n
3
2
1
mn3m2m1m
n3333231
n2232221
n1131211
b
b
b
b
x
x
x
x
aaaa
aaaa
aaaa
aaaa
MM
L
MMMMM
L
L
L
-
8/9/2019 CE26 Lecture on Matrices
14/23
2/18/20
Referring to the matrix form, we can actuallyrewrite the system of equations as a compact
matrix operation:
A X = BWhere:
A Coefficient MatrixX Column Matrix of
Unknowns/Variables
B Column Matrix of Constants
Solution to System ofLinear Equations(Direct Methods)
A. Inverse MethodB. Cramers RuleC. LU FactorizationD. Gaussian EliminationE. Gauss-Jordan Reduction
Inverse Method
The Inverse Method maybe applied only to asystem of linear equations in which the numberof independent equations is equal to thenumber of unknowns. If the number ofequations is equal to the number of unknowns,the equation AX = B will have a matrix ofcoefficients that is square.
If the matrix of coefficients A is non-singular,the solution to the system is unique. On theother hand, if A is singular, either the systemhas a non-unique solution or no solution at all.
Derivation of the Solution for xis :
BAX
BAX*I
B*AX*)AA(
B*AAXA
BAX
1
1
11
11
=
=
==
= Take note thatthe derivationassumes that A-1
exists. If A-1 doesnot exist, we cannot find thesolution to thesystemAX = B.
Example:Example:Example:Example: Determine thevalues ofx1, x2and x3 inthe following system ofequations. 5x3x2x4
6x3x2x
1xxx
321
321
321
=+
=++
=+
Solution:Solution:Solution:Solution:
The above system ofequations can be writtenin matrix form AX = B:
=
5
6
1
x
x
x
324
321
111
3
2
1
A X B
-
8/9/2019 CE26 Lecture on Matrices
15/23
2/18/20
Consider matrix A
=
324
321
111
A
=
3210
219
5112
7
1A 1
Getting A-1
==
=
5
6
1
*
3210
219
5112
7
1BA
x
x
x
X 1
3
2
1
To get x1, x2 and x3 , multiply A-1 to B:
Note: Refer to previousexample for A-1
Performing the operationA-1B will yield the solutionsolutionsolutionsolution
matrixmatrixmatrixmatrix:
=
=
1
1
1
x
x
x
X
3
2
1
Make it a habit to check if all the computed valuesof the unknowns satisfy all the given equations.Checking is done by substituting the values x1 = 1,x2 = 1 and x3 = 1 to the original equations.
Equation 1 1(1) 1(1) + 1(1) =? 1 Satisfied
Equation 2 1(1) + 2(1) + 3(1) =? 6 Satisfied
Equation 3 4(1) 2(1) + 3(1) =? 5 Satisfied
Since all the equations were satisfied, then (x1, x2,
x3) = (1, 1, 1) is indeed the solution to the system.
Cramers Rule
Recall that A system of equation nequations in n unknowns can be modeledas a matrix operation AX = B.
=
n
3
2
1
n
3
2
1
nn3n2n1n
n3333231
n2232221
n1131211
b
b
b
b
x
x
x
x
aaaa
aaaa
aaaa
aaaa
MM
L
MMMMM
L
L
L
Let:
AAAA coefficient matrixxxxxiiii i
th variableBBBB right hand side constantsAAAAiiii matrix resulting from
replacing the ith column ofAby the column vector ofconstants B
Solution is given by:
A
Ax
i
i=
Notice that regardless of the variable i that iscomputed, the denominator of the aboveformula is fixed at |A|. Therefore, it issuggested that the determinant of the
coefficient matrix be the first to be computed. Example:Example:Example:Example: Using Cramer's
Rule, determine the valuesofx1, x2and x3thatsimultaneously satisfy thefollowing system ofequations.
=
3
2
1
x
x
x
121
133
121
3
2
1
-
8/9/2019 CE26 Lecture on Matrices
16/23
2/18/20
Solution:Solution:Solution:Solution: Compute the determinant of A first.
6623623A
121133
121
A
=+++=
=
Now, let us compute for the value of x1 byusing the formula
A
Ax
1
1 =
The right hand side matrix B is
To set up the matrix A1, all you just have to do isto replace the first column of A by B. Doing whathas just been described will result in:
3
2
1
0429463A
123
132
121
A
1
1
=+++=
= 06
0
A
Ax 1
1===
Applying the same process to solve x2 and x3:
1
321
233
121
*6
1
A
Ax1
131
123
111
*6
1
A
Ax
3
3
2
2 ====
==
LU Factorization
Direct LDirect LDirect LDirect L----U Factorization:U Factorization:U Factorization:U Factorization:In theory any square matrix A may be factored intoa product of lower and upper triangular matrices.
Let us take the case of a 4 th order matrix:
Notice that the diagonal elements of the uppertriangular matrix have been set to values of 1 forreason of simplicity. (L-U Factorization is notunique.)
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
From matrix multiplication, we know that:
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
)0(0)0(0)0(0)1(la1111
+++= 1111 al =
)0(0)0(0)0(l)1(la 222121 +++= 2121 al =
)0(0)0(l)0(l)1(la33323131
+++=3131
al =
)0(l)0(l)0(l)1(la 4443424141 +++= 4141 al =
or
1. Get First Column Elements of Matrix L (1 unknown per equation)
-
8/9/2019 CE26 Lecture on Matrices
17/23
2/18/20
From matrix multiplication, we know that:
=
1000
u100uu10
uuu1
*
llll
0lll00ll
000l
aaaa
aaaaaaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
or
2. Get First Row Elements of Matrix U (1 unknown per equation)
)0(0)0(0)1(0)u(la 121112 +++=
)0(0)1(0)u(0)u(la 23131113 +++=
)1(0)u(0)u(0)u(la3424141114+++=
111212l/au =
111313l/au =
111414l/au =
From matrix multiplication, we know that:
=
1000
u100uu10
uuu1
*
llll
0lll00ll
000l
aaaa
aaaaaaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
or
3. Get Second Column Elements of Matrix L (1 unknown per equation)
)0(0)0(0)1(l)u(la 22122122 +++=
)0(0)0(l)1(l)u(la3332123132
+++=
)0(l)0(l)1(l)u(la444342124142
+++=
)u(lal12212222
=
)u(lal12313232
=
)u(lal12414242
=
From matrix multiplication, we know that:
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
4. Get Second Row Elements of Matrix U (1 unknown per equation)
)0(0)1(0)u(l)u(la2322132123
+++=
2213212323l/)]u(la[u =
)1(0)u(0)u(l)u(la232422142124+++=
2214212424l/)]u(la[u =
From matrix multiplication, we know that:
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
5. Get Third Column Elements of Matrix L (1 unknown per equation)
)0(0)1(l)u(l)u(la332332133133
+++=)u(l)u(lal
233213313333=
)0(l)1(l)u(l)u(la 44432342134143 +++=
)u(l)u(lal234213414343
=
From matrix multiplication, we know that:
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
6. Get Third Row Element of Matrix U (1 unknown per equation)
)1(0)u(l)u(l)u(la 34332432143134 +++=
33243214313434l/)]u(l)u(la[u =
From matrix multiplication, we know that:
=
1000
u100
uu10
uuu1
*
llll
0lll
00ll
000l
aaaa
aaaa
aaaa
aaaa
34
2423
141312
44434241
333231
2221
11
44434241
34333231
24232221
14131211
7. Get Fourth Column Element of Matrix L (1 unknown per equation)
)1(l)u(l)u(l)u(la4434432442144144
+++=
)u(l)u(l)u(lal3443244214414444
=
-
8/9/2019 CE26 Lecture on Matrices
18/23
2/18/20
Recall:Recall:Recall:Recall: A system of equations can be writtenas a compact matrix operation AX = B
If we factor out the coefficient matrix A asL*Uand substitute to AX = B, we cangenerate the equation L(UX)=B.
Momentarily define UX = Ywhich suggestsLY = B. From this transformation, we haveactually decomposed AX = Bto two systemsof equations.
TwoTwoTwoTwo----Stage SolutionStage SolutionStage SolutionStage Solution::::
Stage 1: Solve for Yin the equation LY = Busing forward substitution.
Stage 2: Solve for Xin the equation UX = Yusing back substitution.
Example:Example:Example:Example: Determine the solution X in
=
8
4
3
x
x
x
121
153
124
3
2
1
Knowing that A = LU, determining L and U asbelow
=
121
153
124
A
=
25
251
02
73
004
L
=
1002
1104
12
11
U
Stage 1:Stage 1:Stage 1:Stage 1: Forward substitution using LY = B
=
8
4
3
y
y
y
25
251
02
73
004
3
2
1
4
3y1 =
2
1y2 =
3y3 =
Note that the computed values of yi's hereare not yet the solution since the originalsystem of equations is in terms of xi's.
Stage 2:Stage 2:Stage 2:Stage 2: Back substitution using UX = Y
=
321
43
xx
x
1002110
41
211
3
2
1
This time (x1, x2, x3) = (1, 2, 3) is the solutionto the original system of equations.
1x1 =
2x2 =
3x3=
If A is an m x n matrix and B is a p x nmatrix, then the augmented matrix of A andB denoted by [A : B] is the matrix formed bythe elements of A and B separated by pipes.
Example:Example:Example:Example:
=
833
617
521
A
=
47
20
12
B
=
47
20
12
|
|
|
833
617
521
B:A
-
8/9/2019 CE26 Lecture on Matrices
19/23
2/18/20
The augmented matrix associated to a systemof linear equation AX=B is the matrix [A : B].
For example, we can now rewrite the systemof equation:
=
1
1
1
z
y
x
142
621
312
1
1
1
|
|
|
142
621
312
An m x n matrix A is said to be in row echelonform if it satisfies the following properties:
1. All rows whose elements are all zeros, if exist,are at the bottom of the matrix.
2. If at least one element on a row is not equal tozero, the first non-zero element is 1, and thisis called the leading entry of the row.
3. If two successive rows of the matrix haveleading entries, the leading entry of the rowbelow the other row must appear to the right ofthe leading entry of the other row.
An m x n matrix A is said to be in reduced rowechelon form if added to the first threeproperties it satisfies a fourth property:
4. If a column contains a leading entry of somerow, then all the other entries must be zero.
ExamplesExamplesExamplesExamples::::
=
=
=
0010
8100
7610
4221
C
0000
1000
0100
0210
0001
B
100000
000000
291000
531010
231021
A
The following matrices are not in row echelon form.(Why not?)
Did not satisfy
property 1
Did not satisfy
property 2
Did not satisfy
property 3
=
=
=
0000
0000
0100
3010
0801
F
00100
80010
26501
E
1000
2100
3210
4321
D
ExamplesExamplesExamplesExamples::::
The following matrices are in row echelon form but notin reduce row echelon form.
All properties are satisfied except property 4.
Must all be zeroes to satisfy the 4th property.
ExamplesExamplesExamplesExamples::::
The following matrices are in reduced row echelonform. (Hence, in row echelon form.)
=
=
=
000
000
000
010301
J
01000
30100
20010
H
1000
0100
0010
0001
G
-
8/9/2019 CE26 Lecture on Matrices
20/23
2/18/20
2
An elementary row (column) operation on amatrix A is any one of the following
operations:
Type I. Interchange any two rows (columns).
Type II. Multiply a row (column) by a non-zeroconstant k.
Type III. Add to elements of a row k times of theelements of another row thecorrespondingly.
Example:Example:Example:Example: Let
=
2282
4613
0201
A
=
0201
4613
2282
B
=
1141
4613
0201
C
Type I:Type I:Type I:Type I: Interchanging rows 1 and 3 of A (R1R3)obtain
Type II:Type II:Type II:Type II: Multiplying row 3 by (R3 R3), we obtain
Example:Example:Example:Example: Let
=
2282
4613
0201
A
=
2282
4010
0201
D
Type III:Type III:Type III:Type III: Adding 3 times the elements in row 1 to the
elements in row 2 (R2R2 + 3R1), we obtain
As a applied to the augmented matrix [A:B] asa system of equation, the three elementary rowoperation will correspond to the following:
TYPE I rearranging the order of theequations
TYPE II multiplying both side of theequation by a constant
TYPE III working with two equations
From this observation, we could see that asapplied to a operations does not alter thesolution of the system.
In general a system of m equations in nunknowns may be written in matrix form:
=
m
3
2
1
n
3
2
1
mn3m2m1m
n3333231
n2232221
n1131211
b
b
b
b
x
x
x
x
aaaa
aaaa
aaaa
aaaa
MM
L
MMMMM
L
L
L
m
3
2
1
mn3m2m1m
n3333231
n2232221
n1131211
b
b
b
b
|
|
|
|
aaaa
aaaa
aaaa
aaaa
MM
L
MMMMM
L
L
L
This system may now be represented by theaugmented notation:
Gaussian Elimination Method
-
8/9/2019 CE26 Lecture on Matrices
21/23
2/18/20
2
The objective of the Gaussian EliminationGaussian EliminationGaussian EliminationGaussian EliminationMethodMethodMethodMethod is to transform the augmented matrix
[A : B] to the matrix [A* : B*] in row echelonform by applying a series of elementary rowtransformations. Getting the solution of thesystem [A* : B*] using back substitution willalso give the solution to the original system[A : B].
1. Find the leftmost non-zero column.2. If the 1st row has a zero in the column of step 1,
interchange it with one that has a non-zero entryin the same column.
3. Obtain zeros below the leading entry by addingsuitable multiples of the top row and to the rowsbelow that.
4. Cover the top row and repeat the same processstarting with step 1 applied to the leftoversubmatrix. Repeat this process with the rest ofthe rows.
5. For each row obtain leading entry 1 by dividingeach row by their corresponding leading entry
Example:Example:Example:Example: The linear system
3zx3
8zyx2
9z3y2x
=
=+
=++
[ ]
=
3|103
8|112
9|321
B:A
Has the augmented matrix associated to the system
TransformTransformTransformTransform in row echelon form
[ ]
=
3|103
8|112
9|321
B:A
Element in the 1st row 1st column is non-zero and alreadyis equal to 1 (leading entry).
Transform into zeroes all elements below the leadingentry.
[ ]
=
24|1060
10|550
9|321
*B:*A122 R2R'R
133R3R'R
Consider now the transformation of column 2elements
Element at 2nd row 2nd column is non-zero and will betransformed to 1 (leading entry). Afterwards, transformelements below to zero.
[ ]
=
24|1060
10|550
9|321
*B:*A
22 R5
1'R
[ ]
=
24|1060
2|110
9|321
*B:*A
[ ]
=
12|400
2|110
9|321
*B:*A233 R6R'R +
Consider now the transformation of column 3elements
Element at 3rd row 3rd column is non-zero and will betransformed to 1 (leading entry).
[ ]
=
3|100
2|110
9|321
*B:*A
[ ]
=
12|400
2|110
9|321
*B:*A
Augmented Matrix in Row Echelon Form!
33R
4
1'R
-
8/9/2019 CE26 Lecture on Matrices
22/23
-
8/9/2019 CE26 Lecture on Matrices
23/23
2/18/20
THE END