MTS2A1 Komputer & Simulasi: Bagian I - Aljabar Matrix
MTS2A1 Komputer & Simulasi: Bagian I - Aljabar Matrix
MTS2A1 Komputer & Simulasi: Bagian I - Aljabar Matrix
4 3
2 5
7 2
CB =
1 6 = undefined
9 0
EXAMPLE
4 3 2 5 11 38
BC = =
7 2 1 6 16 47
2 5 4 3 43 16
CB =
6 7
=
BC 4
1 15
Properties of matrix multiplication
AB is not necessarily equal to BA
AB = 0 does not necessarily imply
that A = 0, B = 0, or BA = 0
−1 1 1 1 1 1
1 −1 2 2 = −1 −1
1 1 2 1 4 3 1 1 3 0
2 2 2 2 = 8 6 = 2 2 1 3
6
EXAMPLE
4 9
3 7
A = 0 2 B=
2 8
1 6
4 9 30 100
T
3 7 T 4 16 = 30 4 15
(AB) = ( 0 2
T ) =
2 8 100 16 55
1 6 15 55
T 4 9
T
3 7 3 2 4 0 1
BTAT = 0 2 =
2 8 1 6 7 8 9 2 6
30 4 15
=
16 55
Thus, BTAT = (AB)T
100 7
(AB)T =BTAT
8
❖Remarks: If the order of the factors in a product of matrices
is changed, the product matrix may change (or may not exist
at all!). Ignoring this is the source of many errors.
Pre-multiplication AB = AC
Post-multiplication BA = CA
9
Example
If A, B and C are matrices such that AB = I and
CA = I, show that B = C.
Solution:
10
2. Linear Equations
Example: (charity investment) A charity wishes to endow a
fund that will provide $50, 000 per year for cancer research.
The charity has $480, 000 and, to reduce risk, wants to
invest in two assets with returns 10% and 15% respectively.
How much should be invested in each asset?
Solution: Let x and y be the amount invested in the assets
earning 10% and 15%, respectively. Then
x + y = 480, 000
0.1x + 0.15y = 50, 000
The solution is x = 440, 000 and y = 40, 000.
14
A Unique solution – The lines intersect in a single point.
x1 + x 2 = 1
x1 − x 2 = −0.5
Multiple solutions – The lines are identical, i.e. intersect at
infinite points.
x1 + x 2 = 1
2x 1 + 2x 2 = 2
No solution – The lines don’t intersect (i.e. parallel lines).
x1 + x 2 = 1
2x 1 + 2x 2 = 0
15
❖ The linear equations come in two forms:
Ax = b 0 ‘non-homogeneous’ equations
Ax = b = 0 ‘homogeneous’ equations
❖ For non-homogeneous equations, there are three possible
types of solutions:
A unique solution, Multiple solutions, No solution at all
17
Further, an augmented matrix is defined as A , i.e.
x1 − x 2 = −3 (row 1) x 2 + row 2 → x1 − x 2 = −3
row 2
x1 + 2x 2 = 1 3x1 + 0 = −5
19
Theorem:
If an elementary operation is performed on a
linear system, the resulting system is equivalent
to the original system.
20
Algorithm of Gaussian Elimination (GE)
21
EXAMPLE GE with unique solution
1 1 1 x1 24
4 x 148
6 10
2 = (1)
1/2 1/ 4 1/ 3 x3 9
1 1 1 24
4 (row 2)/ 2 → row 2
6 10 148
[A|b] = (row 3)x12 → row 3
1/ 2 1/ 4 1/ 3 9
1 1 1 x1 24
i.e. 0 1 3 x 26
2 = (2)
0 0 7 x3 42
So the solutions of (1) and (2) are the same, after many row
operations.
From the last equation of (2), 7x 3 = 42 x 3 = 6
By back-substitution, x 2+ 3 6 = 26 x 2 = 8
x1 + 8 + 6 = 24 x1 = 10
23
EXAMPLE GE with multiple solutions
x1
3 2 2 −5 x 8
0.6 1.5 1.5 − 5.4 2 2.7
x3 =
2.4 − 0.2 − 0.1 1.4 2.1
x4
3 2 2 −5 8
[A|b] = 0.6 1.5 1.5 − 5.4 2.7
2.4 − 0.2 − 0.1 1.4 2.1
(row 2) + (row 1)x(-0.6/3) 3
2 2 −5 8
→ row 2
0 1.1 1.1 − 4.4 1.1
(row 3) + (row 1)x(-2.4/3)
→ row 3
0 −1.8 −1.7 5.4 − 4.3
49
24
(row 3)+ (row 2)x(1.8/1.1) 3 2 2 −5 8
→ row 3 0 1.1 1.1 − 4.4 1.1
0 0 0.1 −1.8 − 2.5
The last augmented matrix represents the following equations:
x1
3 2 2 −5 x 8
0 1.1 1.1 − 4.4
2 = 1.1
x3
0 0 0.1 −1.8 x −2.5
4
Here, three equations with four unknowns, so there will be
multiple solutions.
25
Let x 4 be an arbitrary value, i.e. x 4 =
Therefore for a given value of x 4 , the three equations are
sufficient to determine the remaining three unknowns.
From the third equation,
0.1x 3 −1.8 = −2.5 x 3 = −25 +18
Back-substitute to obtain x 2 = 26 −14 , x1 = 2 −
3 2 1 x1 3
2 1 1 x 0
2 =
6 2 4 x3 6
3 2 1 3 (row 3) + (row 2) 3 2 1 3
0 −1/ 3 1/ 3 − 2 x(-6) → row 3 0 −1/ 3 1/ 3 − 2
0 − 2 2 0 0 0 0 12
27
3 2 1 3
0 −1/ 3 1/ 3 − 2
0 0 0 12
28
Summary
In summary, the augmented matrix corresponding to a set of
linear equations after row operations becomes a triangle-type
of matrix (called echelon form) as (A4x4 for example):
= [A|b] (a f j ≠ 0)
If p = q = 0 multiple solutions
If p =0, q ≠ 0 no solution
If p ≠ 0 unique solution
The above conclusions can be further illustrated
using the concept of rank (dijelaskan pada sesi
29
yang akan datang
Partial Pivoting
The standard procedure of GE is to use row operation to
make the augmented matrix into triangle-type matrix. In the
process, the off-diagonal entries can be eliminated using
(row k) + (row i) x (-aki/aii) → row k
31
0.4003 −1.502 2.501
0 x 2 = 1, x1 = 10
−1.404 −1.404
If there is no pivoting
(row 2) - (row 1)x
0.0004 1.402 1.406 (0.4003/0.0004)→ row 2
0.4003 −1.502 2.501
0.0004 1.402 1.406
0
x 2 = 0.9993, x 1 = 12.5
−1405 −1404 Solution not accurate