140 likes | 292 Views
Linear Algebra & Matrices. MfD 2004 María Asunción Fernández Seara mfseara@fil.ion.ucl.ac.uk January 21 st , 2004 “The beginnings of matrices and determinants go back to the second century BC although traces can be seen back to the fourth century BC”.
E N D
Linear Algebra & Matrices MfD 2004 María Asunción Fernández Seara mfseara@fil.ion.ucl.ac.uk January 21st, 2004 “The beginnings of matrices and determinants go back to the second century BC although traces can be seen back to the fourth century BC”
Vector: variable described by magnitude and direction Column vector Row vector • Matrix: rectangular array of scalars 2 3 Square (3 x 3) Rectangular (3 x 2) d i j : ith row, jth column Scalars, Vectors and Matrices • Scalar: variable described by a single number (magnitude) • Temperature = 20 °C • Density = 1 g.cm-3 • Image intensity (pixel value) = 2546 a. u.
column → row row →column • Outer product = matrix Vector Operations • Transpose operator
Length of a vector Right-angle triangle Pythagoras’ theorem || x || = (x12+ x22 )1/2 || x || = (x12+ x22 + x32 )1/2 Inner product of a vector with itself = (vector length)2 xTx =x12+ x22 +x32 = (|| x ||)2 x2 ||x|| x1 Vector Operations • Inner product = scalar
||x|| ||y|| b y2 q y1 x =/2 Orthogonal vectors: xTy = 0 y Vector Operations • Angle between two vectors
Matrix Operations • Addition (matrix of same size) • Commutative: A+B=B+A • Associative: (A+B)+C=A+(B+C)
Matrix Operations • Multiplication (number of columns in first matrix = number of rows in second) • Associative: (A B) C = A (B C) • Distributive: A (B+C) = A B + A C • Not commutative: AB BA !!! • (A B)T = BT AT Cij = inner product between ith row in A and jth column in B C = AB (m x p) = (m x n) (n x p) 2 x 33 x 22 x 2
Some Definitions … • Identity Matrix • Diagonal Matrix • Symmetric Matrix I A = A I = A B = BT bij = bji
Matrix Inverse A-1 A = A-1 A = I Properties A-1 only exists if A is square (n x n) If A-1 exists then A is non-singular (invertible) (A B) -1 = B-1 A-1;B-1 A-1 A B = B-1 B = I (AT) -1 = (A-1)T;(A-1)T AT = (A A-1)T= I
Matrix Determinant det (A) = ad - bc A (n x n) = [a ij ] Properties Determinants are defined only for square matrices If det(A) = 0, A is singular, A-1 does not exist If det(A) 0, A is non-singular, A-1 exists http://mathworld.wolfram.com/Determinant.html
Matrix Inverse - Calculations A general matrix can be inverted using methods such as the Gauss-Jordan elimination, Gauss elimination or LU decomposition
A A-1 y A z x Another Way of Looking at Matrices… • Matrix: linear transformation between two vector spaces A x = y A-1 y = x det(A) = 1 x 4 – 2 x 2 = 0 In this case, A is singular, A-1 does not exist
Linearly independent Linearly dependent Other matrix definitions • Orthogonal matrix A = [q1 | q2 | … qj …| qn] qjT qq = 0 (if j k) and qjT qj = djj AT A = D • Orthonormal matrix A = [q1 | q2 | … qj …| qn] qjT qq = 0 (if j k) and qjT qj = 1 AT A = I A-1 = AT • Matrix rank: number of linearly independent columns or rows if rank of A (n x n) = n, then A is non-singular