MATH3341_LinearAlgebra
MATH3341_LinearAlgebra
x1 price of 1 sheaf
= of good wheat 3x1 + 2 x2 + x3 39
x2 price of 1 sheaf of mediocre
= wheat → 2 x1 + 3x2 + x3 34
x3 price of 1 sheaf of
= bad wheat x1 + 2 x2 + 3x3 26
3 2 1 x1 39
Matrix Form: Ax=b → 2 3 1 x = 34
2
1 2 3 x 26
3
A is a 3x 3 matrix
xb, are 3x1 column vectors (bold font indicates a matrix or vector)
Matrix Multiplication (Motivation)
A primary motivation for our definition of matrix multiplication comes from the desire to express
coupled linear equations as the product of a matrix A times a vector x:
3x1 + 2 x2 + x3 =
39 3 2 1 x1 39
2 3 1 x 34
2 x1 + 3x2 + x3 34
= 2 {x1 , x2 , x3} are the "unknowns"
x1 + 2 x2 + 3x3 =
26 1 2 3 x3 26
A x b
3x3 3 x1 3 x1
For example, the 2nd entry 34 of the vector b is obtained by taking the
"inner product" (dot product) of the 2nd row of the matrix A with the column vector x
x1
(2 3 1) x2 = (2 )( x1 ) + ( 3)( x2 ) + (1) ( x3 ) = 34
x
3
= iff ( A )ij
A B= ( B )ij
Examples
−1 2 1 2
3 4 ≠ 3 4 (upper left entries on main diagonal unequal)
−5 6 −5 6
1 2 3 4
3 4 ≠ 1 2 (unequal despite containing the same set of 4 numbers)
Basic Algebra of Matrices
Matrix multiplication is defined such that this coupled system of linear equations (first powers in x j ) can be written
a11 a12 a13 a1n x1
a x b1
21 a22 a23 a2n 2 b
a31 a32 a33 a3n x3 = 2 ( m x n )( n x 1) → ( m x 1)
b
a am3 amn x m
m1 am2
n
b
A x mx1
mxn nx1 vector
matrix vector
Def: This system of equations is called a linear system because the matrix A satisfies the properties of a linear operator.
Regard the matrix as a mapping from one Euclidean space to another: A : n m
Linearity: (1) A(x + y ) = Ax + Ay for any x , y ∈ n (2) A ( cx ) = cAx for any scalar (constant) c
Loosely speaking, this system is linear because the unknowns x j appear only as first powers.
Def: (Homogeneous vs. Inhomogeneous)
= The system Ax b is called inhomogeneous if b ≠ 0 and
homogeneous if b = 0.
Matrix Multiplication (2)
Number of columns in A =
Number of rows in B
b1k
b
Aj∗B∗k = ( a j1 a j 2 a jn ) 2k → (1 x n )( n x 1) =
(1 x 1) scalar =
c jk
bnk
You should recognize this as the dot product introduced to you in earlier courses, usually written in the form
a j1 b1k
a
b
c jk = Aj∗ ⋅ B∗k = ⋅ 2k= a j1b1k + a j 2b2k + + a jnbnk
j2
(dot product)
a j 2 bnk
The dot product can therefore be viewed as the matrix product of a row vector (on the left)
with a column vector (on the right).
In more standard notation, if u ,v ∈ n are column vectors, then
v1
v n
T
u ⋅ v= u v= (u1 u2 un ) 2 = ∑u v i i where uT is the transpose of u (see later slides)
i =1
vn
Matrix Multiplication Examples
Matrix Multiplication (4)
Column View of Matrix Multiplication
An alternative view of matrix multiplication is as follows.
( m x n ) and B =
Let A = ( n x p ). Define B∗k ∈ n to be the k th column of B (k =
1,..., p).
| | | | | | | |
B
AB A= AB AB∗ p ≡ C
∗1 B∗2 B∗k B∗ p ∗1 AB∗2 AB∗k
| | | | | | | |
Thus the k th column of B is the matrix product AB∗k ∈ n .
Notation Comment: Kreyszig denotes the k th column of B as bk (also standard, but ambiguous).
Example: Commuting Matrices Note: The identity matrix I always commutes with any other matrix
IA
= AI
= A
1 0 0 2 4 0
A =0 1 0 B 3 1 0 1 0 a11 a12 a11 a12 1 0 a11 a12
1 0 2 −1 −4 1 = a
0 1 a22 = 0 1
a21 a22 a a22
21
21
2 4 0 2 4 0 IA IA A
AB =A 3 A 1 A 0 3 1 0
−1 −4 1 0 −4 2
1 0 0 2 4 0
BA =B 0 B 1 B 0 3 1 0
1 0 2 0 −4 2
∴ AB = BA
Algebra of Matrix Multiplication
Matrix Transpose
Def: The Transpose of an m x n matrix A is an n x m matrix AT given by switching the identity
of the rows and the columns of A, i.e. row 1 of AT is column 1 of A, row 2 of AT is column 2 of A, etc.
( A ) = ( A)
T
ij ji
row i , column j entry of AT =row j , column i entry of A
Examples
−1 3 0
1 2 3
A = A 0= 0 1 A (1 2 3 )
4 5 6
8 9 2
1 4 −1 0 8 1
AT = 2 5 AT 3= 0 9 AT 2
3 6 0 1 2 3
y a a12 x1 a x + a x
y =Ax ↔ 1 = 11 = 11 1 12 2 A transforms x into y
y2 a21 a22
x2 a21 x1 + a22 x2
Question: Is there a single matrix C that relates y to w directly?
Answer: YES. y Cw
= = ABw provided we define matrix multiplication as we have!
−1 2 3 −1 2 3
A 2 5 8 →
= A 2
T
5 8 = A (symmetric)
3 8 6 3 8 6
1 0 0 1 2 3
A 2 1 0 → =AT 0 1 0 ≠ A (non-symmetric)
3 0 0 0 0 0
−1 0 0 1 0 0 0 0 0
D =0 5 0 I =
0 1 0 0 0 0 0
(diagonal)
0 0 6 0 0 1 0 0 0
1 0 0 0 0 3
A =2 1 0 B 0 1 0
(non diagonal)
0 0 0 0 0 0
A square diagonal matrix D always commutes with other square matrices A of the same dimension.
This calculation can easily be generalized for square matrices of any dimension.
Solving Linear Systems of Equations
Gaussian Elimination
Section 7.3 Kreyszig
ODE example leading to a linear algebraic system
An example of how Ax = b arises in practice is in the solution of a boundary value problem (ODE)
d2x
ODE: b(t ), solve for x(t ) over t ∈[ 0,1] , b(t ) some twice-differentiable function
dt 2
BCs: = x(0) 0,= x(1) 0 (boundary conditions)
k
Discretize time into n + 1 equal intervals of length ∆t: = tk ≡ k∆t = ( k 0,1, , n + 1)
n+1
( x1 x2 xn ) (tk ) , bk b (tk )
T
Solve
= for x where
= xk x=
d2x x − 2 xk + xk −1
2 ( k)
Use the 2nd − order accurate central difference discretization for t ≈ k +1
dt ∆t 2
d2x 1
k 1:
= 2 ( 1)
t= ( x0 − 2 x1 + x=
2) b1 (=
x0 0 )
dt ∆t 2
d2x 1
k 2:
= 2 ( 2)
t= ( x1 − 2 x2 + x=
3) b2
dt ∆t 2
d2x 1
:
k n=
dt 2 ( n)
t
∆t 2
( xn−1 − 2 xn + xn+1 ) = bn (x n +1 = 0 since xn+1 = x ( tn+1 ) = x(1) = 0 )
Gaussian Elimination involves elementary row operations on the matrix A that reduces the system
to the upper triangular form
′ x1 + a12
a11 ′ x2 + + a1′ n xn =
b1′
′ x2 + + a2′ n x=
a22 n b2′ = b′
→ Ux
=
′ xn = bm′
amn
bm′
Then solve by back substitution xn = etc.
′
amn
a11 a12 x1 b1
a a x = b
21 22 2 2
form the augmented matrix A = ( A|b ) , so that whatever algebraic manipulations you do
on the LHS of the equation are also done to the RHS:
Example
Ax = b
0 −2 x1 5
0 −2 5
1 2 x = 3 → A
=
2 1 2 3
4
The bottom equation for x2 is uncoupled to the x1 variable, so solve for x2 = = −2
−2
Then "back substitute" for x2 = −2 into the equation immediately above the lowest equation:
7
2 x1 + 3 ( −2=
) 1 → 2 x1= 7 → x1=
2
7
x1
The final solution is =x = 2
x
2 −2
Gaussian Elimination and Row Operations: A Simple Example
The system of equations now has an associated lower triangular matrix and can now easily be solved:
x2 = −2
12
2 x1 + 5 ( −2 ) = 2 → x1 = = 6
2 Important Point: Row operations do not change
the solution space x
x 6
∴ x= 1 =
x2 −2
Row Operations and Row Equivalent Systems
Elementary matrices: n × n square matrices Suppose A is an n × n matrix. Elementary matrices E that effect a row
operation can be constructed by making one modification to the n × n identity matrix I . Here we demonstrate the form
of E for 3 × 3 matrices.
0 0 1
(a) Row Interchange
= : E 0 1 0 → EA results in the matrix A with rows 1 and 3 interchanged.
1 0 0
E is formed by exchanging rows 1 and 3 of the identity matrix I .
For the general n × n case, exchanging rows i, j of the identity matrix I produces an elementary matrix E such that
EA is the matrix A with rows i and j interchanged.
0 0 1 1 −2 4 4 3 3
Examples: EA 0
= 1 08 2 = −2 8 2 −2 ( rows 1,3 exchanged )
1 0 0 4 3 3 1 −2 4
0 1 0 1 −2 4 8 2 −2
= EA 1 0 0 8 2 −= 2 1 −2 4 ( rows 1, 2 exchanged )
0 0 1 4 3 3 4 3 3
Elementary Matrices (2)
1 0 0
(b) Multiplying a row by a= scalar: E 0 k 0 → EA results in the matrix A with row 2 multiplied by k .
0 0 1
E is formed by multiplying row 2 of the identity matrix I by k .
For the general n × n case, multiplying row i of the identity matrix I by k produces an elementary matrix E such that
EA is the matrix A with row i multiplied by k .
1 0 0 1 −2 4 1 −2 4
Example: EA = 0 4 0 8 2 =−2 32 8 −8 ( row 2 multiplied=
by k 4)
0 0 1 4 3 3 4 3 3
1 0 0
(c) Adding a multiple of one row to another
= : E 0 1 0 → EA adds k times row 1 of A to row 3 of A.
k 0 1
E is formed by placing the multiplicative factor k in entry ( 3,1) of I → ( I )31 =
k.
For the general n × n case, placing the factor k in the off-diagonal entry ( i, j ) , i ≠ j , of the identity matrix I
produces an elementary matrix E such that EA is the matrix A with k × ( row j ) added to row i.
1 0 0 1 −2 4 1 −2 4
Example:=
EA 0 1 0 8 2 =−2 8 2 −2 ( 2 ∗ ( row 2 ) added to row 3)
0 2 1 4 3 3 20 7 −1
Overdetermined and Underdetermined Systems
Consider Ax = b where A is m x n
Def: Ax b is an overdetermined system if m > n
This means more equations than variables and usually is inconsistent (no solutions)
Example (=
m 2,= n 1) x1 0
= → No solution!
x1 = 1
Def: Ax b is an underdetermined system if m < n
This means fewer equations than variables and usually leads to an infinite number of solutions
Example (m = 1, n =
2) x1 + x2 =0 → x1 = − x2
x1 − x2 −1
Infinite number of solutions of the form= x = = x2 1
x
2 2 x
There are an infinite number of solutions since x2 is an arbitrary scalar
Pivot variables: The first non-zero entry in each row of U is called a pivot. The components of x in the
matrix multiplication Ax that multiply the pivots are called the pivot variables. In the previous example the pivot
variables are {x1 , x2 }.
Free variables: The non-pivot components of x are called free variables ({ x3 , x4 } in the previous example). Any
consistent linear system Ax =b → Ux =b′ with 1 or more free variables will have an infinite number of solutions owing
to an infinite number of solutions to the associated homogeneous equation Ax = 0.
General solution: Write the pivot variables in terms of the free variables to form the general solution vector
x = ( x1 , x2 , , xn ) .
T
Pivots and free variables: previous example revisited
Previous Example
After row reducing Ax = b to the (consistent) upper triangular form
x1
3 2 2 −5 8
x2
0 1 1 −4 x = 1
0 0 0 0 3 0
x
4
we solve for the pivot variables { x1 , x2 } in terms of the free variables { x3 , x4 } :
x2 =− x3 + 4 x 4 + 1
3x1 + 2 x2 =
−2 x3 + 5x4 + 8 → (substitute for x2 using above eqn)
x1 =− x4 + 2
Since x3 and x4 are arbitrary, this linear system has an infinite number of solutions.
Gaussian Elimination Example: Inconsistent System
Gaussian Elimination Example: Unique Solution (square system)
Gaussian Elimination Example: Unique Solution (square system)
Gaussian Elimination Example: Unique Solution (square system)
2 × 2 matrices
a b a b
Def: The determinant of a 2 × 2 matrix A = is det ( A ) = ad − bc
=
c d c d
1 2
Example = (1)( 4 ) − ( 2 )( 3) =
−2
3 4
As we will discuss, because det ( A ) ≠ 0 the matrix A is invertible, and solutions to any linear algebraic system are unique:
1 d −b 1 4 −2
Ax = A−1b
b → x= where A−1 = . In this example A −1
=
− .
det ( A ) −c a 2 −3 1
2 −1
Example A= → det = ( A ) ( 2 )(1) − ( −1)(=
−2 ) 0
−2 1
For this matrix A−1 does not exist, and any linear system Ax = b either has no solutions or an infinite # of solutions.
Note also that row reducing this matrix (row 2 → row 2 + row 1) yields
2 −1 2 −1
A= → , so Ax b is consistent
= only if the RHS vector satisfies b1 + b2 0.
−2 1 0 0
Cofactor Expansions
The determinant of a general n × n matrix A can be computed by the method of cofactor expansions.
Theorem The determinant of any n × n matrix A is given by either of the following formulas:
n n
(a) det ( A ) ∑ a C ≡ ∑ ( −1)
i+ j
=ij ij aij M ij (cofactor expansion along row i )
=j 1 =j 1
n n
(b) det ( A ) ∑ a C ≡ ∑ ( −1)
i+ j
=ij ij aij M ij (cofactor expansion along column j )
=i 1 =i 1
( −1)
i+ j
where Cij = M ij (the cofactor of entry aij ), and M ij (the minor of entry aij ) is the determinant of
the matrix formed by deleting row i and column j.
3 2 1
Example A = 1 2 3 . Compute the cofactors C11 , C21 , and C32 .
0 1 0
3 2 1
2 3
( −1) M 11 = ( −1) 1 2 3 ==
1+1 2
C11 = −3
1 0
0 1 0
3 2 1
2 1
( −1) ( −1) 1
2 +1 3
C21 = M 21 = 2 3 =
− 1
=
1 0
0 1 0
3 2 1
3 1
( −1) M 32 =
( −1) 1
3+ 2 5
C32 = 2 3 =
− −8
=
1 3
0 1 0
3x3 Determinants
a11 a12 a13
Example A = a21 a22 a23 . Compute det ( A ) using cofactor expansions along row 1 and column 3.
a a32 a33
31
a a a a23 a a22
det ( A ) =
( −1) a11 22 23 + ( −1) a12 21 + ( −1) a13 21
1+1 1+ 2 1+ 3
Remember that you will get the same result for det ( A ) using a cofactor expansion along any row or column.
Determinant Example
3 2 1
Example A = 1 2 3 . Compute det ( A ) using cofactor expansions along row 1 and row 3.
0 1 0
2 3 1 3 1 2
det ( A ) = ( −1) ( 3) + ( −1) ( 2) + ( −1) (1)
1+1 1+ 2 1+ 3
1 0 0 0 0 1
=( 3)( 0 − 3) − ( 2 )( 0 − 0 ) + (1)(1 − 0 ) =−8
∴ det ( A ) =
−8
2 1 3 1 3 2
det ( A ) = ( −1) ( 0) + ( −1) (1) + ( −1) ( 0)
3+1 3+ 2 3+ 3
2 3 1 3 1 2
=0 − 8 + 0 =−8
Observe that a cofactor expansion along row 3 is simpler to calculate because all but one of the entries are zero.
Theorems about the Determinant (1)
Theorem The determinant of an n × n diagonal, lower triangular, or upper triangular matrix A
n
( A)
is the product of its diagonal entries: det= ∏
= a
i =1
ii a11a22 ann
Examples
−3 0 0 0
0 2 0 0
=( −3)( 2 )(1)( −1) =6
0 0 1 0
0 0 0 −1
3 0 0
−9 8 0 =( 3)(8)( −1) =−24
3 4 −1
3 4 −9
0 =
6 −3 ( 3)(=
6 )( 2 ) 36
0 0 2
Theorems about the Determinant (2)
Theorem Let A′ denote the matrix resulting from an elementary row operation on an n × n matrix A.
Elementary row operations have the following effect on det ( A ) :
(a) det ( A ) =det ( A′ ) if a multiple of one row is added to another (determinant is invariant to this operation).
(b) det ( A ) k det ( A′ ) if a single row or column is multiplied by a scalar k ≠ 0.
(c) det ( A ) = −det ( A′ ) if any two rows or columns are interchanged.
Comment: With this theorem you can use row reduction to compute det ( A ) .
1 2
Example A = . Calculate det ( A ) by row reducing A to an upper triangular matrix.
3 4
Solution: Subtracting 3 ( row 1) from row 2 does not alter the determinant:
1 2 1 2
=A A′
→ = det ( A′ ) = det ( A )
3 4 0 −2
This answer can be verified directly using the well-known formula for 2 × 2 matrices:
1 2
(1)( 4 ) − ( 2 )( 3) =
= −2
3 4
Example: Determinant by Row Reduction
3 2 1
Example A = 1 2 3 . Compute det ( A ) using elementary row operations.
0 1 0
Solution: Begin by interchanging rows 2 and 3
3 2 1 3 2 1
A= 1 2 3 → A′ = 0 1 0 det ( A′ ) = −det ( A )
0 1 0 1 2 3
1
Subtract ( row 1) from row 3
3
3 2 1 3 2 1
A′ = 0 1 0 → A′′ = 0 1 0 det ( A′′ ) = det ( A′ ) =−det ( A )
1 2 3 4 8
0
3 3
4
Subtract ( row 2 ) from row 3
3
3 2 1 3 2 1
A′′ 0 1 0 = → A′′′ 0 1 0 det
= ( A′′′) det ( A′′) = −det ( A )
4 8 8
0 0 0
3 3 3
8
∴ det ( A ) =−det ( A′′′ ) =− ( 3)(1) = −8
3
Matrix Inverses
Def: An n × n square matrix A is invertible if there exists another n × n matrix A−1 such that
−1 −1
A= A AA= I,
where I In is the n × n identity matrix.
Theorem If a square matrix is invertible, then A−1 is unique.
Proof: (proof by contradiction) Suppose A has two inverses A1 , A2 , with A1 ≠ A2 . It follows that
A1 A and AA2 I
I= (now multiply second equation on the left by A1 )
→ A1 AA2 =
A1 I =
A1 (now use the fact that A1 A =
I)
→ IA2 = A1 → A2 = A1
This contradicts our assumption that A1 ≠ A2 . We conclude that A1 = A2 .
a b
Theorem (Inverse of 2 × 2 matrix) If A = and det ( A ) ≠ 0, then
c d
1 d −b 1 d −b
A−1 = = .
ad − bc −c a det ( A ) −c a
Proof: Follows from direct verification that A−1 A = I and the previous uniqueness theorem.
Examples
−1
2 3 1 1 −3
=
−2 1 82 2
−1
2 4 2 4
does not exist since =0 ( note that the columns are linearly dependent )
1 2 1 2
Inverses of Elementary Matrices (1)
Theorem Every square elementary matrix E is invertible, and E −1 is also an elementary matrix.
Rather than proving this theorem, we will demonstrate it for the case of 3 × 3 elementary matrices.
Suppose A is an n × n matrix, so that every elementary matrix E operating on A is also n × n.
0 0 1 1 −2 4 4 3 3
Example: EA 0
= 1 08 2 = −2 8 2 −2 ( rows 1,3 exchanged )
1 0 0 4 3 3 1 −2 4
0 1 00 1 0 1 0 0 0 1 0
= E2 1 0=01 0 0 0 1 0 =I → E −1 =E = 1 0 0
0 0 1 0 0 1 0 0 1 0 0 1
(b) Multiplying a row by a scalar: Suppose the elementary matrix E multiplies row 2 of a matrix A by a scalar k ≠ 0:
1 0 0
1 0 0
1
E 0 k 0
= → E −1 0
= 0
0 0 1 k
0 0 1
For the general n × n case, the inverse E −1 is formed by taking the reciprocal of each diagonal entry. More specifically,
1
by replacing the diagonal entry k by .
k
Inverses of Elementary Matrices (2)
(c) Adding a multiple of one row to another: Suppose the elementary matrix E adds 3 × ( row 1) to row 2 of A:
1 0 0 1 0 0
3 1
E= 0 → E −1 =
− 3 1 0
0 0 1 0 0 1
Observe that if you add k times one row to another, the operation is reversed by subtracting k times that same row.
For the general n × n case, the inverse E −1 is formed by negating the off-diagonal entry. Specifically, for i ≠ j , if
E is an elementary matrix that effects the adding of k × ( row j ) to row i then
( E )ij =
k → (E )
−1
ij
−k
=
Theorem For any square matrix A the following statements imply one another (if one is true then all are true):
(a) A−1 exists
(b) det ( A ) ≠ 0
(c) The homogeneous equation Ax = 0 has only the trivial solution x = A−1 0 = 0.
(d) The inhomogeneous equation Ax = b has the unique solution x = A−1b.
(e) The reduced row-echelon form R of A is the identity matrix, i.e. elementary row operations
reduce A to R = I.
{ Ei }i =1
r
(f) There exists a sequence of elementary matrices such that Er Er −1 E1 A = I , and thus
A−1 = Er Er −1 E1
(g) The matrix A can be written as a product of elementary matrices: A = E1−1 Er−−11 Er−1
Matrix Inverses by Gauss-Jordan elimination
Based on the previous theorem, if A−1 exists then we can multiply A by a sequence of elementary matrices such that
Er Er −1 E1 A = I .
Since A−1 is unique, this tells us that A−1 = Er Er −1 E1.
Multiplying the above equation for A−1 by the identity matrix gives
A−1 = Er Er −1 E1 I ,
which tells us that applying the same sequence of row operations on I that reduces A to the identity matrix
results in A−1.
3 0 −3 1 0 0
Begin with the augmented matrix A = ( A | I ) = −6 1 3 0 1 0
3 0 −2 0 0 1
3 0 −3 1 0 0 1 0 0
( E1 A | E1 I ) =
0 1 −3 2 1 0 , E 1 = 2 1 0 row 2 → row 2 + 2 ( row 1)
3 0 −2 0 0 1 0 0 1
3 0 −3 1 0 0 1 0 0
( E2 E1 A | E2 E1 I ) = 0 1 −3 2 1 0 , E2 =
0 1 0
row 3 → row 3 − ( row 1)
0 0 1 −1 0 1 −1 0 1
1 1
1 0 − 1 0 0 0 0
3 3
1
( E3 E2 E1 A | E3 E2 E1 I ) =
0 1 −3 2 1 0 , E 3 =
0 1 0 row 1 → ( row 1) (cont. next slide)
0 0 1 −1 0 1 0 0 1 3
Matrix Inverse Example (2)
Example (cont.)
2
1 0 0 − 3 0 1 1 0 1
( E4 E3 E2 E1 A | E4 E3 E2 E1 I )= 0 1 −3 2 1 0 , E4 = 0 1 0 row 1 → row 1 + row 3
0 0 1 −1 0 1 0 0 1
2
1 0 0 − 3 0 1 1 0 0
( E5 E4 E3 E2 E1 A | E5 E4 E3 E2 E1 I ) =
0 1 0 −1 1 3 , E5 =
0 1 3 row 2 → row 2 + 3 ( row 3)
0 0 1 −1 0 1 0 0 1
The inverse A−1 is given by the product of these elementary matrices (verify for yourselves), which you
will see agrees with the right half of the augmented matrix above after row-reducing A to I :
2
− 3 0 1
A−1= E5 E4 E3 E2 E1= −1 1 3
−1 0 1
Linear Independence, Matrix Rank, Basis
Sections 7.4, 7.9 Kreyszig
Linear Independence of Vectors
Def: A collection of vectors {v1 , v2 , , vn } in a vector space V is linearly dependent if there exists a set of scalars,
{c1 ,c2 , ,cn } , not all zero, such that
c1v1 + c2v2 + + cnvn =
0
If the only solution is the trivial solution= ( k 1, ,n) , then the vectors are linearly independent.
ck 0=
Example 2:
1 −1 −3
The vectors {v1 , v2 , v3} = 2 , 3 , 4 are linearly dependent in 3 since
3 1 −1
v1 − 2v2 + v3 = 0
Linear Independence Test
Matrix formulation of linear independence test
Observe that the defining equation for the test for linear dependence
c1v1 + c2v2 + + cnvn = 0
is equivalent to the linear system
= Ac 0 , where vk ∈ m is the k th column of the m × n matrix A.
| | | c1 0
v v v =
1 2 n
| | | c 0
n
In this view, the collection of vectors {v1 , v2 , , vn } with vk ∈ m is linearly dependent if the
m × n linear system Ac 0 has a nontrivial solution c ≠ 0.
The linear independence test in matrix form, with each vk a column of the matrix A , is
1
0 −1 0
−1 c1
2 −1 0
Ac = 0 → c2 = ,
0
1 1 0
c3
1
0 1 0
which after row reductions becomes the homogeneous linear system
1 0 0 0
c
c1 0
0
1 0 1 0 c = 0 .
c = → 2
0 0 1 2 0 c 0
c 3
0 0 0 3 0
Example 2: Linear Independence
Example 2 : linearly independent vectors
The following set of vectors in V = 4 are linearly independent:
{v1 , v2 , v3} ={(1 2 2 1) , ( 2 −1 0 0 ) , (1 1 0 1) , ( 0 0 1 −1) . }
T T T T
Examples
9 0 −4
3 0 7 =0 since column 2 has all zero entries
−5 0 1
−1 3 2
0 4 8 = −2 ( row 1) → rows are linearly dependent
0 since row 3 =
2 −6 −4
Spanning Sets
Linear Combinations
Def: A linear combination of vectors {v1 , v2 , , vn } is any weighted sum of the form
c1v1 + c2v2 + + cnvn
for a set of scalars {c1 ,c2 , ,cn }.
Spanning Sets
Def: The collection of vectors S {v1 , v2 , , vn } is a spanning set for a vector space V if any vector v ∈V
can be expressed as a linear combination
v = c1v1 + c2v2 + + cnvn
for an appropriate set of scalars {c1 ,c2 , ,cn }. Any such set of vectors is said to span V .
Examples
(a) The standard (natural)
= basis E {e , e ,,=
1 2 e } spans V
n
n
= , where e 1 (1 0 0 ) , etc.
T
The set B = {b1 , b2 , , bn } will be a basis for the vector space V if it satisfies both of the following:
(1 ) The set B spans V
(2) The set B is linearly independent
A basis is a minimal spanning set
A basis B = {b1 , b2 , , bn } can be thought of a minimal spanning set for a vector space V in that it
contains the minimal number of vectors required to span V .
If the set B contained "superfluous" vectors, not necessary for the spanning property, then B would
be a linearly dependent set.
If the set B contained too few vectors (e.g. m vectors
= for V n with m < n) then it would not have
the spanning property.
Dimension
Def: The dimension of a vector space V , written as dim (V ) , is the number of vectors in any basis B = {b1 , , bn } , where n could be infinite.
Def: If dim (V ) = n is a finite number then V is a finite dimensional vector space. If dim (V ) = ∞ then V is an infinite dimensional vector space.
It can be shown that dim (V ) is a unique number (possibly infinity) for any vector space.
Examples: (i) dim ( m ) = m
| dk f
(ii) V = f ( x ) all derivatives k exist for x ∈ ( −∞ , ∞ ) → dim (V ) = ∞
dx
∞
f ( ) (0) k
k
∑
Functions f ( x ) ∈V will generally have a Maclaurin Series f ( x ) =
k =0 k!
x
You can think of the infinite set of monomials B = {1, x , x 2 ,} as a basis for this space.
Bases for Euclidean Vector Spaces
Example
= V m (m − dimensional Euclidean space)
Suppose S {v1 , , vn } is any collection of n vectors with each v k ∈ m . Let v k be the
k th column of an m × n matrix A.
Case 1: n < m
S cannot be a basis since span{S} ≠ m .
There will always be vectors b ∈ m such that Ax =
b has no solution, which means that
all possible linear combinations of the columns of A (the set S) cannot produce all possible b ∈ m .
To see this, note that the row-reduced matrix A → U (upper triangular) will always have at least
1 or more rows of zeros since there are more rows than columns. Therefore, some b can
always be chosen to make Ax = b inconsistent.
Case 2: n > m
S cannot a basis since S will necessarily be a linearly dependent set.
The linear independence test Ac = 0 will always involve 1 or more free variables in the
( c1 , , cn )
T
solution c , which means there is always some non-trivial set of weights
= c ≠ 0 such that
c1v1 + c2v2 + + cnvn = 0.
Case 3: n = m
S will be a basis if and only if det ( A ) ≠ 0. This means that S =
{v1 , , vn } is a linearly independent set.
If det ( A ) ≠ 0 then A−1 exists, and=
Ax b always has a unique solution
= x A−1b for all b ∈ m .
This means that span{S} = m .
S will then be a set that both spans m and is linearly independent, and thus a basis.
Four Fundamental Subspaces of a Matrix
Def: A subspace of a vector space V is a subset S ⊂ V that is also a vector space.
a11 a12 a1n
a a2n
Every m × n matrix A = 21 a22
aij = has 4 fundamental subspaces associated with it.
am1 am2 amn
Column Space R ( A ) Suppose A : n → m (i.e. A is m × n ) .
{y ∈ m | Ax =
R ( A) = y for some x ∈ n }.
R ( A ) is the span of the columns of A and is called the column space.
R ( AT ) =
{x ∈ n | AT y =
x for some y ∈ m }.
R ( AT ) is the span of the rows of A and is called the row space. It is equivalent to the span of the columns of AT .
Nullspace N ( A )
{x ∈ n | Ax =
N ( A) = 0}. This subspace is called the nullspace of the matrix A.
N ( A ) is the subspace of all vectors in the domain of A that map to the null vector 0 ∈ m .
Left Nullspace N ( AT )
N ( AT ) =
{y ∈ m | AT y =
0} =
{y ∈ m |y T A =
0}. This subspace is called the left nullspace of the matrix AT .
N ( AT ) is the subspace of all vectors in the domain of AT that map to the null vector 0 ∈ n .
Properties of the Four Fundamental Subspaces
{ }
The subspaces R ( A ) , R ( AT ) , N ( A ) , N ( AT ) are considered "fundamental" because the domain n and range m
of any m × n matrix, A : n m , can be decomposed in terms of them in the following sense:
Direct Sums
Def: A vector space V can be written as the direct sum V = V1 ⊕ V2 of subspaces, with V1 ∩ V2 = {0} , if every vector v ∈V
can be expressed uniquely as v =
v1 + v2 for some v1 ∈V1 and v2 ∈V2 (V1 and V2 have only the zero vector 0 in common).
This concept can be extended to direct sum decompositions of many subspaces {V1 , ,Vs } , where Vi ∩=
Vj {0} ( i ≠ j ) :
V = V1 ⊕ V2 ⊕ ⊕ Vs
if every v ∈V can be written uniquely as a linear combination v = v1 + v2 + + v s for some v1 ∈V1 , , v s ∈Vs .
Orthogonal Subspaces
Def: Two subspaces V1 ⊂ V and V2 ⊂ V of a vector space V are orthogonal (V1 ⊥ V2 ) if v1 ⊥ v2 ( v1 ⋅ v 2 =
0) for
every v1 ∈V1 and v2 ∈V2 .
Def: Two subspaces V1 ⊂ V and V2 ⊂ V of a vector space V are orthogonal complements
= if V1c V=
2 and V2
c
V1 .
Note that this implies V = V \ V1 ( the set containing everything in V not in V1 ) .
V1 ⊕ V2 since it follows that V2 =
Theorem: R ( A ) ⊥ N ( AT ) and R ( AT ) ⊥ N ( A ) .
R ( AT ) ⊕ N ( A ) where R ( AT ) =
c
(ii) m = N ( A)
This result is often called the Fundamental Theorem of Linear Algebra.
Rank of a Matrix
Finding R ( A ) and R ( AT )
To find bases for the column space R ( A ) and the row space R ( AT ) you perform elementary row operations
A → U until you achieve an upper triangular matrix U , or A → R (R =
reduced row echelon form).
1 u12 u1n
a11 a12 a1n
a a22 a2 n
0 0 1 u2n
=A 21 = → U 0 0 0 1 0 u3n
am1 am2 amn 0 0 0 0 0 umn
Identify the rows and columns with pivots (indicated by 1' s above).
A basis for R ( AT ) is the set of rows with pivots in either U or the corresponding rows of A.
A basis for R ( A ) is the set of columns of the original matrix A associated with pivots.
Finding N ( A ) and N ( AT )
A basis for N ( A ) is the set of vectors involved in the general solution to Ax = 0.
A basis for N ( AT ) is the set of vectors involved in the general solution to AT y = 0.
Rank
Def: The rank of a matrix A is defined by rank ( A ) = dim ( R ( A ) ) .
( )
Theorem: dim ( R ( A ) ) = dim R ( AT ) .
The rank of a matrix is the dimension of either the column space R ( A ) or the row space R ( AT ) , which
is determined by the number of pivots in the reduced row echelon form of A (or as determined by a
row reduction to an upper triangular form U).
Row Operations Change Span of Columns
Example
A simple matrix illustrates that elementary row operations change the span of the columns of the original
matrix A. Therefore, in general one cannot use a row-reduced matrix A U and the pivot columns of U as
as basis for R ( A ) .
Consider the matrix
1 1 1 1
=A = U (row 2 row 2 − 2[row 1])
2 2 0 0
dim ( R ( A ) ) dim
rank ( A ) 1, so there is 1 pivot and = = ( )
R ( AT ) 1
Row space: We can use the row with the pivot (row 1) of either A or U for a basis, since elementary row operations
do not alter the span of the rows of A (row 1 for A and U happen to be the same in this simple example). Observe that
R ( AT ) = span{(1 1)}
1 1
Column space: Note that the spans of the columns of A and U are different: R ( A ) = span ≠ span = R ( U )
2 0
One must use associated pivot columns of the original matrix A to construct a basis for the column space.
Alternatively, one could find a basis for R ( A ) using the row space basis for AT , since the columns of A become the
rows of AT .
Nullspaces: You can easily verify that the nullspaces of A are
1 2
N ( A ) span
= and N ( AT ) span
−1 −1
As an exercise check that R ( A ) ⊥ N ( AT ) and R ( AT ) ⊥ N ( A ) .
To do this, it is sufficient to show that all the basis vectors in these spaces are mutually orthogonal.
Example: Finding the Four Fundamental Subspaces
Example Find bases for the four fundamental subspaces of the following 3 × 4 matrix:
1 2 4 0
A= −3 1 5 2
−2 3 9 2
Elementary row operations lead to the reduced row echelon form
6 4
1 0 − −
1 2 4 0 7 7
A= −3 1 5 2
→ 0 1 17
R=
2
7 7
−2 3 9 2 0 0 0
0
Column and Row Spaces
Since there are two pivots (indicated by 1' s) we see that rank ( A ) = 2 , so the bases for the column
space and the row space each have 2 vectors:
1 2
R ( A ) span −3 , 1
= (columns of original A corresponding to columns of R with pivots)
−2 3
6 4 17 2
R ( AT ) span 1 0 −
= − , 0 1 = span{(1 2 4 0 ) , ( −3 1 5 2 )}
7 7 7 7
Example (continued)
Nullspace N ( A )
We need to find a basis for
= the subspace of solutions to Ax 0=
, which can be obtained from Rx 0:
6 4
1 0 − 7 − 7 x1 0
17 2 x2 0
Rx = 0 → 0 1 =
7 7 x3 0
0 0 0 0
x 0
4
The pivot variables are { x1 , x2 } and the free variables are { x3 , x4 }. Since there are 2 free variables, we know
immediately that dim ( N ( A ) ) = 2.
6 4
7 7
6 4 17 2 17 2
x1 = − x3 − x 4 → x =
x 3 + x 4 , x2 = x3 − + x4 −
7 7 7 7 7 7
1 0
0 1
6 17 4 2
Thus N ( A ) = span − 1 0 , − 0 1 .
7 7 7 7
Note: I have written the basis for N ( A ) as row vectors because they are naturally paired with the row space
R ( AT ) according to the fundamental theorem of linear algebra.
Example (continued)
Left Nullspace N ( AT )
( )
There are two pivot variables {y1 , y2 } and one free variable {y3 } , so dim N ( AT ) = 1.
−1
− y 3 , y2 =
y1 = − y3 → y=
y 3 −1
1
−1
Therefore N(A ) =
T
span −1 . Again, you should verify that R ( A ) ⊥ N ( AT ) and R ( AT ) ⊥ N ( A ) .
1
1 −1 2 −1
For example, to verify R ( A ) ⊥ N ( AT
) observe that −=
3 ⋅ −1 0 and =1 ⋅ −1 0.
−2 1 3 1