SYSTEM OF LINEAR EQUATIONS & MATRICES
SYSTEM OF LINEAR EQUATIONS& MATRICES
What is a matrix?
A matrix is a rectangular array of elements
The elements may be of any type (e.g. integer, real, complex, logical, or even other matrices).
In this course we will only consider matrices that have integer, real, or complex elements.
5 0 1 23 4 9 23 1 4 2
Order of matrices…
Order 4 3:
Order 3 4:
3 columns
4 rows
5 0 1
2 3 4
9 2 6
3 1 4
4 columns
3 rows
5 0 1 2
3 4 9 2
3 1 4 2
Specifying matrix elements
aij denotes the element of the matrix A on the ith row and jth column.
A
column j
row i
5 0 12 3 4 9 2 63 1 4
• a12 = 0
• a21 = 2
• a23 = -4
• a32 = 2
• a41 = 3
• a43 = 4
Matrix operations: scalar multiplication
Multiplying an m n matrix by a scalar results in an m n matrix with each of its elements multiplied by the scalar.
e.g.
826
12418
864
2010
413
629
432
105
2
1239
18627
1296
3015
413
629
432
105
3
Matrix operations: addition…
Adding or subtracting an m n matrix by an m n matrix results in an m n matrix with each of its elements added or subtracted.
e.g.
431
8112
113
136
024
213
541
231
413
629
432
105
417
436
971
334
024
213
541
231
413
629
432
105
…Matrix operations: addition
Note that matrices being added or subtracted must be of the same order.
e.g.invalid!
113
201
413
629
432
105
Matrix operations: multiplication…
Multiplying an m n matrix by an n p matrix results in an m p matrix
wsrom
columnsp
wsron
columnsp
wsrom
columnsn
…Matrix operations: multiplication… Example 1…
1 0 2
3 1 1
2 1
3 2
1 4
0
( 12) (0 3) (2 1) 0
1 0 2
3 1 1
2 1
3 2
1 4
0 7
( 1 1) (0 2) (2 4) 7
1 0 2
3 1 1
2 1
3 2
1 4
0 7
10
(32) (13) (11) 10
1 0 2
3 1 1
2 1
3 2
1 4
0 7
10 9
(3 1) (1 2) (1 4) 9
…Matrix operations: multiplication…
Example 2
i.e. the number of columns in the first matrix must equal the number of rows in the second matrix!
invalid!
113
201
124
862
351
…Matrix operations: multiplication…
Matrix multiplication is NOT commutative In general, if A and B are two matrices then A B ≠ B A i.e. the order of matrix multiplication is important! e.g.
10
22
10
02
10
21
10
42
10
21
10
02
…Matrix operations: transpose…
If B = AT, then bij = aji
i.e. the transpose of an m n matrix is an n m matrix with the rows and columns swapped.
e.g.
4641
1230
3925
413
629
432
105T
3925
3
9
2
5
T
…Matrix operations: transpose…
(A B)T = BT AT
Note the reversal of order. Justification (not a proof):
e.g. if A is 3 2 and B is 2 4then AT is 2 3 and BT is 4 2so AT BT cannot be multipliedbut BT AT can be multiplied.
Special matrices: row and column
A 1 n matrix is called a row matrix.e.g.
An m 1 matrix is called a column matrix.e.g.
1 columns
3 rows
3
1
5
6 columns1 rows
2 1 1 2 1 5
Special matrices: square
An n n matrix is called a square matrix.i.e. a square matrix has the same number of rows and columns.e.g.
4705
7350
0523
5031
211
010
210
21
321
Special matrices: diagonal A square matrix is diagonal if non-zero elements only occur on the leading diagonal.
i.e. aij = 0 for i ≠ je.g.
Premultiplying a matrix by a diagonal matrix scales each row by the diagonal element.
Postmultiplying a matrix by a diagonal matrix scales each column by the diagonal element.
4000
0300
0020
0001
200
010
000
20
021
Special matrices: triangular
A lower triangular matrix is a square matrix having all elements above the leading diagonal zero.e.g.
An upper triangular matrix is a square matrix having all elements below the leading diagonal zero.e.g.
4705
0350
0023
0001
1 20 1
Special matrices: null
The null matrix, 0, behaves like 0 in arithmetic addition and subtraction.
Null matrices can be of any order and have all of their elements zero.
0000
0000
0000
0000
00
00
00
00
00
0000
00
00
Special matrices: identity…
The identity matrix, I, behaves like 1 in arithmetic multiplication. Identity matrices are diagonal. They have 1s on the diagonal and 0s
elsewhere.e.g.
In the world of the matrix the identity truly is ‘the one’.
1000
0100
0010
0001
100
010
001
10
011
II
II
…Special matrices: identity
The identity matrix multiplied by any compatible matrix results in the same matrix.i.e. I A = Ae.g.
Any matrix multiplied by a compatible identity matrix results in the same matrix.i.e. A I = Ae.g.
Multiplication by the identity matrix is thus commutative.
51
13
51
13
10
01
51
13
10
01
51
13
Determinant of a 22 matrix… Matrices can represent geometric transformations, such
as scaling, rotation, shear, and mirroring. 2 2 matrices can represent geometric transformations
in a 2–dimensional space, such as a plane. Determinants of 2 2 matrices give us information
about how such transformations change the area of shapes.
Determinants are also useful to define the inverse of a matrix.
…Determinant of a 22 matrix… The determinant of a 2 2 matrix is the product
of the 2 leading diagonal terms minus the product of the cross- diagonal.
i.e. if A is a 2 2 matrix, then the determinant of A is denoted by det(A) = |A| = a11 a22 – a21 a12
e.g.
det3 1
2 6
3 1
2 6 36 2 1 20
det 2 5
1 3
2 5
1 3 2 3 15 11
…Determinant of a 22 matrix
|A B| = |A| |B| Note the order is not important. Justification (not a proof):
We will shortly see that A and B can represent geometric transformations, and A B represents the combined transformation of B followed by A. The determinant represents the factor by which the area is changed, so the combined transformation changes area by a factor |A B|. Looking at the individual transformations, the area of the first is changed by a factor |B|, and the second by |A|. The overall transformation is thus changed by a factor |B| |A|, which is the same as |A| |B|.
Inverse of a matrix
In arithmetic multiplication the inverse of a number c is 1/c sincec 1/c = 1 and 1/c c = 1
For matrices the inverse of a matrix A is denoted by A-1
A A-1 = IA-1 A = Iwhere I is the identity matrix.
Multiplication of a matrix by its inverse is thus commutative.
We shall only consider the inverse of 2 2 matrices.
Inverse of a 22 matrix…
The inverse of a 2 2 matrix A is given by
Note:The leading term is 1/determinant;The diagonal elements are swapped;The cross-diagonal elements change their sign.
a11 a12
a21 a22
1
1
a11 a12
a21 a22
a22 a12
a21 a11
…Inverse of a 22 matrix… Example 1
Note that A A-1 = I (right inverse)
and A-1 A = I (left inverse)
11
24
6
1
11
24
41
211
41
211
10
01
11
24
6
1
41
21
10
01
41
21
11
24
6
1
…Inverse of a 22 matrix…
Example 2
Note that the determinant is zero so the inverse does not exist for this matrix.
Matrices with zero determinant can have no inverse. Such matrices are called singular.
2 2
3 3
1
1
2 2
3 3
3 2
3 2
1
0
3 2
2 2
invalid!
…Inverse of a 22 matrix…
(A B)-1 = B-1 A-1
Note the reversal of order. Justification (not a proof):
B-1 A-1 A B = B-1 (A-1 A) B = B-1 B = Iso B-1 A-1 is the inverse of A Bi.e. (A B)-1 = B-1 A-1
29
Matrix Solution of Linear SystemsWhen solving systems of linear equations, we can represent a linear system of equations by an augmented matrix, a matrix which stores the coefficients and constants of the linear system and then manipulate the augmented matrix to obtain the solution of the system.
Example:
x + 3y = 5
2x – y = 3
1 3 5
2 1 3
The augmented matrix associated with the above system is
30
Generalization
Linear system: Associated augmented matrix:
11 12 1
21 22 2
a a k
a a k
2222121
1212111
kxaxa
kxaxa
Operations that Produce Row-Equivalent Matrices 1. Two rows are interchanged:
2. A row is multiplied by a nonzero constant:
3. A constant multiple of one row is added to another row:
i jR R
i ikR R
j i ikR R R
Augmented Matrix MethodExample 1Solve x + 3y = 5 2x – y = 3
1. Augmented system 2. Eliminate 2 in 2nd row by
row operation3. Divide row two by -7 to
obtain a coefficient of 1. 4. Eliminate the 3 in first
row, second position. 5. Read solution from matrix
:
1 2
2 2
2 1 1
1 3 5
2 1 3
2
1 3 5
0 7 7
/ 7
1 3 5
0 1 1
3
10 22, 1;(2,1)
01 1
R R
R R
R R R
x y
R2
Augmented Matrix MethodExample 2Solve
x + 2y = 4x + (1/2)y = 4
1. Eliminate fraction in second equationby multiplying by 2
2. Write system as augmented matrix. 3. Multiply row 1 by -2 and add to row 24. Divide row 2 by -3 5. Multiply row 2 by -2 and add to row
1. 6. Read solution : x = 4, y = 0 7. (4,0)
2 4
14 2 8
2
1 2 4
2 1 8
1 2 4
0 3 0
1 2 4
0 1 0
1 0 4
0 1 0
x y
x y x y
Augmented Matrix MethodExample 3Solve
10x - 2y = 6
-5x + y = -3
1. Represent as augmented matrix.
2. Divide row 1 by 2
3. Add row 1 to row 2 and replace row 2 by sum
4. Since 0 = 0 is always true, we have a dependent system. The two equations are identical, and there are infinitely many solutions.
10 2 6
5 1 3
5 1 3
5 1 3
5 1 3
0 0 0
Augmented Matrix MethodExample 4 Solve
Rewrite second equation Add first row to second row The last row is the equivalent
of 0x + 0y = -5 Since we have an impossible
equation, there is no solution. The two lines are parallel and do not intersect.
5 2 7
51
2
x y
y x
5 2 7
5 2 2
5 2 7
5 2 2
5 2 7
0 0 5
x y
x y
Barnett/Ziegler/Byleen Finite Mathematics 11e 36
Possible Final Matrix Forms for a Linear System in Two Variables
Form 1: Unique Solution (Consistent and Independent)
1 0
0 1
m
n
Form 2: Infinitely Many Solutions (Consistent and Dependent)
1
0 0 0
m n
Form 3: No Solution (Inconsistent)1
0 0
m n
p