Matrix Algebra: Motivation
Matrix Algebra: Motivation
Lectures 1-6
Matrix Algebra
6.1 Basic Concepts: Matrix Addition, Scalar Multiplication 6.2 Matrix Multiplication 6.3 Linear Systems of Equations: Gauss Elimination 6.4 Rank of a Matrix. Linear Independence. Vector Space 6.5 Solutions to Linear Systems: Existence, Uniqueness 6.6 Determinants. Cramers Rule 6.7 Inverse of a Matrix: Gauss-Jordan Elimination 6.8 Vector Spaces, Inner Product Spaces, Linear Transformations
Md2
G Motivation:
Linear Algebra
Theory and application of linear systems of equations (Linear Systems) Linear Transformations Eigenvalue problems
G Applications:
Electrical networks Frameworks in mechanics Curve fitting and other optimisation problems Systems of differential equations Processes in statistics
G Utility:
Matrix: rectangular array of numbers, considered as a single object Vectors & Matrices: very compact, elegant and powerful shorthand Enabling: simplified analysis and effective modelling of systems Highly suitable for computer implementation
Md3
Matrix Notation
elements row
2 5
0.4 32
8 , 0
6 1,
[a1
a2
a3 ],
a c
b , d
ex 2x e
3x x2
column
column vector
row vector
square matrices
[ ]
a11 a 21 = . a m1
a12 a22 . am 2
m n matrix A = a jk , m rows and n columns double subscript notation, a jk , row j and column k square matrix when m = n, main diagonal elements aii
[ ]
Md4
G Matrix transposition:
5 4 5 8 1 T A = [a jk ], AT = [akj ], e.g. A = , A = 8 0 4 0 0 1 0
Md5
Matrix Addition
A+B only defined for matrices A, B of the same size A+B obtained by adding corresponding elements.
G Matrix Addition:
5 1 0 1 5 3 4 6 3 , , A= B = A B + = 3 1 0 3 2 2 0 1 2
G Addition Properties:
For matrices of the same size ( m n) : A + B = B + A (commutativity) (U + V ) + W = U + (V + W ) = U + V + W A+0 = A A + ( A) = 0 (identity for addition) (additive inverse) (associativity)
Md6
G Definition:
Scalar Multiplication
Product of m n matrix A = [a jk ] and scalar c is m n matrix : cA = [ca jk ] obtained by multiplying each element in A by c.
G Properties:
c( A + B) = cA + cB (c + k ) A = cA + kA
(scalar multiplication)
Md7
G Definition:
Matrix Multiplication
Product C = AB of m n matrix A = [a jl ] and n p matrix B = [ b lk ] is : m p matrix C = [c jk ] with elements : c jk = a jl b lk = a j1b1k + a j2 b 2 k + ... + a jn b nk ; j = 1,..., m; k = 1,..., p
l =1 n
i.e. jk
th
element of C is :
Matrix multiplication is not commutative, AB BA in general AB = 0 does not necessarily imply A = 0 or B = 0 or BA = 0 AC = AD does not necessarily imply C = D (even when A 0)
Md8
mn
n p
c1k c2 k . c jk . . . cmk
c1 p c2 p . c jp . . . cmp
m p
Md9
G Properties:
(scalar k )
(distributivity)
Md10
G Triangular Matrices:
Special Matrices
Upper triangular matrices (zero entries below diagonal) Lower triangular matrices (zero entries above diagonal)
G Diagonal Matrices:
Non - zero entries only on the main diagonal A Scalar matrix is a diagonal matrix with all diagonal elements equal : For any square matrix A and Scalar matrix S : AS = SA = cA Identity matrix I is a Scalar matrix with diagonal elements = 1.
Md11
a b = [a 1
C m p = A m n Bn p
Md12
G Linear Transformations:
G Composite Transformation:
Md13
0 0.5 750 1.0 1.0 0.75 0 300 600 400 = 750 0 0.5 1.0 900 1.5 1.0 0.5 1300
Cost per PC, A; Production in year 2000, B PC1 PC2 Quarters (1 4) Quarters (1 4) Raw 0.3 0.5 2.2 1.8 1.6 1.9 PC1 4 1 2 3 C = AB = Lab 0.8 1.3 = 5.8 4.7 4.2 5.0 PC2 2 3 2 2 Misc 0.7 0.9 4.6 3.4 3.2 3.9
Md14
Applications (continued)
% To
Res 30 0.8 0.1 0.1 transition probs x = Com 20 , Transition matrix, A = From 0.1 0.7 0.2 for 5 - year 50 Ind intervals 0 0.1 0.9 x is 1998 % land use in city of 50 sq miles. Find states in 2003, 2008 & 2013
0.8 0.1 0.1 y = x A = [30 20 50] 0.1 0.7 0.2 = [26 22 52] 0 0.1 0.9
T T
Md15
Rotation Matrices
x1 y1 cos sin Let A = , x = , y = sin cos x 2 y 2 Then, y = Ax represents a counterclockwise rotation of the cartesian x1x 2 coordinate system in the plane about the origin. is the angle of rotation. y1 = x1 cos x 2 sin
x2 y2 x2cos y2 x2 x2 x1 y1 x1 x1cos P: (y1, y2) P: (x1, x 2) y1 x1sin x1 x2sin
y 2 = x1 sin + x 2 cos whence, y = Ax cos 2 sin 2 A2 = sin 2 cos 2 cos n sin n An = sin n cos n
Md16
G
Linear System:
Matrix Form:
Ax = b
... a1n ... a 2 n , ... . ... a mn
a11 a12 a a 22 21 A= . . a m1 a m 2
x1 a11 b1 x 2 a b 2 = 21 x = . , b = ; A . . . a bm m1 x n
b1 b2 . bm
Md17
G
Geometric Interpretation
( x1 , x2 ) a11 x1 + a12 x2 = b1 a21 x1 + a22 x2 = b2
Each equation represents a straight line in the plane
Md18
G
Gauss Elimination
Equations
Augmented Matrix A
x3 = 0 = 80
Pivot 1
x1 x2 + x3 = 0 x1 + x2 10 x2 + 25 x3 = 90 20 x1 + 10 x2
Eliminate
1 1 1 1 1 1 0 10 25 20 10 0
0 0 90 80
Elimination of: x1
x1 x2 +
x3 = 0 0=0
10 x2 + 25 x3 = 90 30 x2 20 x3 = 80
1 1 1 0 0 0 0 10 25 0 30 20
0 0 90 80
Row 2 + Row 1
Row 4 - 20 Row 1
Md19
G
Gauss Elimination - 2
x1 x2 + x3 = 0
Partial pivoting:
Pivot 10 Eliminate
10 x2 + 25 x3 = 90 30 x2 20 x3 = 80 0=0
1 1 1 0 10 25 0 30 20 0 0 0
0 90 80 0
Elimination of: x2
x1 x2 +
x3 = 0
10 x2 + 25 x3 = 90 95 x3 = 190 0=0
1 1 1 0 10 25 0 0 95 0 0 0
0 90 190 0
Row 3 - 3 Row 2
Md20
G
Gauss Elimination - 3
Back substitution:
95 x3 = 190 10 x2 + 25 x3 = 90 x1 x2 +
G
x3 = 0
x1 2 x1 = 2, x2 = 4, x3 = 2; x = x2 = 4 . 2 x3
Md21
G
Row-equivalent Systems:
A linear system S1 is row-equivalent to linear system S2 if S1 can be obtained from S2 by finitely many elementary row operations. Row-equivalent linear systems have the same sets of solutions. Whence justification for Gauss elimination procedure.
Md22
G
r2 - 0.2*r 1 r3 - 0.4*r 1
x2 = 1 x3 + 4 x4 , where x3 , x4 arbitrary
r3 + r 1
x1 = (8 2 x2 2 x3 + 5 x4 ) / 3 = 2 x4
1 1 2 2 3 1 1 6 1 3 4 4
1 1 2 2 2 7 12 r2 + 3*r1 0 r3 - r1 0 2 2 2
2 1 1 2 0 2 7 12 r3 - r2 0 0 5 10
Back Subst.
x3 = 2, x2 = 1, x1 = 1
Md23
G
No solution exists
3 2 1 3 2 1 1 0 r2 2 3 r1 6 2 4 6 r3 2r1 3 2 1 3 0 1 1 2 3 3 0 2 2 0 r3 6r2 3 2 0 1 3 0 0 1
1 3
3 2 0 12
Inconsistency
The last row effectively asserts that 0 = 12
Md24
G
Echelon Form
a11 x1 + a12 x2 + .......... + a1n xn = b1 c22 x2 + .......... + c2 n xn = b 2 ... krr xr + ... + krn xn = b r 0=b r +1 ... 0=b m where r m ( and a11 0, c22 0, ..., krr 0).
, ... , b 0 (a) No solution if r < m and one of b r +1 m , ... , b = 0 (if present) (b) Precisely one solution if r = n and b r +1 m , ... , b = 0 (if present) (c) Infinitely many solutions if r < n and b r +1 m