Linear Algebra Lectures
Linear Algebra Lectures
Linear Algebra Lectures
These slides are based on Section 1 in Linear Algebra and its Applications by David C. Lay.
Definition 1. A linear equation in the variables x1, ..., xn is an equation that can be
written as
a1x1 + a2x2 +
+ anxn = b.
Example 2. Which of the following equations are linear?
4x1 5x2 + 2 = x1
x2 = 2( 6 x1) + x3
linear: 2x1 + x2 x3 = 2 6
x2 = 2 x1 7
not linear: x1
Definition 3.
A system of linear equations (or a linear system) is a collection of one or more
linear equations involving the same set of variables, say, x1, x2, ..., xn.
A solution of a linear system is a list (s1, s2, ..., sn) of numbers that makes each
equation in the system true when the values s1, s2, ..., sn are substituted for x1, x2,
..., xn, respectively.
Example 4. (Two equations in two variables)
In each case, sketch the set of all solutions.
x1 + x2 = 1
x1 2x2 = 3
x1 + x2 = 0
2x1 4x2 = 8
-3
-2
2x1 + x2 = 1
4x1 2x2 = 2
-1
3 -3
-2
-1
3 -3
-2
-1
-1
-1
-1
-2
-2
-2
-3
-3
-3
x1 +
R2R2+R1
>
x2 = 1
2x2 = 1
x1 = 1/2
x1 2x2 +
x3 = 0
2x2 8x3 = 8
3x2 + 13x3 = 9
R3 R3 + 4R1
R3 R3 + 2 R2
x1 2x2 + x3 = 0
2x2 8x3 = 8
x3 = 3
By back-substitution:
x3 = 3,
x2 = 16,
x1 = 29.
It is always a good idea to check our answer. Let us check that (29, 16, 3) indeed solves
the original system:
x1 2x2 + x3 = 0
2x2 8x3 = 8
4x1 + 5x2 + 9x3 = 9
3 @
2 16 8 3 @
29 2 16 +
0
8
9
4 29 + 5 16 + 9 3 @
Matrix notation
x1 2x2 = 1
x1 + 3x2 = 3
1 2
1 3
(coefficient matrix)
1 2 1
3
1 3
(augmented matrix)
Armin Straub
[email protected]
x1 2x2 + x3 = 0
1 2 1
0
2x2 8x3 = 8 0
2 8
8 ,
4x1 + 5x2 + 9x3 = 9
R3 R3 + 4R1
4
5 9 9
x1 2x2 +
x3 = 0
2x2 8x3 = 8
3x2 + 13x3 = 9
x1 2x2 + x3 = 0
2x2 8x3 = 8
x3 = 3
1 2 1
0
8
0
2 8
0 3 13 9
1 2 1
0
2 8
0
0 1
R3 R3 + 2 R2
0
8
3
= 3
= 32
= 3
1 2
0
2
0
0
0 3
0 32
1
3
1
0
0
0
0
1
= 29
= 16
= 3
0
1
0
29
16
3
We again find the solution (x1, x2, x3) = (29, 16, 3).
Armin Straub
[email protected]
0
0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0
0 0 0 0
0 0 0 0 0 0 0
0
(a)
0
0
0
(b)
0
0
0
(c)
0
0
(d)
YES
0 0 0 0
0 0 0 0
YES
0
0 0
0 0
0
NO
0
0 0
However, I would suggest waiting a bit before reading through these parts (say, until we covered
things like matrix multiplication in class).
Pre-lecture trivia
Who are these four?
Armin Straub
[email protected]
Review
Each linear system corresponds to an augmented matrix.
6
2 1
1 2 1 9
1 2 12
2x1 x2
= 6
x1 +2x2 x3 = 9
x2 +2x3 = 12
augmented matrix
>
R2R2+ 2 R1
>
R3R3+ 3 R2
2 1 0 6
3
0 2 1 6
0 1 2 12
2 1 0 6
0 3 1 6
2
echelon form!
4
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Armin Straub
[email protected]
0
0 0 0
0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Note that, to be in reduced echelon form, the pivots also have to be scaled to 1.
0 1 0 0 0 0
0 0 0 1 0 0 0
(a)
0 0 0 0 1 0 0
0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 1
1 0 5 0 7
0 2 4 0 6
(b)
0 0 0 5 0
0 0 0 0 0
1 0 2 3 2 24
(c) 0 1 2 2 0 7
0 0 0 0 1
4
YES
NO
NO
Theorem 4. (Uniqueness of the reduced echelon form) Each matrix is row equivalent to one and only one reduced echelon matrix.
Question. Is the same statement true for the echelon form?
Clearly not; for instance,
Armin Straub
[email protected]
1 2
0 1
1 0
0 1
Example 5. Row reduce to echelon form (often called Gaussian elimination) and then
to reduced echelon form (often called GaussJordan elimination):
0 3 6 6 4 5
3 7 8 5 8 9
3 9 12 9 6 15
Solution.
After R1 R3, we get:
3 9 12 9 6 15
3 7 8 5 8 9
0 3 6 6 4 5
Then, R2 R2 R1 yields:
3 9 12 9 6 15
0 2 4 4 2 6
0 3 6 6 4 5
3
3 9 12 9 6 15
0 2 4 4 2 6
0 0 0 0 1 4
To get the reduced echelon form, we first scale
1 3 4 3
0 1 2 2
0 0 0 0
all rows:
2 5
1 3
1 4
1 3 4 3 0 3
0 1 2 2 0 7
0 0 0 0 1 4
Finally, R1 R1 + 3R2 produces the reduced echelon form:
1 0 2 3 0 24
0 1 2 2 0 7
0 0 0 0 1
4
Armin Straub
[email protected]
Example 6.
1 6 0 3 0 0
0 0 1 8 0 5
0 0 0 0 1 7
x1 +6x2
x3
+3x4
8x4
x5
= 0
= 5
= 7
The pivots are located in columns 1, 3, 5. The corresponding variables x1, x3, x5 are
called pivot variables (or basic variables).
The remaining variables x2, x4 are called free variables.
We can solve each equation for the pivot variables in terms of the free variables (if
any). Here, we get:
x1 = 6x2 3x4
x1 +6x2
+3x4
= 0
x2 free
x3 = 5 + 8x4
x3 8x4
= 5
x
free
x5 = 7
4
x5 = 7
This is the general solution of this system. The solution is in parametric form, with
parameters given by the free variables.
Just to make sure: Is the above system consistent? Does it have a unique solution?
Example 7. Find a parametric description of the solution set of:
3x1
3x1
0 3 6 6 4 5
3 7 8 5 8
9 .
3 9 12 9 6 15
We determined earlier that its reduced echelon form is
1 0 2 3 0 24
0 1 2 2 0 7 .
0 0 0 0 1
4
Armin Straub
[email protected]
x1 = 24 + 2x3 3x4
x2 = 7 + 2x3 2x4
x3 free
x free
4
x5 = 4
Armin Straub
[email protected]
Review
We have a standardized recipe to find all solutions of systems such as:
3x1
3x1
0 3 6 6 4 5
3 7 8 5 8
9 ,
3 9 12 9 6 15
and to calculate its reduced echelon form (which is unique!). Here:
1 0 2 3 0 24
0 1 2 2 0 7 .
0 0 0 0 1
4
pivot variables (or basic variables): x1, x2, x5
free variables: x3, x4
solving each equation for the pivot variables in terms of the free variables:
x1
x2
2x3 +3x4
2x3 +2x4
x5
Armin Straub
[email protected]
= 24
= 7
= 4
x1 = 24 + 2x3 3x4
x2 = 7 + 2x3 2x4
x3 free
x free
4
x5 = 4
Example 1. Is the following system consistent? If so, does it have a unique solution?
3x1
3x1
3 9 12 9 6 15
0 2 4 4 2 6
0 0 0 0 1
4
>
(GaussJordan elimination)
True or false?
There is no more than one pivot in any row.
True, because a pivot is the first nonzero entry in a row.
[ 1 7 5 3 ].
1 4 2 3
2 1 2 2 .
3 2 2 0
Each column is what we call a (column) vector.
In this example, each column vector has 3 entries and so lies in R 3.
Example 5. A fundamental property of vectors is that vectors of the same kind can be
added and scaled.
1
4
5
2 + 1 = 1 ,
3
2
5
x1
7x1
7 x2 = 7x2 .
x3
7x3
1
3
and y =
2
1
x1
x2
, graph x, y, x + y, 2y.
0
0
Armin Straub
[email protected]
Adding and scaling vectors, the most general thing we can do is:
Definition 7. Given vectors v1, v2,
, vm in Rn and scalars c1, c2,
, cm, the vector
c1v1 + c2v2 +
+ cmvm
is a linear combination of v1, v2,
, vm.
The scalars c1,
, cm are the coefficients or weights.
3v1 v2 + 7v3,
v2 + v3,
0.
Example 9. Express
1
5
as a linear combination of
2
1
and
1
1
c1
This is the same as:
2
1
+ c2
1
1
1
=
.
5
2c1 c2 = 1
c1 +c2 = 5
Solving, we find c1 = 2 and c2 = 3.
Indeed,
2
1
1
2
+3
=
.
1
5
1
Note that the augmented matrix of the linear system is
2 1 1
,
1 1 5
and that this example provides a new way of think about this system.
Armin Straub
[email protected]
2
1
2
1
+y
and
1
1
1
1
1
5
produce
1
5
2
1
+3
1
1
Armin Straub
[email protected]
1
5
Pre-lecture:
0
of Gaussian elimination:
if there is N pivots:
Armin Straub
[email protected]
Organizational
Help sessions in 441 AH: MW 4-6pm, TR 5-7pm
Review
A system such as
2x y = 1
x+ y = 5
can be written in vector form as
2
1
1
x
+y
=
.
1
1
5
The left-hand side is a linear combination of the vectors
2
1
and
1
1
5
4
3
2
1
Armin Straub
[email protected]
Column picture.
The system can be written as
2
1
1
x
+y
=
.
1
1
5
Which
linear
combinations
of
1
1
and 1 produce 5 ?
4
2
1
3
2
-3
-2
-1
1
a1 = 0 ,
3
4
a2 = 2 ,
14
3
a3 = 6 ,
10
1
b = 8 .
5
1
4
3
1
x1 0 + x2 2 + x3 6 = 8
3
14
10
5
This vector equation corresponds to the linear system:
+4x2 +3x3 = 1
+2x2 +6x3 = 8
+14x2 +10x3 = 5
x1
3x1
Corresponding augmented matrix:
1 4 3 1
0 2 6 8
3 14 10 5
Note that we are looking for a linear combination of the first three columns which
Armin Straub
[email protected]
1 4 3 1
1 4 3 1
1 4 3 1
0 2 6 8 0 2 6 8 0 2 6
8
3 14 10 5
0 2 1 2
0 0 5 10
Since this system is consistent, b is a linear combination of a1, a2, a3.
[It is consistent, because there is no row of the form
[ 0 0 0 b ]
with b 0.]
Example 3. In the previous example, express b as a linear combination of a1, a2, a3.
Solution. The reduced echelon form is:
1 4 3 1
0 2 6
8
0 0 5 10
1 4 3 1
0 1 3 4
0 0 1 2
1 4 0 7
0 1 0 2
0 0 1 2
1 0 0 1
0 1 0 2
0 0 1 2
1
4
3
1
0 2 2 + 2 6 = 8 .
3
14
10
5
Summary
A vector equation
x1a1 + x2a2 +
+ xmam = b
has the same solution set as the linear system with augmented matrix
| |
a1 a2
| |
| |
am b .
| |
Armin Straub
[email protected]
Example 5.
(a) Describe span
n
2
1
o
geometrically.
2
1
2.0
1.5
1.0
0.5
-2
-1
-0.5
-1.0
b1
b2
"
n
2
1
and
o
4
geometrically.
2
4
2
= 2 1 . Hence, the span
2
2
1
b1
2 4
1
0 1 b2 2 b1
is a linear combination of
2 4 b1
1 1 b2
b1
b2
any vector.
is consistent
2 4 b1
1 2 b2
is in the span of
2
1
"
and
Armin Straub
[email protected]
b1
b2
4
1
is as in (a).
"
b1
2 4
1
0 0 b2 2 b1
4
2
b1
1
b
2 1
#
1
b1
b2
any vector.
b1
b2
"
= b1
1
1
2
A single (nonzero) vector always spans a line, two vectors v1, v2 usually span a plane
but it could also be just a line (if v2 = v1).
We will come back to this when we discuss dimension and linear independence.
4
2
1 , 2
1
1
Example 6. Is span
a line or a plane?
4
2
2 = 1 .
1
1
Looking at the first entry, = 2, but that does not work for the third entry. Hence,
there is no such . The span is a plane.
Example 7. Consider
1 2
A = 3 1 ,
0 5
8
b = 3 .
17
1 2 8
3 1 3
0 5 17
is consistent.
1 2 8
8
8
1 2
1 2
3 1 3 0 5 21 0 5 21
0 5 17
0 5 17
0 0 4
From the last row, we see that the system is inconsistent. Hence, b is not in the plane
spanned by the columns of A.
Armin Straub
[email protected]
| |
| |
a1 a2 am b .
| |
| |
Each solution corresponds to the weights in a linear combination of the a1, a2,
,
am which gives b.
This gives a second geometric way to think of linear systems!
Armin Straub
[email protected]
Pre-lecture:
2 3
3 1
x1
b1
=
x2
b2
Why?
Its concise.
The compactness also sparks associations and ideas!
For instance, can we solve by dividing by A? x = A1b?
If Ax = b and Ay = 0, then A(x + y) = b.
Leads to matrix calculus and deeper understanding.
multiplying, inverting, or factoring matrices
Matrix operations
Basic notation
We will use the following notations for an m n matrix A (m rows, n columns).
In terms of the columns of A:
A = [ a1 a2
In terms of the entries of A:
a1,1 a1,2
a2,2
a
A = 2,1
am,1 am,2
| |
an ] = a1 a2
| |
a1,n
a2,n
,
am,n
ai,j =
|
an
|
entry in
i-th row,
j-th column
(b) 7
2 3
3 1
14 21
=
21 7
| |
[ A b ] = a1 a2
| |
if and only if
| |
an b
| |
x1a1 + x2a2 +
+ xnan = b.
It is therefore natural to define the product of matrix times vector as
x1
Ax = x1a1 + x2a2 +
+ xnan ,
x =
.
xn
The system of linear equations with augmented matrix [ A b ] can be written in
matrix form compactly as Ax = b.
The product of a matrix A with a vector x is a linear combination of the columns of
A with weights given by the entries of x.
Example 2.
1 0
(a)
5 2
2 3
(b)
3 1
2 3
(c)
3 1
1
0
2
=2
+1
=
5
2
12
0
3
=
1
1
x1
2
3
2x1 + 3x2
= x1
+ x2
=
x2
3
1
3x1 + x2
2
1
=
3x1 +x2 = b2
3 1
x2
b2
2 3
5
1
(d) 3 1
= 4
1
1 1
0
Armin Straub
[email protected]
Ab p ],
B = [ b1 b2
b p ].
Example 4.
1 0
2 3
2 3
(a)
=
5 2
1 2
12 11
1 0
2
1
0
2
=2
+1
=
because
5 2
1
5
2
12
1 0
3
1
0
3
and
.
= 3
+2
=
5 2
2
5
2
11
1 0
2 3 1
2 3 1
(b)
=
5 2
1 2 0
12 11 5
Each column of AB is a linear combination of the columns of A with weights given
by the corresponding column of B.
Remark 5. The definition of the matrix product is inevitable from the multiplication of
matrix times vector and the fact that we want AB to be defined such that (AB)x =
A(Bx).
A(Bx) = A(x1b1 + x2b2 + )
= x1Ab1 + x2Ab2 +
= (AB)x if the columns of AB are Ab1, Ab2,
Basic properties
Example 7.
2 3
(a)
3 1
1 0
(b)
0 1
2
=
3
2 3
2
=
3 1
3
1 0
0 1
3
1
3
1
A(BC) = (AB)C
associative
A(B + C) = AB + AC
left-distributive
(A + B)C = AC + BC
right-distributive
=
(a)
3 1
0 1
3 4
1 1
2 3
5 4
(b)
=
0 1
3 1
3 1
Example 10. Also, a product can be zero even though none of the factors is:
2 0
0 0
0 0
=
3 0
2 1
0 0
Transpose of a matrix
Definition 11. The transpose AT of a matrix A is the matrix whose columns are
formed from the corresponding rows of A.
rows columns
Example
(a)
3
1
12.
0 T
2
3
1
1 =
0 1 4
4
x1
(b) [ x1 x2 x3 ]T = x2
x3
T
2 3
2 3
(c)
=
3 1
3 1
A matrix A is called symmetric if A = AT .
Armin Straub
[email protected]
Practice problems
True or false?
AB has as many columns as B.
AB has as many rows as B.
The following practice problem illustrates the rule (AB)T = B TAT .
Example 13. Consider the matrices
1 2
A = 0 1 ,
2 4
Compute:
1 2
1
2
(a) AB = 0 1
=
3 0
2 4
T
(b) (AB) =
1
0
2
(c) B TAT =
=
2 1 4
1 0 2
1 3
T T
(d) A B =
=
2 1 4
2 0
1 3
2 0
B=
1 2
.
3 0
Armin Straub
[email protected]
=2
+1
=
3 1
1
3
1
7
Ax = b is the matrix form of the linear system with augmented matrix [ A b ].
2 3
3 1
x1
b1
=
x2
b2
2x1 +3x2 = b1
3x1 +x2 = b2
2 3
3 1
2 1
7 2
=
1 0
7 3
Armin Straub
[email protected]
Transpose of a matrix
Definition 1. The transpose AT of a matrix A is the matrix whose columns are formed
from the corresponding rows of A.
rows columns
Example
2
(a) 3
1
2.
0 T
2
3
1
1 =
0 1 4
4
x1
(b) [ x1 x2 x3 ]T = x2
x3
T
2 3
2 3
=
(c)
3 1
3 1
A matrix A is called symmetric if A = AT .
Theorem 3. Let A, B be matrices of appropriate size. Then:
(AT )T = A
(A + B)T = AT + B T
(AB)T = B TAT
Armin Straub
[email protected]
2 3
2 3 6
16
3
0 1 =
1 0 1
0 3
2 0
2
0
2
2 3 6
16
1 0 1
0
3
1
0
3
3
1 2 3
1 0 0
1
2
3
(a)
4 5 6 =
0 0 1
7 8 9
7 8 9
Armin Straub
[email protected]
LU decomposition
Elementary matrices
Example 7.
1 0
(a)
0 1
0 1
(b)
1 0
1 0 0
(c) 0 2 0
0 0 1
1 0 0
(d) 0 1 0
3 0 1
a b
=
c d
a b
c d
=
c d
a b
a b c
a b c
d e f = 2d 2e 2f
g h i
g h i
a b c
a
b
c
d e f =
d
e
f
g h i
3a + g 3b + h 3c + i
a b
c d
Example
(a)
0
3
9.
0 0
1 0 0
1
1 0 0 1 0 =
1
3 0 1
0 1
1
1 0 0
1 0 0 1
We write 0 1 0 = 0 1 0 , but more on inverses soon.
3 0 1
3 0 1
Elementary matrices are invertible because elementary row operations are reversible.
1 0 0 1
1 0 0
(b) 2 1 0 = 2 1 0
0 0 1
0 0 1
1
1 0 0 1
1
(c) 0 2 0 =
2
0 0 1
1
1 0 0
1 0 0
(d) 0 0 1 = 0 0 1
0 1 0
0 1 0
Armin Straub
[email protected]
Practice problems
Example 10. Choose either column or row interpretation to see the result of the
following products.
1 2 0
1 0 0
(a) 2 1 2 0 1 0 =
0 2 1
0 1 1
1 2 0
1 0 0
(b) 0 1 0 2 1 2 =
0 2 1
0 1 1
Armin Straub
[email protected]
Review
Example 1. Elementary matrices in action:
0 0 1
a b c
g h i
(a) 0 1 0 d e f = d e f
1 0 0
g h i
a b c
a b c
1 0 0
a b c
(b) 0 1 0 d e f = d e f
7g 7h 7i
0 0 7
g h i
1 0 0
a b c
a
b
c
(c) 0 1 0 d e f =
d
e
f
3 0 1
g h i
3a + g 3b + h 3c + i
a b c
1 0 0
a + 3c b c
(d) d e f 0 1 0 = d + 3f e f
3 0 1
g h i
g + 3i h i
1 0 0
1 0 0
(e) 2 1 0 = 2 1 0
0 0 1
0 0 1
Armin Straub
[email protected]
LU decomposition, continued
Gaussian elimination revisited
Example 2. Keeping track of the elementary matrices during Gaussian elimination on A:
2 1
A=
4 6
R2 R2 2R1
1 0
2 1
2 1
EA =
=
2 1
4 6
0 8
Note that:
A=E
2 1
0 8
1 0
2 1
2 1
0 8
Definition 3.
lower triangular
0 0 0 0
0 0 0
0 0
Armin Straub
[email protected]
upper
triangular
2 1 1
Example 4. Factor A = 4 6 0 as A = LU .
2 7 2
Solution. We begin with R2 R2 2R1 followed by R3 R3 + R1:
1
E1A = 2
0
E2(E1A) = 0
1
1
E3E2E1A = 0
0
0
1
0
0
1
0
0
1
1
2 1 1
0
0 4 6 0
1
2 7 2
0
2 1 1
0
0 8 2
1
2 7 2
0
2 1 1
0 0 8 2
1
0 8 3
2 1 1
= 0 8 2
0 0 1
=U
= 2 1
1
= 2 1
1
= 2 1
1 1 1
no te th at E3E2E1A = U
1
1
1
1
A=E
1
1
1
1 1
1
1 1 1
2 1 1
1
2 1 1
4 6 0 = 2 1
8 2
2 7 2
1 1 1
1
Note: The extra steps to compute L were unnecessary! The entries in L are precisely
the negatives of the ones in the elementary matrices during elimination. C an you see it?
Armin Straub
[email protected]
Ax = b
L(Ux) = b
Lc = b and
Ux = c
Both of the final systems are triangular and hence easily solved:
Lc = b by forward substitution to find c, and then
Ux = c by backward substitution to find x.
Important practical point: can be quickly repeated for many different b.
2 1 1
4
Example 5. Solve 4 6 0 x = 10 .
2 7 2
3
Solution. We already found the LU decomposition A = LU :
2 1 1
1
2 1 1
4 6 0 = 2 1
8 2
2 7 2
1 1 1
1
Forward substitution to solve Lc = b for c:
1
4
2 1
c = 10
1 1 1
3
4
c = 2
3
1 1
4
8 2 x = 2
1
3
1
x = 1
3
2 1 1
4
4 6 0 x = 10
2 7 2
3
Armin Straub
[email protected]
1 0 0
Example 7. E = 0 0 1 is a permutation matrix.
0 1 0
EA is the matrix obtained from A by permuting the last two rows.
Theorem 8. For any matrix A there is a permutation matrix P such that PA = LU .
In other words, it might not be possible to write A as A = LU , but we only need to permute the
rows of A and the resulting matrix PA now has an LU decomposition: PA = LU .
Armin Straub
[email protected]
Practice problems
Is
2 0
0 1
Is
0 1
1 0
True or false?
A permutation matrix is one that is obtained by performing column exchanges
on an identity matrix.
Why do we care about LU decomposition if we already have Gaussian elimination?
Example 9.
5
2
1 1
Solve 4 6 0 x = 2
9
2 7 2
0 0 1
A = 1 1 0
2 1 0
cannot be written as A = LU (so it doesnt have a LU decomposition). But there is a
permutation matrix P such that PA has a LU decomposition.
0 1 0
1 1 0
Namely, let P = 0 0 1 . Then PA = 2 1 0 .
1 0 0
0 0 1
PA can now be factored as PA = LU . Do it!!
(By the way, P
0 0 1
= 0 1 0
1 0 0
Armin Straub
[email protected]
Review
Elementary matrices performing row operations:
1 0 0
a b c
a
b
c
2 1 0 d e f = d 2a e 2b f 2c
0 0 1
g h i
g
h
i
Gaussian elimination on A gives an LU decomposition A = LU :
2 1 1
1
2 1 1
4 6 0 = 2 1
8 2
2 7 2
1 1 1
1
U is the echelon form, and L records the inverse row operations we did.
LU decomposition allows
1 0 0 1
1 0
= a 1
a 1 0
0 0 1
0 0
us to solve Ax = b for
0
0
1
0 0 1
1 0
= a 1
1 0
b 1
ab b
many b.
0
0
1
Goal for today: invert these and any other matrices (if possible)
Armin Straub
[email protected]
Example 1. The inverse of a real number a is denoted as a1. For instance, 71 = 7 and
7 71 = 71 7 = 1.
In the context of n n matrix multiplication, the role of 1 is taken by the n n identity
matrix
In =
.
1
Definition 2. An n n matrix A is invertible if there is a matrix B such that
AB = BA = In.
In that case, B is the inverse of A and we write A1 = B.
Example 3. We already saw that elementary matrices are invertible.
1 0 0 1
1
2 1 0 = 2 1
0 0 1
1
Armin Straub
[email protected]
Note.
The inverse of a matrix is unique. Why?
S o A 1 is well-d efined.
Do not write
A
.
B
Why?
0 1
0 0
Solution.
Example 5. If A =
a b
c d
0 1
0 0
a b
c d
c d
1
=
0 0
1
, then
1
d
b
A1 =
ad bc c a
provided that ad bc 0.
A 1 1 matrix [ a ] is invertible
a 0.
a b
A 2 2 matrix
is invertible
ad bc 0.
c d
We will encounter the quantities on the right again when we discuss determinants.
Armin Straub
[email protected]
Example 7. Solve
7x1 +3x2 = 2
using matrix inversion.
5x1 2x2 = 1
7 3
2
x=
.
5 2
1
a b
c d
1
7 3
5 2
1
1 2 3
2 3
=
=
5 7
1 5 7
1
d b
=
.
ad bc c a
Armin Straub
[email protected]
b=
2 3
5 7
2
1
7
=
17
GaussJordan method
I A1
.
2 0 0
Example 8. Find the inverse of A = 3 0 1 , if it exists.
0 1 0
Solution. By row reduction:
[A I]
Hence, A
1
2
1
2
0 0
1 0 0
0 1 0 0 0 1
3
0 0 1 2 1 0
2 0 0 1 0 0
3 0 1 0 1 0
0 1 0 0 0 1
I A1
0 0
=
0 0 1 .
3
1 0
2
2 0 0 1 0 0
3 0 1 0 1 0
0 1 0 0 0 1
>
R2R2+ 2 R1
>
R1 2 R1
R2R3
Armin Straub
[email protected]
2 0 0 1 0 0
3
0 0 1 2 1 0
0 1 0 0 0 1
1
2
0 0
1 0 0
0 1 0 0 0 1
3
0 0 1 2 1 0
[ E 1A E 1I ]
[ E 2E 1 A E 2 E 1 ]
So at each step:
[A I]
[ FA F ]
with F = Er E2E1
and hence A1 = F .
Armin Straub
[email protected]
Review
The inverse A1 of a matrix A is, if it exists, characterized by
AA1 = A1A = In.
a b
c d
1
1
d b
=
ad bc c a
(AT )1 = (A1)T
(AB)1 = B 1A1
Why? Because (B 1A 1)(AB) = B 1IB = B 1B = I
(E asy to check!)
Note. Matrices that are not invertible are often called singular.
The book uses singular for n n matrices that do not have n pivots. As we just saw, it doesnt
make a difference.
0 1
0 0
is not invertible.
0 6 x 6 1,
u(0) = u(1) = 0.
Remark 3. Note that this simple BVP can be solved by integrating f (x) twice. We get
two constants of integration, and so we see that the boundary condition u(0) = u(1) = 0
makes the solution u(x) unique.
Of course, in the real applications the BVP would be harder. Also, f (x) might only be known at
some points, so we cannot use calculus to integrate it.
u(x)
x
We will approximate this problem as follows:
replace u(x) by its values at equally spaced points in [0, 1]
u0
0
approximate
u1
u2
2h
h
d 2u
dx2
)
3h
)
2h
)
(h
=
u(
u3
3h
u(
un
...
nh
h
(n
)
1
+
un
Armin Straub
[email protected]
Finite differences
Finite differences for first derivative:
du u
u(x + h) u(x)
=
dx x
h
or u(x) u(x h)
h
or u(x + h) u(x h)
2h
@
@
Note. Recall that you can always use LHospitals rule to determine the limit of such
quantities (especially more complicated ones) as h 0.
Finite difference for second derivative:
u(x + h) 2u(x) + u(x h)
d2 u
h2
dx2
d2 u
Question 4. Why does this approximate
as h 0?
dx2
Solution.
d2 u
dx2
du
du
(x + h) dx (x)
dx
h
u(x + h) u(x)
h
u(x) u(x h)
h
h
u(x + h) 2u(x) + u(x h)
h2
Armin Straub
[email protected]
u0
0
d2u
0
u1
)
(h
u2
0 6 x 6 1,
h
(2
u3
2h
Using dx2
d 2u
= f (x),
dx2
...
3h
h2
2u1 u2 = h2 f (h)
h)
)
un
at x = h:
h
(3
u(0) = u(1) = 0.
n
u(
+
un
nh
we get:
= f (h)
(1)
= f (2h)
at x = 2h:
h2
2
u1 + 2u2 u3 = h f (2h)
(2)
at x = 3h:
u2 + 2u3 u4 = h2 f (3h)
(3)
at x = nh:
h2
un1 + 2un = h2 f (nh)
= f (nh)
(n)
1
2 1
1 2 1
1 2 1
1 2 1
1 2
A
Armin Straub
[email protected]
u1
u2
u3
u4
u5
x
h2 f (h)
h2 f (2h)
h2 f (3h)
h2 f (4h)
h2 f (5h)
Such a matrix is called a band matrix. As we will see next, such matrices always have
a particularly simple LU decomposition.
Gaussian elimination:
2 1
1 2 1
1 2 1
1 2 1
1 2
>
R2R2+ 2 R1
1
1
1
1
1
>
R3R3+ 3 R2
1
1
2
3
1
1
1
>
R4R4+ 4 R3
1
1
1
3
4
1
1
>
R5R5+ 5 R4
1
1
1
1
4
5
2 1
3
0 2 1
1 2 1
1 2 1
1 2
2 1
0 3 1
2
1
0
1 2 1
1 2
2 1
3
0 2 1
1
0
0
1
4
1 2
2 1
3
0 2 1
1
0
1
0
4
6
0
5
2 1
1
2 1
1 2 1
2
=
3 1
1 2 1
3
1 2 1
4
1 2
1
4
5 1
2 1
3
2
1
4
3
4
6
5
Armin Straub
[email protected]
Review
Goal: solve for u(x) in the boundary value problem (BVP)
d 2u
2 = f (x),
dx
0 6 x 6 1,
u(0) = u(1) = 0.
u0
0
u1
0
d 2u
dx2
h
u(
)
u2
2
u(
h)
u3
2h
3
u(
3h
h)
h)
un
...
n
u(
un
nh
2 1
1 2 1
1 2 1
1 2 1
1 2
u1
u2
u3
u4
u5
h f (h)
h2 f (2h)
h2 f (3h)
h2 f (4h)
h2 f (5h)
1
2 1
1
1
1 2 1
2
3 1
1 2 1
=
3
1 2 1
4
1 2
1
4
5 1
2 1
3
2
1
4
3
4
6
5
Armin Straub
[email protected]
A=L U
Lc = b
and
Ux = c
1
1
2 1
3 1
3
4
1
4
5 1
3
2
c = b,
2 1
1
4
3
x = c
1
5
1
6
5
1
A1 =
6
5
4
3
2
1
4
8
6
4
2
3
6
9
6
3
2
4
6
8
4
1
2
3
4
5
Armin Straub
[email protected]
Conclusions
Large matrices met in applications usually are not random but have some structure
(such as band matrices).
When solving linear equations, we do not (try to) compute A1.
It destroys structure in practical problems.
As a result, it can be orders of magnitude slower,
and require orders of magnitude more memory.
It is also numerically unstable.
LU decomposition can be adjusted to not have these drawbacks.
A practice problem
Example 2. Above we computed the LU decomposition for n = 5. For comparison,
here are the details for computing the inverse when n = 3.
Do it for n = 5, and appreciate just how much computation has to be done.
Invert
2 1
A = 1 2 1 .
1 2
Solution.
>
>
1
2 1 0 1 0 0
2 1
R2R2+
R1
2
1 2 1 0 1 0
3
0 2
0 1 2 0 0 1
0 1
2 1
2
R3R3+ 3 R2
0 3
2
0 0
1
1 2 0
1
R1 2 R1
2
0 1 3
2
R2 3 R2
0 0
1
3
R3 4 R3
1 0 0
2
R2R2+ 3 R3
0 1 0
1
R1R1+ 2 R2
0 0 1
>
>
1
2 1
Hence, 1 2 1 =
1 2
Armin Straub
[email protected]
3
4
1
2
1
4
1
2
1
1
2
1
4
1
2
3
4
0 1 0 0
1
1 2 1 0
2 0 0 1
0 1 0 0
1
1 2 1 0
4
1 2
1
3
3 3
1
0
0
1 2
0
3 3
1
4
3
4
1
2
1
4
1
2
1
2
1
1
2
3
4
1
4
1
2
3
4
tl;dr
A vector space is a collection of vectors which can be added and scaled
(without leaving the space!); subject to the usual rules you would hope for.
namely: associativity, commutativity, distributivity
n
a b
c d
: a, b, c, d in R is a vector space.
0 0
0 0
Addition is componentwise:
a b
c d
e f
a+e b+ f
+
=
g h
c+ g d+h
Scaling is componentwise:
a b
ra rb
r
=
c d
rc rd
Armin Straub
[email protected]
Addition and scaling satisfy the axioms of a vector space because they are defined
component-wise and because ordinary addition and multiplication are associative, commutative, distributive and what not.
Important note: we do not use matrix multiplication here!
Note: as a vector space, M22 behaves precisely like R4; we could translate between
the two via
a
a b
b .
c
c d
d
A fancy person would say that these two vector spaces are isomorphic.
Example 5. Let Pn be the set of all polynomials of degree at most n > 0. Is Pn a
vector space?
Solution. Members of Pn are of the form
p(t) = a0 + a1t +
+ antn ,
where a0, a1,
, an are in R and t is a variable.
Pn is a vector space.
Adding two polynomials:
[a0 + a1t +
+ antn] + [b0 + b1t +
+ bntn]
= [(a0 + b0) + (a1 + b1)t +
+ (an + bn)tn]
So addition works component-wise again.
Scaling a polynomial:
r[a0 + a1t +
+ antn]
= [(ra0) + (ra1)t +
+ (ran)tn]
Scaling works component-wise as well.
Again: the vector space axioms are satisfied because addition and scaling are defined
component-wise.
As in the previous example, we see that Pn is isomorphic to Rn+1:
a0
a1
a0 + a1t +
+ antn
an
Armin Straub
[email protected]
Example 6. Let V be the set of all polynomials of degree exactly 3. Is V a vector space?
Solution. No, because V does not contain the zero polynomial p(t) = 0.
Every vector space has to have a zero vector; this is an easy necessary (but not sufficient) criterion
when thinking about whether a set is a vector space.
Armin Straub
[email protected]
Review
A vector space is a set of vectors which can be added and scaled (without leaving
the space!); subject to the usual rules.
The set of all polynomials of degree up to 2 is a vector space.
[a0 + a1t + a2t2] + [b0 + b1t + b2t2] = [(a0 + b0) + (a1 + b1)t + (a2 + b2)t2]
r[a0 + a1t + a2t2] = [(ra0) + (ra1)t + (r a2)t2]
degree 2
NOT degree 2
An easy test that often works is to check whether the set contains the zero vector.
(Works in the previous case.)
Example 1. Let V be the set of all functions f : R R. Is V a vector space?
Solution. Yes!
Addition of functions f and g:
(f + g)(x) = f (x) + g(x)
Note that, once more, this definition is component-wise.
Likewise for scalar multiplication.
Armin Straub
[email protected]
Subspaces
Definition 2. A subset W of a vector space V is a subspace if W is itself a vector space.
Since the rules like associativity, commutativity and distributivity still hold, we only need
to check the following:
W V is a subspace of V if
W contains the zero vector 0,
W is closed under addition,
(i.e. if u, v W then u + v W )
(i.e. if u W an d c R then cu W )
Note that 0 in W (first condition) follows from W closed under scaling (third condition). But it
is crucial and easy to check, so deserves its own bullet point.
Example 3. Is W = span
Solution. Yes!
W contains
a
a
a
a
+
b
b
ca
ca
0
0
=0
a+b
a+b
n
1
1
1
1
o
is in W .
is in W .
(
a
0 : a, b
b
Example 4. Is W =
a subspace of R2?
in R
a subspace of R3?
Solution. Yes!
0
W contains 0 .
0
a1 + a2
a2
a1
0 + 0 =
0
b1 + b2
b2
b1
ca
a
c 0 = 0 is in W .
cb
b
is in W .
a
1 : a, b
b
in R
a
0 a )
b
b
a subspace of R3?
Note: W
(
0
a
= 1 + 0 : a, b
b
0
in R
Example 6. Is W =
Solution. Yes!
W contains
0
0
0
0
+
0
0
0
0
0
0
n
o
0
0
a subspace of R2?
0
0
is in W .
is in W .
o
n
x
Example 7. Is W = x + 1 : x in R a subspace of R2?
Solution. No! W does not contain
0
0
For instance, 2
1
2
Example 8. Is W =
2
4
n
0
0
or
o
1
2
n
2
3
x
x+1
3
5
: x in R
are not in W .]
o
a subspace of R2?
[In other words, W is the set from the previous example plus the zero vector.]
Solution. No! 2
1
2
2
4
not in W .
Theorem 9. If v1,
, vm are in a vector space V , then span{v1,
, vm } is a subspace
of V .
Why?
0 is in span{v1,
, vm }
[c1v1 +
+ cmvm] + [d1v1 +
+ dmvm]
= [(c1 + d1)v1 +
+ (cm + dm)vm]
r[c1v1 +
+ cmvm] = [(rc1)v1 +
+ (r cm)vm]
Armin Straub
[email protected]
Example 10. Is W =
n
a + 3b
2a b
o
: a, b in R a subspace of R2?
a + 3b
2a b
a
2a
3b
1
3
+
=a
+b
b
2
1
to see that
1
3
W = span
,
.
2
1
By the theorem, W is a vector space. Actually, W = R2.
Example 11. Is W =
matrices?
n
a 2b
a + b 3a
o
: a, b in R a subspace of M22, the space of 2 2
a 2b
a + b 3a
1 0
0 2
+b
= a
1 3
1 0
to see that
1 0
0 2
W = span
,
.
1 3
1 0
By the theorem, W is a vector space.
Armin Straub
[email protected]
Practice problems
Example 12. Are the following sets vector spaces?
o
n
a b
: a + 3b = 0, 2a c = 1
(a) W1 =
c d
No, W1 does not contain 0.
(b) W2 =
n
a + c 2b
b + 3c
c
Yes, W2 = span
n
: a, b, c in R
1 0
0 0
0 2
1 0
1 0
3 1
o
(c) W3 =
n
a
b
: ab > 0
3
1
o
2
4
1
3
is not in W3.
Armin Straub
[email protected]
Midterm!
Midterm 1: Thursday, 78:15pm
in 23 Psych if your last name starts with A or B
in Foellinger Auditorium if your last name starts with C, D, ..., Z
bring a picture ID and show it when turning in the exam
Review
A vector space is a set V of vectors which can be added and scaled (without leaving
the space!); subject to the usual rules.
W V is a subspace of V if it is a vector space itself; that is,
W contains the zero vector 0,
W is closed under addition,
(i.e. if u, v W th en u + v W )
(i.e. if u W and c R th en cu W )
span{v1,
, vm } is always a subspace of V .
n
Example 1. Is W =
matrices?
2a b 0
b
3
: a, b in R
(v1,
, vm are vectors in V )
n
2a b 0
b
3a
: a, b in R
Armin Straub
[email protected]
(b) W2 =
n
a + c 2b
b + 3c
c
Yes, W2 = span
n
: a, b, c in R
1 0
0 0
0 2
1 0
1 0
3 1
o
(c) W3 =
n
a + c 2b
b + 3c c + 7
We still have W3 =
: a, b, c in R
0 0
0 7
+ span
n
1 0
0 0
(more complicated)
0 0
0 7
0 2
1 0
1 0
3 1
o
is in the span.
(d) W4 =
n
a
b
: ab > 0
3
1
o
2
4
1
3
is not in W4.
Armin Straub
[email protected]
1 2
1
x=
1 3
3
1 2 1
1 3 3
Armin Straub
[email protected]
2 0 T
3 1 = 2 3 1
0 1 4
1 4
(A + B)T = AT + B T
(AB)T = B TAT
An m n matrix A has m rows and n columns.
The product Ax of matrix times vector is
| |
a1 a2
| |
|
x1
an
= x1a1 + x2a2 +
+ xnan.
|
xn
a b c
1 0 0
a + 3c b c
d e f 0 1 0 = d + 3f e f
3 0 1
g h i
g + 3i h i
row interpretation
1 0 0
a b c
a
b
c
0 1 0 d e f =
d
e
f
3 0 1
g h i
3a + g 3b + h 3c + i
row-column rule
(AB)i,j = (row i of A) (col j of B)
Armin Straub
[email protected]
=
c d
ad bc c a
Can compute A1 using GaussJordan method.
>
RREF
[A I]
(AT )1 = (A1)T
I A1
(AB)1 = B 1A1
An n n matrix A is invertible
A has n pivots
Ax = b has a unique solution
Gaussian elimination
Gaussian elimination can bring any matrix into an echelon form.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
a b c d
1 0 0
a
b
c
d
1 1 0 e f g h = e a f b g c h d
0 0 1
i j k l
i
j
k
l
We can continue row reduction to obtain the (unique) RREF.
Armin Straub
[email protected]
0
3 6 4 5
3 7
9
8 8
3 9 12 6 15
1 0 2 0 24
0 1 2 0 7
4
0 0
0 1
x = 24 + 2x3
1
x2 = 7 + 2x3
x
free
3
x4 = 4
1
2
1 1
2 1
1
4 6 0 = 2 1
8 2
1 1 1
2 7 2
1
2 0 0
to find 3 0 1
0 1 0
0 0
=
0 0 1 , we use GaussJordan:
3
1 0
2
1
1 0 0 2 0 0
2 0 0 1 0 0
3 0 1 0 1 0 R R E F 0 1 0 0 0 1
3
0 1 0 0 0 1
0 0 1 2 1 0
1
2
>
1
2
3
is a linear combination of
x1
x2
Armin Straub
[email protected]
1
1
1
and
1 1 1
1 2 2
1 0 3
1
2
0
if and only if
is consistent.
1
1
1
2 = x1 1 + x2 2 .)
3
1
0
Organizational
Interested in joining class committee?
meet 3 times to discuss ideas you may have for improving class
http://abstrusegoose.com/235
Armin Straub
[email protected]
Solving Ax = 0 and Ax = b
Column spaces
Definition 1. The column space Col(A) of a matrix A is the span of the columns of A.
If A = [ a1
2x y
W=
: x, y in R .
3y
7x + y
2x y
2
1
3y = x 0 + y 3 .
7x + y
7
1
Hence,
1
2 1
2
W = span 0 , 3 = Col 0 3 .
7
1
7 1
Armin Straub
[email protected]
Null spaces
Definition 3. The null space of a matrix A is
Nul(A) = {x : Ax = 0}.
In other words, if A is m n, then its null space consists of those vectors x R n which solve the
homogeneous equation Ax = 0.
Armin Straub
[email protected]
3 6 6 3 9
.
6 12 13 0 3
Solution.
3 6 6 3 9
6 12 13 0 3
>
R2R22R1
>
R1R12R2
>
1
R1 3 R1
3
0
1
0
1
0
6
0
2
0
2
0
6
1
2
1
0
1
3
9
6 15
1
3
6 15
13 33
6 15
From the RREF we read off a parametric description of the solutions x to Ax = 0. Note
that x2, x4, x5 are free.
x =
x1
x2
x3
x4
x5
x2
=
6x4 + 15x5
x4
x
2
13
33
1
0
0
= x2 0 + x4 6 + x5
15
0
1
0
0
0
1
In other words,
Nul(A) = span
2
1
0
0
0
13
0
6
1
0
33
0
15
0
1
Note. The number of vectors in the spanning set for Nul(A) as derived above (which
is as small as possible) equals the number of free variables in Ax = 0.
Armin Straub
[email protected]
1 3 3 2
1
1 3 3
2 6 9
1 3 3
parametric description of
R2R22R1
1
2 1
R3R3+R1
0
7 5
0
4 5
R3R32R2
1
0
0
1
R2 3 R2
1
0
0
R1R13R2
1
0
0
>
>
>
>
the solutions to Ax = b:
3 3 2 1
0 3 3 3
0 6 6 6
3 3 2 1
0 3 3 3
0 0 0 0
3 3 2 1
0 1 1 1
0 0 0 0
3 0 1 2
0 1 1 1
0 0 0 0
x1
2 3x2 + x4
x2
x2
x =
x 3 =
1 x4
x4
x4
Armin Straub
[email protected]
2
3
0
1
=
1 + x2 0
0
0
+ x4 0
1
elements of Nul(A)
xp
We can see nicely how every solution is the sum of a particular solution x p and solutions
to Ax = 0.
Note. A convenient way to just find a particular solution is to set all free variables to
zero (here, x2 = 0 and x4 = 0).
Of course, any other choice for the free variables will
in a particular solution.
result
For instance, x2 = 1 and x4 = 1 we would get
xp =
4
1
.
0
1
Practice problems
True or false?
The solutions to the equation Ax = b form a vector space.
No, with the only exception of b = 0.
(a) W =
(b) W =
(c) W =
x
y
z
x
y
z
: 5x = y + 2z
: 5x 1 = y + 2z
x
y
x+ y
: x, y in R
Armin Straub
[email protected]
1 3 5 0
.
0 1 4 2
Review
Every solution to Ax = b is the sum of a fixed chosen particular solution and some
solution to Ax = 0.
1
3 3 2
1
For instance, let A = 2
6 9 7 and b = 5 .
1 3 3 4
5
Every solution to Ax = b is of the form:
2 3x2 + x4
x1
x2
x2
x =
x3 =
1 x4
x4
x4
Is span
1
1
1
1 , 2 , 1
1
3
3
2
0
1 + x2
0
xp
1
+ x4
0
0
1
0
1
1
equal to R3?
Linear independence
Review.
span{v1, v2,
, vm } is the set of all linear combinations
c1v1 + c2v2 +
+ cmvm.
span{v1, v2,
, vm } is a vector space.
)
1
1
1
1 , 2 , 1
3
3
1
Example 1. Is span
equal to R3?
1 1 1
1 2 1 x : x in R3 .
1 3 3
Hence, the span is equal to R3 if and only if the system with augmented matrix
1 1 1 b1
1 2 1 b2
1 3 3 b3
Gaussian elimination:
1 1 1 b1
1 2 1 b2
1 3 3 b3
1
0
0
1
0
0
b1
1 1
1 2 b2 b1
2 4 b3 b1
1 1
b1
1 2
b2 b1
0 0 b3 2b2 + b1
1
1
1
1 , 2 , 1
3
3
1
span
1
1
1
1 = 3 1 + 2 2 .
3
1
3
( )
)
1
1
1
1
1
1 , 2 , 1 = span 1 , 2 .
3
1
3
3
1
Hence, span
We are going to say that the three vectors are linearly dependent because they
satisfy
1
1
1
3 1 + 2 2 1 = 0.
3
3
1
Definition 2. Vectors v1,
, v p are said to be linearly independent if the equation
x1v1 + x2v2 +
+ x pv p = 0
has only the trivial solution (namely, x1 = x2 =
= x p = 0).
Likewise, v1,
, vp are said to be linearly dependent if there exist coefficients x1,
, x p, not all zero,
such that
x1v1 + x2v2 +
+ x pvp = 0.
Armin Straub
[email protected]
Example 3.
Are the
1
1
1
vectors 1 , 2 , 1
1
3
3
independent?
1
x1 1 + x2
1
the equation
1
1
0
= 0
2 + x3 1
3
3
0
1 1 1
1 2 1 x = 0
1 3 3
has no free variables.
To find out, we reduce the matrix to echelon form:
1 1 1
1 1 1
1 1 1
1 2 1 0 1 2 0 1 2
1 3 3
0 2 4
0 0 0
Since there is a column without pivot, we do have a free variable.
Hence, the three vectors are not linearly independent.
To find a linear dependence relation, we solve this system.
Initial steps of Gaussian elimination are as before:
1 0 3 0
1 1 1 0
1 1 1 0
1 2 1 0
0 1 2 0 0 1 2 0
1 3 3 0
0 0 0 0
0 0 0 0
x3 is free. x2 = 2x3, and x1 = 3x3. Hence, for any x3,
1
1
1
0
3x3 1 2x3 2 + x3 1 = 0 .
3
3
1
0
Since we are only interested in one linear combination, we can set, say, x3 = 1:
1
1
1
0
3 1 2 2 + 1
= 0
1
3
3
0
Armin Straub
[email protected]
1
1
1
3 1 2 2 + 1 = 0,
1
3
3
can be written in matrix form as
1 1 1
3
1 2 1 2 = 0.
1 3 3
1
Hence, each linear dependence relation among the columns of a matrix A corresponds to a nontrivial solution to Ax = 0.
Theorem 4. Let A be an m n matrix.
The columns of A are linearly independent.
Ax = 0 has only the solution x = 0.
Nul(A) = {0}
A has n pivots.
1
1
1
vectors 1 , 2 , 2
1
3
3
1 1 1
1 1
1 2 2 0 1
1 3 3
0 2
independent?
1
1 1 1
3 0 1 3
4
0 0 2
Since each column contains a pivot, the three vectors are independent.
Example 6. (once again, short version)
Are the
1
1
1
vectors 1 , 2 , 1
1
3
3
independent?
1 1 1
1 1
1 2 1 0 1
1 3 3
0 2
1
1 1 1
2 0 1 2
4
0 0 0
Since the last column does not contain a pivot, the three vectors are linearly dependent.
Armin Straub
[email protected]
Special cases
A set of a single nonzero vector {v1} is always linearly independent.
Why? Because x1v1 = 0 only for x1 = 0.
A set of two vectors {v1, v2} is linearly independent if and only if neither of the
vectors is a multiple of the other.
Why? Because if x1v1 + x2v2 = 0 with, say, x2 0, then v2 = x1 v1.
x
If a set contains more vectors than there are entries in each vector, then the set is
linearly dependent. In other words:
Any set {v1,
, v p } of vectors in Rn is linearly dependent if p > n.
Why?
Example 7. With the least amount of work possible, decide which of the following sets
of vectors are linearly independent.
( )
(a)
3
9
2 , 6
1
4
Linearly independent, because the two vectors are not multiples of each other.
(b)
)
3
2
1
(c) columns
1 2 3 4
of 5 6 7 8
9 8 7 6
(d)
0
9
3
2 , 6 , 0
0
4
1
Armin Straub
[email protected]
Review
Vectors v1,
, v p are linearly dependent if
x1v1 + x2v2 +
+ x pv p = 0,
and not all the coefficients are zero.
Are the
1
1
1
vectors 1 , 2 , 1
1
3
3
independent?
1 1 1
1 2 1
1 3 3
1 1 1
0 1 2
0 2 4
1 1 1
0 1 2
0 0 0
Example 2. Let
1
e1 = 0 ,
0
0
e2 = 1 ,
0
0
e3 = 0 .
1
Solution.
Clearly, span{e1, e2, e3} = R3.
{e1, e2, e3} are independent, because
1 0 0
0 1 0
0 0 1
This definition makes sense because if V has a basis of p vectors, then every basis of V has p vectors.
Why? (Think of V = R 3.)
A basis of R 3 cannot have more than 3 vectors, because any set of 4 or more vectors in R 3 is linearly
dependent.
A basis of R 3 cannot have less than 3 vectors, because 2 vectors span at most a plane (challenge:
can you think of an argument that is more rigorous?).
1
0
0
basis 0 , 1 , 0
0
0
1
Example 5. Not all vector spaces have a finite basis. For instance, the vector space of
all polynomials has infinite dimension.
Its standard basis is 1, t, t2, t3,
This is indeed a basis, because any polynomial can be written as a unique linear combination:
p(t) = a0 + a1t +
+ antn for some n.
Recall that vectors in V form a basis of V if they span V and if they are linearly
independent. If we know the dimension of V , we only need to check one of these two
conditions:
Theorem 6. Suppose that V has dimension d.
A set of d vectors in V are a basis if they span V .
A set of d vectors in V are a basis if they are linearly independent.
Why?
If the d vectors were not independent, then d 1 of them would still span V . In the end, we
would find a basis of less than d vectors.
If the d vectors would not span V , then we could add another vector to the set and have d + 1
independent ones.
(a)
0
1
2 , 1
1
0
(b)
1
1
0
1
2 , 1 , 0 , 2
0
3
1
0
(c)
1
0
1
2 , 1 , 0
3
1
0
1 0
2 1
0 1
Hence, it is
1
1
0 0
0
3
1 0 1
0 1
1 2 0 1 2
0 0 5
1 3
Since each column contains a pivot, the three vectors are independent.
Hence, this is a basis of R 3.
Consider V = span{v1,
, v p }. If one of the vectors, say vk, in the spanning set is
a linear combination of the remaining ones, then the remaining vectors still span V .
True, vk is not adding anything new.
Armin Straub
[email protected]
Review
{v1,
, v p } is a basis of V if the vectors
span V , and
are independent.
The dimension of V is the number of elements in a basis.
The columns of A are linearly independent
each column of A contains a pivot.
Warmup
Example 1. Find a basis and the dimension of
a
+
b
+
2c
2a
+
2b
+
4c
+
d
W=
: a, b, c, d real.
b+c+d
3a + 3c + d
Solution.
First, note that
1
1
2 2
W = span
,
0 1
3
0
2
4
,
1
3
0
1
,
1
1
1 1 2 0
1 1 2 0
2 2 4 1 0 0 0 1
A =
0 1 1 1 0 1 1 1
3 0 3 1
0 3 3 1
1 1 2 0
0 1 1 1
0 3 3 1
0 0 0 1
1 1 2 0
1 1
0 1 1 1 0 1
0 0 0 4 0 0
0 0 0 1
0 0
first two.
2
1
0
0
0
1
4
0
Armin Straub
[email protected]
1
1
2
2
0 1
3
0
2
0
4 1
+ + 0
1 1
3
1
= 0.
1
1
2 2
is 0 , 1
0
3
0
1
,
1
1
and dim W = 3.
It follows from the echelon form that these vectors are independent.
Example 2. Consider
1
1
H = span
0 , 1 .
0
1
Solution.
The vectors are independent. By definition, they span H.
( )
Therefore,
1
1
0 , 1
1
0
is a basis for H.
In particular, dim H = 2.
( )
1
1
0 , 1
1
0
to contain 3 vectors.
Because a basis for R3 needs
0
0
1
is not in H.
0
1
1
0 , 1 , 0
1
1
0
is independent.
Armin Straub
[email protected]
3 6 6 3 9
6 12 15 0 3
x =
2
1
0
0
0
5
0
2
1
0
3
0
1
0
1
0
= x2
13
0
5
0
1
6 3
9
3 6 15
2 1 3
1 2 5
0 5 13
1 2 5
6
0
2
0
2
0
2
1
0
0
0
+ x4
5
0
2
1
0
+ x5
13
0
5
0
1
Better yet: note that the first vector corresponds to the solution with x2 = 1 and the other free
variables x4 = 0, x5 = 0. The second vector corresponds to the solution with x4 = 1 and the other
free variables x2 = 0, x5 = 0. The third vector
Hence,
2
1
0
0
0
5
0
2
1
0
Armin Straub
[email protected]
13
0
5
0
1
1
2
A =
3
4
Solution.
1
2
3
4
2 0 4
4 1 3
6 2 22
8 0 16
2 0 4
4 1 3
6 2 22
8 0 16
1
0
0
0
1
0
0
0
2 0 4
0 1 5
0 2 10
0 0 0
2 0 4
0 1 5
0 0 0
0 0 0
0
1
.
Hence, a basis for Col(A) is 23 , 1
Warning: For the basis of Col(A), you have to take the columns of A, not the columns
of an echelon form.
Row operations do not preserve the column space.
[For instance,
1
0
>
R1R2
Armin Straub
[email protected]
0
1
Review
{v1,
, v p } is a basis of V if the vectors span V and are independent.
To obtain a basis for Nul(A), solve Ax = 0:
>
1 2 0 5
0 0 1 2
2x2 5x4
x2
= x2
x =
2x4
x4
1
+ x4
0
0
5
0
2
1
3 6 6 3
6 12 15 0
RREF
Hence,
5
2
1 0
,
0 2
1
0
2 0 4
4 1 3
6 2 22
8 0 16
1
2
3
4
Hence,
0
1
2 1
3 , 2
0
4
>
1
0
0
0
2 0
4
0 1 5
0 0
0
0 0
0
1
0
>
R1R2
0
1
Armin Straub
[email protected]
(ATx)T = xTA = 0T .
1
2
A =
3
4
2 0 4
4 1 3
6 2 22
8 0 16
Solution. We know what to do for Col(A) from an echelon form of A, and we could
likewise handle Col(AT ) from an echelon form of AT .
But wait!
Instead of doing twice the work, we only need an echelon form of A:
1
2
3
4
Armin Straub
[email protected]
2 0 4
4 1 3
6 2 22
8 0 16
1
0
0
0
2 0 4
0 1 5
0 2 10
0 0 0
1
0
0
0
2 0 4
0 1 5
= B
0 0 0
0 0 0
0
1
2 1
is 3 , 2
0
4
Theorem 5.
0
1
2 0
by 0 , 1
5
4
(subspace of R m)
dim Col(AT ) = r
(subspace of R n)
dim Nul(A) = n r
(subspace of R n)
dim Nul(AT ) = m r
(# of free variables of A)
(subspace of R m)
In particular:
The column and row space always have the same dimension!
In other words, A and AT have the same rank.
Armin Straub
[email protected]
2 1 3 0
0 0 1 2 ,
0 0 0 7
Linear transformations
Throughout, V and W are vector spaces.
Definition 6. A map T : V W is a linear transformation if
T (cx + dy) = cT (x) + dT (y)
Example 8. Let Pn be the vector space of all polynomials of degree at most n. Consider
the map T : Pn Pn1 given by
T (p(t)) =
d
p(t).
dt
Armin Straub
[email protected]
Why?
Take any v in V .
1
0
1
= 2 ,
3
0
1
4
= 0 .
7
1
0
x1
0
1
for R2,
x2
1
0
0
0 , 1 , 0
0
0
1
y1
y2
for R3.
y3
0
0
1
1
T (x1) = 2 = 1 0 + 2 1 + 3 0
1
0
0
3
= 1y1 + 2y
3
2 + 3y
1
A = 2
3
4
T (x2) = 0 = 4y1 + 0y2 + 7y3
7
1 4
A = 2 0
3 7
Armin Straub
[email protected]
(We did not have time yet to discuss the next example in class, but it will be helpful if
your discussion section already meets Tuesdays.)
Example 11. As in the previous example, let V = R2 and W = R3. Let T be the (same)
linear map such that
T
1
0
1
= 2 ,
3
0
1
4
= 0 .
7
1
1
x1
1
2
x2
for R2,
1
0
0
1 , 1 , 0
1
0
1
y1
y2
for R3.
y3
T (x2)
1
1
0
=T
=T
+T
1
0
1
1
4
5
= 2 + 0 = 2
3
10
7
0
0
1
= 5 1 3 1 + 5 0
1
0
1
5
= 3
5
1
1
0
=T
= T
+ 2T
2
0
1
7
4
1
= 2 + 2 0 = 2
11
7
3
0
0
1
= 7 1 9 1 + 4 0
1
0
1
5
7
= 3 9
5
4
Armin Straub
[email protected]
Practice problems
Example 12. Suppose A =
1 2 3 4 1
2 4 7 8 1
fundamental subspaces of A.
Armin Straub
[email protected]
Linear transformations
A map T : V W between vector spaces is linear if
T (x + y) = T (x) + T (y)
T (cx) = cT (x)
Let A be an m n matrix.
T : Rn Rm defined by T (x) = Ax is linear.
T : Pn Pn1 defined by T (p(t)) = p (t) is linear.
The only linear maps T : R R are T (x) = x.
Recall that T (0) = 0 for linear maps.
x
Linear maps T : R2 R are of the form T
= x + y.
y
2x
For instance, T (x, y) = xy is not linear: T
2y
2T (x, y)
Example 1. Let V = R2 and W = R3. Let T be the linear map such that
T
What is T
0
4
=2
0
4
1
1
0
4
1
1
1
= 0 ,
4
1
1
1
= 2 .
0
+2
=T 2
1
1
2
4
2
1
1
1
1
+2 1
= 2T 1
+ 2T
= 0 + 4 = 4
1
1
8
0
8
Let x1,
, xn be a basis for V .
Write v = c1x1 +
+ cnxn.
By linearity of T ,
T (v) = T (c1x1 +
+ cnx) = c1T (x1) +
+ cnT (xn).
Armin Straub
[email protected]
Example 2.
The matrix A =
c 0
0 c
cx, i.e.
Example 3.
The matrix A =
0 1
1 0
x
y
y
x
, i.e.
Example 4.
The matrix A =
1 0
0 0
Armin Straub
[email protected]
Example 5.
The matrix A =
0 1
1 0
x
y
y
x
, i.e.
Let x1,
, xn be a basis for V , and y1,
, ym a basis for W .
The matrix representing T with respect to these bases
has n columns (one for each of the x j ),
x
y
y
x
Solution.
T 10 =
T 01 =
0
1
0
1
1
0
0 1
1 0
. Hence, A =
. Hence, A =
1
1
1
1
= 11 = 1 11 + 0 1
. Hence, B = 10
1
1
= 0 11 1
= 1
.
Hence,
B
=
1
1 0
0 1
1
0
1
= 2 ,
3
0
1
4
= 0 .
7
1
1
x1
1
2
x2
for R ,
0
0
1
1 , 1 , 0
0
1
1
y1
y2
for R3.
y3
1
1
0
=T
+T
1
0
1
1
4
5
= 2 + 0 = 2
3
7
10
1
0
0
= 5 1 3 1 + 5 0
1
0
1
5
B = 3
5
1
1
0
T (x2) = T
= T
+ 2T
2
0
1
1
4
7
= 2 + 2 0 = 2
3
7
11
1
0
0
= 7 1 9 1 + 4 0
1
0
1
5
7
B = 3 9
5
4
T (x1) = T
Practice problems
Example 9. Let T : R2 R2 be the map which rotates a vector counter-clockwise by
angle .
Which matrix A represents T with respect to the standard bases?
Verify that T (x) = Ax.
Solution. Only keep reading if you need a hint!
1
0
gets send to
Armin Straub
[email protected]
cos
sin
Review
A linear map T : V W satisfies T (cx + dy) = cT (x) + dT (y).
T : Rn Rm defined by T (x) = Ax is linear.
(A an m n m atrix)
= 1st
0
e1 =
column of A
Let x1,
, xn be a basis for V , and y1,
, ym a basis for W .
The matrix representing T w.r.t. these bases encodes in column j the coefficients of T (xj )
expressed as a linear combination of y1,
, ym.
For instance: let T : R 3 R 3 be reflection through the x-y-plane, that is, (x, y, z)
z).
The matrix representing T w.r.t. the basis
T
!
1
1 =
1
!
0
1 =
0
0
0
1
1
= 1 +0 1 2 0
1
1
0
1
1
0
0
0
1 , T 0 = 0
0
1
1
0
0
1
1 , 1 , 0
1
0
1
is
(x, y,
1 0 0
0 1 0 .
2 0 1
d
p(t).
dt
1, t, t2 for P2.
Armin Straub
[email protected]
0
The first column encodes T (1) = 0 and hence is 0 .
0
1
For the second column, T (t) = 1 and hence it is 0 .
0
0
2
For the third column, T (t ) = 2t and hence it is 2 .
0
0
For the last column, T (t3) = 3t2 and hence it is 0 .
3
0 1 0 0
A = 0 0 2 0 .
0 0 0 3
Note: By the way, what is the null space of A?
The null space has basis
1
0
0 .
0
3
0 1 0 0
1
0 0 2 0 1 = 0
0
21
0 0 0 3
7
1
0 in the standard basis
21
Armin Straub
[email protected]
3
1
0 .
7
is 1 + 21t2.
Orthogonality
The inner product and distances
Definition 2. The inner product (or dot product) of v, w in Rn:
v w = v Tw = v1w1 +
+ vnwn.
Because we can think of this as a special case of the matrix product, it satisfies the basic rules like
associativity and distributivity.
In addition: v w = w v.
1
1
1
2 1 = [ 1 2 3 ] 1 = 1 2 6 = 7.
2
2
3
Definition 4.
The norm (or length) of a vector v in Rn is
p
kv k =
v v = v12 +
+ vn2 .
This is the distance to the origin.
vw
dist(v, w) = kv wk.
w
Example 5. For instance, in R2,
x1 x2
x2
x1
=
,
dist
y1 y2
y2
y1
Armin Straub
[email protected]
p
= (x1 x2)2 + (y1 y2)2 .
Orthogonal vectors
Definition 6. v and w in Rn are orthogonal if
v w = 0.
How is this related to our understanding of right angles?
Pythagoras:
vw
v v + w w = (v w) (v w)
vv 2vw+ww
vw=0
1
2
2
1
1
2
2
1
2
1
(b) 2 , 1
1
1
1
2
2 1 = 1 (2) + 2 1 + 1 1 = 1.
1
1
Armin Straub
[email protected]
So not orthogonal.
Review
v w = v Tw = v1w1 +
+ vnwn, the inner product of v, w in Rn
p
Length of v: kv k = v v = v12 +
+ vn2
Distance between points v and w: kv wk
Example 1. The
0
0
1
vectors 0 , 1 , 0
1
0
0
, cn = 0.
1 2
A = 2 4 .
3 6
Nul(A) = span
n
2
1
1
2
=0
1 2 1
A = 2 4 0 .
3 6 0
Solution.
1 2 1
2 4 0
3 6 0
)
Nul(A) = span
1 2 1
0 0 2
0 0 3
1 2 0
RREF
0 0 1
0 0 0
>
2
1
0
Col(AT ) = span
)
1
0
2 , 0
0
1
1
2
1 2 = 0,
0
0
Note:
2
Because 1 is
0
1 2 1
A = 2 4 0 .
3 6 0
2
Nul(A) = span 1 ,
0
Armin Straub
[email protected]
0
1
Col(AT ) = span 2 , 0
1
0
Because
0
1
2
, 2 , 0 are
1
1
0
0
Remark 7. Recall that, for an m n matrix A, Nul(A) lives in Rn and Col(A) lives
in Rm. Hence, they cannot be related in a similar way.
In the previous example, they happen to be both subspaces of R3:
2
Nul(A) = span 1 ,
0
But these spaces are not
Theorem 8.
orthogonal:
1
1
Col(A) = span 2 , 0
3
0
1
2
0
1
0
0
0
(both subspaces of R n)
Armin Straub
[email protected]
Review
v and w in Rn are orthogonal if v w = v1w1 +
+ vnwn = 0.
This simple criterion is equivalent to Pythagoras theorem.
Nonzero orthogonal vectors are independent.
1 2
1 2 T
2
1
Nul 2 4 = span
, Col 2 4 = span
1
2
3 6
3 6
(A an m n matrix)
(both subspaces of R n)
= nr
(in R m)
1
to 1
1
0
and 1 .
1
1 0 T
which has
(
span
0
basis: 1 .
1
)
0
1
1
1 0
1 1
1 1
1 1
1 1
Armin Straub
[email protected]
1
to 1
1
0
and 1 .
1
0
1
1 x = 0 and 1 x = 0
1
1
1 1 1
0
x=
0 1 1
0
1 1 1
x in Nul
0 1 1
Example 2. Let V =
a
b
c
: a + b = 2c .
1
complement: 1
2
1
a
b 1 = 0.
2
c
)
1
1 .
2
A new perspective on Ax = b
Ax = b is solvable
b is in Col(A)
b is orthogonal to Nul(AT )
(direct approach)
(indirect approach)
Armin Straub
[email protected]
Example 3. Let
1 2
A = 3 1 .
0 5
Solution. (old)
1 2 b1
3 1 b2
0 5 b3
So, Ax = b is consistent
1 2
b1
0 5 3b1 + b2
b3
0 5
1 2
b1
0 5
3b1 + b2
0 0 3b1 + b2 + b3
3b1 + b2 + b3 = 0.
b orthogonal to Nul(AT )
1 3 0
2 1 5
>
RREF
1 0 3
0 1 1
3
We conclude that Nul(A ) has basis 1 .
1
3
Ax = b is solvable
b 1 = 0. As above!
1
Motivation
Example 4. Not all linear systems have solutions.
In fact, for many applications, data needs to be fitted and there is
no hope for a perfect match.
For instance, Ax = b with
1 2
1
x=
2 4
2
has no solution:
n o
1
Ax
b
Armin Straub
[email protected]
2
1
1,
Ai,j = +1,
0,
2
1
A =
1 1
0
1 0
1
0 1 1
0 1 0
0
0 1
0
0
0
1
1
Armin Straub
[email protected]
Review
A graph G can be encoded by the edge-node incidence matrix:
1 1
0
0
1
2
1 0
1
0
A = 0 1 1
0
0 1 0
1
0
0 1 1
2
3
4
each column represents a node
0, otherwise.
Meaning of the null space
The x in Ax is assigning values to each node.
You may think of assigning potentials to each node.
1 1
0
1 0
1
0 1 1
0 1 0
0
0 1
0
0
0
1
1
x1 + x2
x1
x1 + x3
x2
x3 = x2 + x3
x2 + x4
x4
x3 + x4
1
1
So: Ax = 0
nodes connected by an edge are assigned the same value
Armin Straub
[email protected]
basis 11 .
1
1
0
0 1
basis: 1 , 0
0
1
1 0 1 0
0 1 0 1
In general:
dim Nul(A) is the number of connected subgraphs.
For large graphs, disconnection may not be apparent visually.
But we can always find out by computing dim Nul(A) using Gaussian elimination!
1 1
0
1 0
1
A =
0
1
1
0 1 0
0
0 1
1 1 0
0
0
1
0 1 1 0
0
1
1
0 1
0
0
0
1
1
y1
y2
y3
y4
y5
each edge.
T =
,
A
0
1
1
1 1 0
0
0
1
0 1 1 0
0
1
1
0 1
0
0
0
1
1
y1 y2
y1 y3 y4
=
y2 + y3 y5
y4 + y5
Armin Straub
[email protected]
So: ATy = 0
at each node, (directed) values assigned to edges add to zero
Correspondingly,
1
1
1
0
0
and
0
0
1
1
1
>
1 1 0 0 0
1 0 1 1 0
0 1 1 0 1
0 0 0 1 1
y3 y5
y3 + y5
y3
y5
y5
1
1
1
1
1
, 0
1
0
0
1
0 1 0 1
1 1 0 1
0 0 1 1
0 0 0 0
RREF 0
0
0
2
1
0
0
1
1
1
as
1
1
1
0
0
1
1
0
1
1
In general:
dim Nul(AT ) is the number of (independent) loops.
For large graphs, we now have a nice way to computationally find all loops.
Armin Straub
[email protected]
Practice problems
Example 3. Give a basis for Nul(AT ) for the following graph.
1 1
1 0
A = 0 1
0
1
0
1
1
0
0
0
.
0
1
(a) Draw the corresponding directed graph with numbered edges and nodes.
(b) Give a basis for Nul(A) and Nul(AT ) using properties of the graph.
Armin Straub
[email protected]
1 1
1 0
A = 0 1
0
1
2
1
0
1
1
0
0
0
.
0
1
Solution.
If Ax = 0, then x1 = x2 = x3 = x4 (all connected by edges).
Nul(A) has the
basis: 11 .
1
1
1
.
basis: 1
Armin Straub
[email protected]
Directed graphs
Go from directed graph to edge-node incidence matrix A and vice versa.
Basis for Nul(A) from connected subgraphs.
For each connected subgraph, get a basis vector x that assigns 1 to all nodes in that subgraph,
and 0 to all other nodes.
Example 1.
Basis for
Basis for
Nul(A): 11
1
1
1
Nul(AT ): 1
0
0
2
1
0
0
1
1
1
Fundamental notions
Vectors v1,
, vn are independent if the only linear relation
c1v1 +
+ cnvn = 0
is the one with c1 = c2 =
= cn = 0.
How to check for independence?
The columns of a matrix A are independent
Nul(A) = {0}.
Vectors v1,
, vn in V are a basis for V if
Armin Straub
[email protected]
Subspaces
From an echelon form of A, we get bases for:
Nul(A) by solving Ax = 0
Col(A) by taking the pivot columns of A
Col(AT ) by taking the nonzero rows of the echelon form
Example 2.
1
2
A =
3
4
Basis for
Basis for
Basis for
0
1
Col(A): 23 , 1
2
0
4
0
1
Col(AT ): 20 , 01
5
4
4
2
1 0
Nul(A): 0 , 5
1
0
2 0 4
4 1 3
RREF
6 2 22
8 0 16
>
1
0
0
0
2
0
0
0
0
1
0
0
4
5
0
0
Dimension of Nul(AT ): 2
(a) V = bc : a + 2b = 0, a + b + d = 0
Armin Straub
[email protected]
(b) V
: a, b, c in R
a+bc
= 2a +
3c
Solution.
First step: express these subspaces as one of the four subspaces of a matrix.
1 2 0 0
(a) V = Nul 1 1 0 1
(b) V = Col
1
0
2
0
1 1
1 0
0 3
0 1
basis for V : 01 ,
0
1
0
row reductions: 2
0
(b)
1 1
1 0
0 3
0 1
2 0 0
1 0 1
2
1
0
1
1 2 0 0
0 1 0 1
1 0 0 2
0 1 0 1
1 1 1
0 1
0
0 2 5
0 0
1
(no need to continue; we already see that the columns are independent)
basis for V
1
1
0 1
: 2 , 0
0
0
1
0
,
3
1
Use the fundamental theorem to find bases for the orthogonal complements.
1 2 0 0 T
(a) V = Col 1 1 0 1
note the two rows are clearly independent.
1
1
basis for V : 20 , 10
1
0
1 1 1 T
V = Nul 02 10 03 = Nul
0 0 1
1 0 2 0
row reductions: 1 1 0 0
1 0 3 1
2/5
(b)
Armin Straub
[email protected]
!
1 0 2 0
1 1 0 0
1 0 3 1
1 0 2 0
0 1 2 0
0 0 5 1
1 0 0 2/5
0 1 0 2/5
0 0 1 1/5
Linear transformations
Example 5. Let T : R2 R3 be the linear map represented by the matrix
1 0
2 1
3 0
with respect to the bases
(a) What is T 11 ?
0
1
1
1
of
1
1
0
R2 and 1 , 0 , 1
0
1
1
of R3.
1
1
T
= 1
= 0
1
1
1 + 2 0 + 3
1
0
1
1
1 + 1 0 + 0
0
1
1
(a) Note that 11 = 2 01 + 1
.
1
= 2T 01 + T
Hence, T 1
1
(b) Note that 10 = 01 + 1
.
0
1
Hence, T 0 = T 1 + T
Armin Straub
[email protected]
1
1
0
1
4 3
by 4 4
6 5
1
1
3
= 4 .
5
0
1 =
1
0
1 =
1
3
4
5
1
0
1
7
1
3
= 2 4 + 0 = 8 .
11
1
5
4
1
3
= 4 + 0 = 4 .
6
1
5
The columns of an n n matrix are independent if and only if the rows are.
Armin Straub
[email protected]
We can deal with complicated linear systems, but what to do if there is no solutions
and we want a best approximate solution?
This is important for many applications, including fitting data.
Recall: if v1,
, vn are (pairwise) orthogonal:
v1 (c1v1 +
+ cnvn) = c1v1 v1
Implies: the v1,
, vn are independent (unless one is the zero vector)
Orthogonal bases
Definition 1. A basis v1,
, vn of a vector space V is an orthogonal basis if the
vectors are (pairwise) orthogonal.
0
0
1
basis 0 , 1 , 0
1
0
0
0
1
1
vectors 1 , 1 , 0
1
0
0
Solution.
Armin Straub
[email protected]
1
1
0
1
1
0
1
1
0
1
1
0
0
0
1
0
0
1
=0
=0
=0
Note that we do not need to check that the three vectors are independent. That follows
from their orthogonality.
Example 4. Suppose v1,
, vn is an orthogonal basis of V , and that w is in V . Find
c1,
, cn such that
w = c1v1 +
+ cnvn.
Solution. Take the dot product of v1 with both sides:
v1 w = v1 (c1v1 +
+ cnvn)
= c1v1 v1 + c2v1 v2 +
+ cnv1 vn
= c1v1 v1
Hence, c1 =
v1 w
v w
. In general, c j = j
.
v1 v1
vj vj
If v1,
, vn is an orthogonal basis of V , and w is in V , then
w = c1v1 +
+ cnvn
Example 5.
3
Express 7
4
in terms of the
with
cj =
w vj
.
vj vj
0
1
1
basis 1 , 1 , 0 .
1
0
0
Solution.
0
1
1
3
7 = c1 1 + c2 1 + c3 0
1
0
4
0
3
1
7 1
0
4
=
1
1
1 1
0
0
1
1
0
3
7
+ 4
1
1
0
1
1
0
4
10
4
=
1 + 1 + 0
2
2
1
0
0
1
Armin Straub
[email protected]
1
1
0
1
1
0
1
1
0
3
7
+ 4
0
0
1
0
0
1
0
0
1
0
0
1
1
0
0
basis 0 , 1 , 0
0
0
1
If v1,
, vn is an orthonormal basis of V , and w is in V , then
w = c1v1 +
+ cnvn
Example 8.
3
Express 7
4
in terms of the
with
c j = v j w.
0
0
1
basis 0 , 1 , 0 .
1
0
0
0
0
1
3
7 = 3 0 + 7 1 + 4 0
1
0
0
4
3
1
7 0 = 3,
4
0
3
0
7 1 = 7,
4
0
0
1
1
1 , 1 , 0
1
0
0
3
0
7 0 = 4.
4
1
1
1
0
1
1
0
0
0
1
has length
1
1
1 1 = 2
0
0
has length
has length
1
1
1 1 = 2
0
0
0
0
0 0 = 1
1
1
Armin Straub
[email protected]
normalized:
normalized:
1
1
1
2
0
1
1
1
2 0
0
is already normalized: 0
1
0
1
1
1
1
is 1 , 1 , 0 .
2 0
2
1
0
Example 10.
3
Express 7
4
1 1 1 1 0
1 ,
1 , 0 .
2 0
2
1
0
Solution.
3
1
4
7 1 1 =
,
2
2
4
0
3
1
10
7 1 1 =
,
2 0
2
4
0
3
7 0 = 4.
1
4
0
3
1
1
4 1
10 1
7 =
1 + 1 + 4 0
2 2
2 2 0
1
4
0
Orthogonal projections
xy
It follows that c = y y .
wanted
8
4
onto y =
3
1
Solution.
x y
8 3 + 4 1 3
3
6
x =
y=
= 2
=
1
1
2
yy
32 + 12
The component of x orthogonal to y is
8
6
2
x x =
=
.
4
2
6
(Note that, indeed
2
6
Armin Straub
[email protected]
and
3
1
are orthogonal.)
Example
13. What
are the orthogonal projections of
0
1
1
1 , 1 , 0 ?
1
0
0
2
1
1
Solution.
2
1
1
2
1
1
2
1
1
1
1
1
2 1 + 1 (1) + 1 0
1
on 1 : 12 + (1)2 + 02 1 = 2 1
0
0
0
1
3 1
21+11+10 1
on 1 : 12 + 12 + 02 1 = 2 1
0
0
0
0
0
20+10+11 0
on 0 : 02 + 02 + 12 0 = 0
1
1
1
1
3 1
1
Note that these sum up to 2 1 + 2 1 +
0
0
2
0
0 = 1 !
1
1
Recall: If v1,
, vn is an orthogonal basis of V , and w is in V , then
w = c1v1 +
+ cnvn
with
cj =
w vj
.
vj vj
Armin Straub
[email protected]
Comments on midterm
Suppose V is a vector space, and you are asked to give a basis.
CORRECT: V has
1
1
basis 1 , 0
1
0
1
1
1 , 0
1
0
OK: V = span
1
1
1 , 0
1
0
(but you really should point out that the two vectors are independent)
( )
1
1 ,
0
1 1
basis = 1 0
0 1
INCORRECT: V =
INCORRECT:
1
0
1
Review
Orthogonal projection of x onto y:
x =
Example 1.
x y
y.
yy
Error x = x x is orthogonal to y.
If y1,
, yn is an orthogonal basis of V , and x is in V ,
then
x yj
x = c1 y1 +
+ cn yn
with c j =
.
yj yj
x decomposes as the sum of its projections onto each vector
in the orthogonal basis.
2
Express 1
1
x
in terms of the
1
0
1
basis 1 , 1 , 0 .
0
0
1
y1
y2
y3
Armin Straub
[email protected]
2
1
1
0
1 = c1 1 + c2 1 + c3 0
1
0
0
1
1
2
1 1
0
1
=
1
1
1 1
0
0
1
1 +
0
projection of x onto y1
1
2
1 1
0
1
1
1
1 1
0
0
projection
1
1
0
3
1
= 1 + 1 + 0
2
2
0
0
1
0
2
1 0
1
1
0
0
0 0
1
1
1
1 +
0
of x onto y2
0
0
1
projection of x onto y3
in W
x
x
v1
x
v2
is the orthogonal projection of x onto W .
x
is the point in W closest to x. For any other y in W , dist(x, x
) < dist(x, y).
x
If v1,
, vm is an orthogonal basis of W , then
=
x
x v1
x vm
v1 +
+
vm.
v1 v1
vm vm
is determined, x = x x
.
Once x
(This is also the orthogonal projection of x onto W .)
)
0
3
0 , 1 ,
0
1
and
0
x = 3 .
10
Solution.
Note that
3
w1 = 0
1
and
0
w2 = 1
0
x w1
w1 +
w1 w1
3
0
3 0
10
1
x w2
w2 =
3
3
w2 w2
0 0
1
1
3
0
1
0
0
3 1
+ 1 0 0
0
0
1 1
0
0
0
1
0
3
0
3
10
=
0 +3 1 = 3
10
1
0
1
3
3
0
x = 3 3 = 0 .
9
1
10
Note: Indeed,
3
0
9
Hence,
3
0
3
x = 3 = 3 + 0 .
1
10
9
in W
is orthogonal to w1 =
3
0
1
and
in W
0
w2 = 1 .
0
x =
x v1
x vm
v1 +
+
vm
v1 v1
vm vm
is linear. The matrix P representing W with respect to the standard basis is the
corresponding projection matrix.
Example 5. Find
matrix P which corresponds to orthogonal projection
( the projection
)
0
3
0 , 1
0
1
onto W = span
in R3.
0
0
1
: 0 , 1 , 0 .
1
0
0
3
1
0 0
1
0
3
3
0 0
1
1
3
0 +
1
0
1
0 1
0
0
0
0
1 1
0
0
Armin Straub
[email protected]
0
3
3
1 = 0 .
10
0
1
1
of 0 :
0
Hence P =
9
10
3
10
0
The second column of P encodes the projection of 1 :
0
0
0
3
0
1 1
9
1 0
0
0
3
0
10
0
0
1
0
1 = 1 . Hence P = 0
0 +
0
0
3
3
3
1 1 0
0 0 1
0
0
10
0
0
1
1
0
The third column of P encodes the projection of 0 :
1
0
0
3
0
9
0 1
0 0
0
3
0
3
10
0
1
1
1
1
0 . Hence P = 0 1
1 =
0 +
0
0
3
3
10
3
1 1 0
0 0 1
1
0
10
3
10
0
.
1
10
Example 6. (again)
Find the orthogonal projection of
Solution. x = Px =
9
10
0
3
10
0
1
0
0
3
0 , 1 .
0
1
0
x = 3
10
onto W = span
3
0
= 3 ,
0
3
1
1
10
3
10
10
9
10
3
10
9
10
3
10
9
10
0
0
0 1 0 0 1 0 = 0
1
1
3
3
3
0 10
0 10
10
10
10
0
1
0
3
10
1
10
Practice problems
Example 8. Find the closest point to x in span{v1, v2}, where
2
4
x =
0 ,
2
1
1
v1 =
0 ,
0
1
0
v2 =
1 .
1
Armin Straub
[email protected]
Review
Let W be a subspace of Rn, and x in Rn
x
x
v1
x
v2
If v1,
, vm is an orthogonal basis of W , then
=
x
x v1
x vm
v1 +
+
vm.
v1 v1
vm vm
proj. o f x on to v1
pro j. of x on to vm
in W
Least squares
Definition 1. x is a least squares solution of the system Ax = b if x is such that
Ax b is as small as possible.
If Ax = b is consistent, then a least squares solution x is just
an ordinary solution.
b = 0)
(in that case, Ax
Idea. Ax = b is consistent
b is in Col(A)
Ax
So, if Ax = b is inconsistent, we
replace b with its projection b onto Col(A),
and solve Ax = b.
(consistent
Armin Straub
[email protected]
b
by construction!)
1 1
A = 1 1 ,
0 0
2
b = 1 .
1
1
2
1 1
0
1
b =
1
1
1 1
0
0
1
1
0
1
2
1 1
+ 1 0
1
1
1 1
0
0
1
1
1
2
1
3
1 = 1 + 1 = 1 .
2
2
0
0
0
0
1/2
3/2
Proof.
G
FTLA
Ax b is as small as possible
Ax b is orthogonal to Col(A)
Ax b is in Nul(AT )
AT (Ax b) = 0
ATAx = ATb
Armin Straub
[email protected]
1 1
A = 1 1 ,
0 0
2
b = 1 .
1
Solution.
AT A =
1 1
1 1
ATb =
1
1
1
0
1
0
0
1 0
1 0
1
1
0
2
1
1
2 0
0 2
1
3
1/2
3/2
2 0
1
=
x
.
0 2
3
2
b = 0 .
11
4 0
A = 0 2 ,
1 1
4 0
4 0 1
ATA =
0 2
0 2 1
1 1
2
4 0 1
ATb =
0
0 2 1
11
17 1
1 5
19
11
Solving, we find x =
1
2
17 1
19
=
x
.
1 5
11
4
4 0
1
Ax = 0 2 2 = 4 .
3
1 1
Armin Straub
[email protected]
(columns of A independent)
b = A(ATA)1ATb.
Hence, the projection matrix for projecting onto Col(A) is
P = A(ATA)1AT .
4
2
0
0
Example 6. Find 1, 2 such that the line y = 1 + 2x best fits the data points (2, 1),
(5, 2), (7, 3), (8, 3).
Solution. The equations yi = 1 + 2xi in matrix form:
1
1
1
1
x1
y1
x2
y2
x3
2
y3
x4
y4
d esign m atrix X
Armin Straub
[email protected]
ob servatio n
vector y
1
1
1
1
X TX
1 1
2 5
X Ty =
Solving
4 22
22 142
9
57
1
2
2
5
7
8
1
2
1
2 = 3 .
3
1 2
1 1
1 5 =
7 8
1 7
1 8
1
1 1 1
2 =
5 7 8
3
3
, we find
2
1
2
2/7
5/14
4 22
22 142
9
57
4
2
0
0
Armin Straub
[email protected]
perimeter = 4
perimeter = 4
perimeter =
perimeter =
perimeter = 4
perimeter = 4
perimeter = 4
perimeter =
perimeter =
perimeter =
=4
Happy Halloween!
Armin Straub
[email protected]
Review
G
4
2
0
0
Comment . As usual in practice, we are minimizing the (sum of squares of the) vertical offsets:
http://mathworld.wolfram.com/LeastSquaresFitting.html
Armin Straub
[email protected]
1
1
1
1
x1
y1
y2
x2
=
y3
x3
2
x4
y4
d esign m atrix X
ob servatio n
vector y
1
1
1
1
X TX =
1 1
2 5
X Ty =
Solving
4 22
22 142
9
57
1
2
2
5
7
8
1
1
2
2 = 3 .
3
1
2
1 1
1 5 =
7 8
1 7
1 8
1
1 1 1
2 =
5 7 8
3
3
, we find
2
1
2
2/7
5/14
4 22
22 142
9
57
4
2
0
0
How well does the line fit the data (2, 1), (5, 2), (7, 3), (8, 3)?
How small is the sum of squares of the vertical offsets?
Armin Straub
[email protected]
(yi (1 + 2xi))2
error at (xi ,yi)
where y = n
(yi y)2,
coefficient of determination: R2 = 1 SS r e s
tot
R2
Here, y = 9/4:
R2 =
1
=1
2
7
+ 14 2
2
0.075
= 0.974
2.75
very close to 1
2
2
2
5
5
5
2
2
2
+ 2 7 + 14 5
+ 3 7 + 14 7
+ 3 7 + 14 8
9 2
9 2
9 2
9 2
1 4 + 2 4 + 3 4 + 3 4
good fit
Other curves
We can also fit the experimental data (xi , yi) using other curves.
Example 2. yi 1 + 2xi + 3x2i with parameters 1, 2, 3.
The equations yi = 1 + 2xi + 3x2i in matrix form:
1 x1 x21
y1
1
y2
1 x2 x22
2 =
y3
1 x3 x23
3
desig n m atrix X
observation
vector y
Given data (xi , yi), we then find the least squares solution to X = y.
Multiple linear regression
In statistics, linear regression is an approach for modeling the relationship between a scalar dependent variable and one or more explanatory
variables.
The case of one explanatory variable is called simple linear regression.
For more than one explanatory variable, the process is called multiple
linear regression.
http://en.wikipedia.org/wiki/Linear_regression
The experimental data might be of the form (vi , wi , yi), where now the dependent
variable yi depends on two explanatory variables vi , wi (instead of just one xi).
Armin Straub
[email protected]
y1
1 v 1 w1
y2
1 v 2 w2 1
1 v 3 w3 2 = y 3
3
design m atrix
o bservation
vector
Review
x
x
v1
x
v2
Suppose v1,
, vm is an orthonormal basis of W .
The orthogonal projection of x onto W is:
=
x
hx, v1iv1
+
+
proj. o f x on to v1
hx, vm ivm
pro j. of x on to vm
(To stay agile, we are writing hx, v1i = x v1 for the inner product.)
GramSchmidt
2
1
0
, 1
0 0
0
0
1
1
,
1 .
Armin Straub
[email protected]
b1
kb1k
b
q2 = 2
kb2k
b
q3 = 3
kb3k
q1 =
2
1
0
, 1
0 0
0
0
Solution.
2
2
1 1
b2 =
0 h 0
0
0
1
1
1
1
, q iq h
1 1 1 1
1
1
1
1
b3 =
1 h
1
1
0
b1 =
0
0
0
1
, q1iq1 =
0
0
0
, q2iq2 =
1
1
1
,
1 .
q1 =
q2 =
1
0
0
0
0
1
0
0
0
1 0
q3 =
2 1
1
1
0
0 1
,
0 0
0
0
Armin Straub
[email protected]
0
1 0
, .
2 1
1
Review
Vectors q1,
, qn are orthonormal if
qiTqj =
0, if i j ,
1, if i = j.
GramSchmidt orthonormalization:
b2
b1 = a1,
q1 =
b2 = a2 ha2, q1iq1,
b3 = a3 ha3, q1iq1 ha3, q2iq2,
a1
a2
1
1
1
vectors 2 , 1 , 1 .
1
0
2
Solution.
1
b1 = 2 ,
2
1
1
2
1
1
1
1
1
b2 = 1 h 1 , 2 i 2 = 1 ,
3
3
3
2
2
2
0
0
1
1
1
2
1
b3 = 1 h 1 , q1iq1 h 1 , q2iq2 =
= 2 ,
9
1
1
1
1
q
1
=
1
1
2
3
2
q
=
2
2
1
1
3
2
=
q
3
2
1
2
3
1
2
2
1 1
1
1
2 , 1 , 2 .
3
3
3
2
2
1
Armin Straub
[email protected]
0, if i j ,
1, if i = j.
T
q1
1 0 0
| |
q1 q2 = 0 1 0
q2T
| |
0 0
An n n matrix Q is orthogonal
In other words, Q1 = QT .
Example 4. P
0 0 1
= 1 0 0
0 1 0
QTQ = I
is orthogonal.
Example 5. Q =
cos sin
sin cos
Q is orthogonal because:
cos
sin
sin
cos
is an orthonormal basis of R2
Just to make sure: why length 1? Because
Alternatively: QTQ =
Example 6. Is H =
1 1
1 1
cos sin
sin cos
cos
sin
p 2
= cos + sin 2 = 1.
cos sin
sin cos
1 0
0 1
orthogonal?
1 1
1 1
is an orthogonal matrix.
Just for fun: a n n matrix with entries 1 whose columns are orthogonal is called a Hadamard
matrix of size n.
A size 4 example:
H H
H H
1 1
1
1
1 1 1 1
= 1 1 1 1
1 1 1 1
(columns independent)
1 2 4
A = 0 0 5 .
0 3 6
Solution.
We apply GramSchmidt to the columns of A:
1
0
0
2
0
3
4
5
6
q1
2
h 0 ,
3
4
h 5 ,
6
0
q1iq1 = 0 ,
3
4
q1iq1 h 5 ,
6
0
0 = q2
1
0
q2iq2 = 5 ,
0
0
1 =
0
q3
1 0 0
Hence: Q = [ q1 q2 q3 ] = 0 0 1
0 1 0
To find R in A = QR,
note that QTA = QTQR = R.
1 0 0
1 2 4
1 2 4
R = 0 0 1 0 0 5 = 0 3 6
0 1 0
0 3 6
0 0 5
Summarizing, we have
1 2 4
1 0 0
1 2 4
0 0 5 = 0 0 1 0 3 6 .
0 3 6
0 1 0
0 0 5
Recipe. In general, to obtain A = QR:
GramSchmidt on (columns of) A, to get (columns of) Q.
Then, R = QTA.
Armin Straub
[email protected]
|
|
a1 a2
|
|
| |
= q1 q2
| |
q2Ta2 q2Ta3
q3Ta3
Practice problems
Example 8. Complete
1 1
1 2
2 , 1
3
3
2
2
(a) by using the FTLA to determine the orthogonal complement of the span you already
have
(b) by using GramSchmidt after throwing in an independent vector such
Example 9. Find the QR decomposition of
Armin Straub
[email protected]
1
as 0
0
1 1 2
A = 0 0 1 .
1 0 0
Review
Let A be an m n matrix of rank n.
(columns independent)
To obtain
| |
a1 a2
| |
| |
= q1 q2
| |
q2Ta2 q2Ta3
q3Ta3
(actually unnecessary!)
QRx = b
Rx = QTb
Example 2. The QR decomposition is very useful for solving least squares problems:
ATAx = ATb
(QR)TQRx = (QR)Tb
=RTQTQR
T
T
R Rx = R QTb
Rx = QTb
Armin Straub
[email protected]
civi =
hx, vi i
vi
hvi , vi i
projection
of x onto vi
sin (x)
sin (2x)
sin (3x)
Armin Straub
[email protected]
function
5
7
The functions
Example 5. Show that cos (x) and sin (x) are orthogonal.
Solution.
hcos (x), sin (x)i =
cos (x)sin(x)dx =
0
1
(sin (x))2
2
2
=0
More generally, 1, cos (x), sin (x), cos (2x), sin (2x),
are all orthogonal to each other.
Armin Straub
[email protected]
cos (x)cos(x)dx =
0
Example 7. The same calculation shows that cos (kx) and sin (kx) have norm
well.
as
Solution.
hf (x), cos (x)i
1
a1 =
=
hcos (x), cos (x)i
f (x)cos(x)dx
0
where
hf (x), cos (kx)i
ak =
=
hcos (kx), cos (kx)i
hf (x), sin (kx)i
bk =
=
hsin (kx), sin (kx)i
hf (x), 1i
=
a0 =
h1, 1i
Armin Straub
[email protected]
Z
1 2
f (x)cos(kx)dx,
0
Z 2
1
f (x)sin(kx)dx,
0
Z 2
1
f (x)dx.
2 0
Example 9. Find the Fourier series of the 2-periodic function f (x) defined by
f (x) =
1, for x (, 0),
+1, for x (0, ).
2
0
and
(why?!)
1
f (x)dx = 0
2
Z
1
f (x)cos(nx)dx
Z 0
Z
1
cos (nx)dx +
cos (nx)dx = 0
0
Z
1
f (x)sin(nx)dx
Z 0
Z
1
sin (nx)dx +
sin (nx)dx
0
Z
2
sin (nx)dx
0
2
1
cos(nx)
n
0
2
[1 cos (n)]
n
(
Z
2
[1 (1)n] =
n
4
n
if n is odd
if n is even
In conclusion,
4
1
1
1
f (x) =
sin (x) + sin(3x) + sin(5x) + sin(7x) +
.
5
7
3
Armin Straub
[email protected]
Review
An inner product for 2-periodic functions:
R 2
hf , gi = 0 f (x)g(x)dx
where
hf (x), cos (kx)i
=
hcos (kx), cos (kx)i
hf (x), sin (kx)i
=
bk =
hsin (kx), sin (kx)i
hf (x), 1i
a0 =
=
h1, 1i
ak =
Z
1 2
f (x)cos(kx)dx,
0
Z
1 2
f (x)sin(kx)dx,
0
Z
1 2
f (x)dx.
2 0
Example 1.
1
1
1
4
blue
sin (x) + sin(3x) + sin(5x) + sin(7x) +
=
function
3
5
7
Armin Straub
[email protected]
Example 2. Find the Fourier series of the 2-periodic function f (x) defined by
f (x) =
1, for x (, 0),
+1, for x (0, ).
2
0
and
(why?!)
Z
1
f (x)dx = 0
2
Z
1
f (x)cos(nx)dx
Z 0
Z
1
cos (nx)dx = 0
cos (nx)dx +
0
Z
1
f (x)sin(nx)dx
Z 0
Z
1
sin (nx)dx +
sin (nx)dx
0
Z
2
sin (nx)dx
0
1
2
cos(nx)
n
0
2
[1 cos (n)]
n
(
2
[1 (1)n] =
n
4
n
if n is odd
if n is even
In conclusion,
1
4
1
1
sin (x) + sin(3x) + sin(5x) + sin(7x) +
.
f (x) =
3
5
7
Armin Straub
[email protected]
Determinants
For the next few lectures, all matrices are square!
Recall that
1
a b 1
d b
=
.
c d
ad bc c a
The determinant of
a 2 2 matrix is det
a b
c d
= ad bc,
a 1 1 matrix is det ([ a ]) = a.
Goal: A is invertible
a
c
det (A) 0
a
b
and
c
d
b
d
R2 1 R2 1 0 0
2
2 0 1 0
0 0 7
Example 5. Compute
Solution.
1 2 3
0 2 4
0 0 7
1 0 0
0 2 0
0 0 7
1 2 0
14 0 1 0
0 0 1
Armin Straub
[email protected]
R3 1 R3
1 0 0
7
0 1 0
14
0 0 1
1 2 3
0 2 4
0 0 7
R2 1 R2 1 2 3
2
2 0 1 2
0 0 7
R1R13R3
R2R22R3
= 14
R3 1 R3
1 2 3
7
0 1 2
14
0 0 1
R1R12R2
1 0 0
0 1 0
14
0 0 1
= 14
1 2 0
3 1 2
2 0 1
1 2 0
3 1 2
2 0 1
@
@
R2R23R1
R3R32R1
R3R3 7 R2
=
Example 7. Discover the formula for
Solution.
a b
c d
1
0
0
0
2
2
0
0
R4R4 3 R3
2
1
0
0
0
2
2
0
0
Example 8. Compute
Solution.
1
0
0
0
2
2
0
0
3
1
2
3
4
5
1
5
3
1
2
3
4
5
1
5
1 2 0
0 7 2
0 4 1
1 2
0
0 7 2
1
0 0 7
1
1 (7) 7 = 1
a b
c d
a
b
c
0 d ab
R2R2 a R1
c
= a d b = ad bc
a
3 4
1 5
7
2 1 = 1 2 2 2
7
0 2
= 14
The following important properties follow from the behaviour under row operations.
det (A) = 0
A is not invertible
Why? Because det (A) = 0 if only if, in an echelon form, a diagonal entry is zero (that is, a pivot
is missing).
1 2 0
3 1 2
2 0 1
by cofactor expansion.
1 1
2 0
2 1
0 1
+
2 + 0 3 1
2 0
1
= 1 (1) 2 (1) + 0 = 1
Each term in the cofactor expansion is 1 times an entry times a smaller determinant
(row and column of entry deleted).
+ +
+
.
The 1 is assigned to each entry according to
+ +
Solution. We expand by the second column:
1 2 0
3 1 2
2 0 1
0
= 2 3
+ (1)
2
+
2
2
1
1
= 2 (1) + (1) 1 0 = 1
1
0
0 3
2
1 2
1 2
+
= 0 3 1
2
+ 1 3 1
2 0
2 0
+
= 0 2 (4) + 1 (7) = 1
Practice problems
Problem 1. Compute
1
0
2
2
2
5
7
9
3 4
0 0
.
6 10
7 11
Review
The determinant is characterized by det I = 1 and the effect of row ops:
replacement: does not change the determinant
interchange: reverses the sign of the determinant
scaling row by s: multiplies the determinant by s
1
0
0
0
2
2
0
0
3
1
2
0
4
5
1
3
= 1 2 2 3 = 12
det (A) = 0
A is not invertible
) = det
1
ad b c
d b
c a
= a d bc (da (b)(c)) = 1
det a d bc
d b
c a
Armin Straub
[email protected]
1 2 0
3 1 2
2 0 1
by cofactor expansion.
0
= 2 3
2 + (1)
+
2
2
1
1
= 2 (1) + (1) 1 0 = 1
1
0
0 3
2
1 2
1 2
+
= 0 3 1
2
+ 1 3 1
2 0
2 0
+
= 0 2 (4) + 1 (7) = 1
Example 3.
First off, say hello to a new friend: i, the imaginary unit
It is infamous for i2 = 1 .
1
i
|1|
1 i
i 1
1 i
i 1 i
i 1
i
1 i
i 1 i
i 1
Armin Straub
[email protected]
=1
= 1 i2 = 2
1 i i 0
i
= 2 i2 = 3
= 1
i 1 i 1
1 i
= 1 i 1 i
i 1
i 0
i i 1 i
i 1
2
=3i 1 i
i 1
=5
1 i
i 1 i
i 1 i
i 1 i
i 1
1 i
= 1 i 1 i
i 1 i
i 1
1 i
i2 i 1 i
i 1
=5+3=8
1
2
is an eigenvector of A =
0 2
4 2
Solution.
Ax =
0 2
4 2
1
2
4
8
= 4x
Armin Straub
[email protected]
Solution. A
x
y
y
x
1
1
=1
1
1
1
1
1
1
So: x =
1
1
So: x =
1
1
= 1
1
1
Practice problems
Problem 1. Let A be an n n matrix.
Express the following in terms of det (A):
det (A2) =
det (2A) =
Hint: (unless n = 1) this is not just 2 det (A)
Armin Straub
[email protected]
Review
If Ax = x, then x is an eigenvector of A with eigenvalue .
EG: x =
1
2
because Ax =
is an eigenvector of A =
0 2
4 2
1
2
Multiplication with A =
1
1
So: x =
=1
1
1
1
1
1
1
So: x =
0 1
1 0
4
8
0 2
4 2
with eigenvalue 4
= 4x
1
1
=
1
1
= 1
1
1
x
y
Solution. A
x
0
1
0
1
0
So: x =
0
1
=1
So: x =
1
0
0
0
0
1
=0
0
1
Armin Straub
[email protected]
Definition 3. Given , the set of all eigenvectors with eigenvalue is called the
eigenspace of A corresponding to .
Example 4. (continued) We saw that the projection matrix P has the two eigenvalues
= 0, 1.
The eigenspace of = 1 is V .
The eigenspace of = 0 is V .
How to solve Ax = x
Key observation:
Ax = x
Ax x = 0
(A I)x = 0
det (A I) = 0
det (A I) = 0
Armin Straub
[email protected]
3 1
.
1 3
Solution.
A I =
3 1
1 3
det (A I) = 3 1
= 2 6 + 8 = 0
1 0
0 1
3
1
1
3
1
= (3 )2 1
3
1 = 2, 2 = 4
(A =
3 1
1 3
(A =
3 1
1 3
1 = 2.
A 2I =
n
A= 0
0
1
1
o
2 = 4.
eigenvalues of
2 3
6 10 .
0 2
Solution.
The characteristic polynomial is:
3
2
3
det (A I) = 0
6 10
0
0
2
A has eigenvalues 2, 3, 6.
= (3 )(6 )(2 )
3 2 3
A = 0 6 10
0 0 2
1 2 3
(A 1I)x = 0 4 10 x = 0
0 0 0
Armin Straub
[email protected]
2
x1 = 5/2
1
2 = 3:
0 2 3
(A 2I)x = 0 3 10 x = 0
0 0 1
3 = 6:
3 2 3
(A 3I)x = 0 0 10 x = 0
0 0 4
1
x2 = 0
0
2
x3 = 3
0
In summary,
A has eigenvalues 2, 3, 6 with corresponding
2/3
1 .
0
2
1
eigenvectors 5/2 , 0 ,
0
1
These three vectors are independent. By the next result, this is always so.
Theorem 7. If x1,
, xm are eigenvectors of A corresponding to different eigenvalues,
then they are independent.
Why?
A(c1x1 +
+ cmxm) = c11x1 +
+ cmmxm = 0
This is a second independent relation! Contradiction.
Practice problems
Example 8. Find the eigenvectors and eigenvalues of A =
2
1
A = 1
0
0
3
1
1
0
0
3
2
0 2
4 2
0
0
?
0
4
No calculations!
Armin Straub
[email protected]
Review
If Ax = x, then x is an eigenvector of A with eigenvalue .
is an eigenvalue of A
Why? Because Ax = x
det (A I)
= 0.
characteristic polynomial
(A I)x = 0.
By the way: this means that the eigenspace of is just Nul(A I).
E.g., if
3 2 3
A = 0 6 10
0 0 2
Eigenvectors x1,
, xm of A corresponding to different eigenvalues are independent.
By the way:
product of eigenvalues = determinant
sum of eigenvalues = trace (sum of diagonal entries)
Example 1. Find the eigenvalues of A as well
spaces, where
2 0
A = 1 3
1 1
Solution.
The characteristic polynomial is:
2
0
0
det (A I) = 1 3
1
1
1
3
3
1
= (2 )
1
3
= (2 )[(3 )2 1]
=(2 )( 2)( 4)
A has eigenvalues 2, 2, 4.
2 0 0
A = 1 3 1
1 1 3
1 = 2:
0 0 0
(A 1I)x = 1 1 1 x = 0
1 1 1
Armin Straub
[email protected]
1
x1 = 1 ,
0
0
x2 = 1
1
2 0
0
(A 2I)x = 1 1 1 x = 0
1 1 1
0
1
1 , 1 .
1
0
0
x3 = 1
1
0
1
basis 1 , 1 ,
1
0
0
basis 1 .
1
Solution. A
x
y
y
x
Armin Straub
[email protected]
= 2 + 1
1
det (A I) =
1
Let us check:
2 = i:
x=
i 1
1 i
0 1
1 0
i 1
1 i
x=
0
0
i
1
0
0
=
1
i
x1 =
=i
i
1
x2 =
i
1
i
1
1 1
0 1
Solution.
det (A I) = 1 0
1
= (1 )2
1
(A I)x =
0 1
0 0
x=0
n
1
0
x1 = 10
o
. Only dimension 1!
Practice problems
Example 4. Find the eigenvectors and eigenvalues of
Armin Straub
[email protected]
1 2 1
A = 0 5 0 .
1 8 1
Review
Eigenvector equation: Ax = x
is an eigenvalue of A
(A I)x = 0
det (A I)
= 0.
characteristic polynomial
1 0
0 1
= 1, 1
0 0
0 0
= 0, 0, eigenspace is R2
2 1
0 2
= 2, 2, eigenspace is span
eigenspace is R2
n
1
0
o
Diagonalization
Diagonal matrices are very easy to work with.
Example 1. For instance, it is easy to compute their powers.
If
2 0 0
A = 0 3 0 ,
0 0 4
then A2 =
Example 2. If A =
6 1
2 3
22
32
4
and A100 =
21 0 0
31 0 0
4
100
, then A100 = ?
Solution.
Characteristic polynomial:
1 = 4:
2 1
2 1
2 = 5:
1 1
2 2
v=0
6 1
2
3
= ( 4)( 5)
eigenvector v1 =
eigenvector v2 =
1
1
1
2
100
Key observation: A100 v1 = 100
v2 = 100
1 v1 and A
2 v2
For A1 0 0 , we need A1 0 0
Armin Straub
[email protected]
1
0
and A1 0 0
0
1
1
0
= c1v1 + c2v2 = 12 + 2 11
100
100 1
=A
12 + 2
A
0
A
100
"
2 5 1 0 0 41 0 0
2 5 1 0 0 2 41 0 0
1
1
= 4100
1
2
+ 2 5100
1
1
In summary: AP = PD
|
A x1
|
|
|
|
xn = 1x1 nxn
|
|
|
|
|
1
= x1 xn
n
|
|
Armin Straub
[email protected]
Example 3.
B y the way: not a u niversal law but only a fascinatingly prevalent tendency C oxeter
13
8
= 1.625,
21
13
= 1.615,
34
21
= 1.619,
By the way, this is the most irrational number (in a precise sense).
Hence:
Fn+1
Fn
Fn+1
Fn
n
F1
= 11 10
F0
Fn+1 = Fn + Fn1
1 1
1 0
1 1 n
1 0
or
1 1
1 0
1+ 5
2
Fn
Fn 1
1 1 n 1
!
0
1 0
Fn+1
Fn
Hence,
1
0
1
0
= c1 v1 + c1v2.
1 5
2
(c1 = , c2 = )
5
= An 10 = n1 c1v1 + n2 c2v2
h
1
1+ 5
Fn = n1 c1 + n2 c2 =
2
5
n
1+ 5
2
1 5
2
n i
.
n
.
1+ 5 n
1
In fact, Fn = round
. Dont you feel powerful!?
2
5
Practice problems
Problem 1. Find, if possible, the diagonalization of A =
Armin Straub
[email protected]
is 2 1.
F1
F0
0 2
4 2
Orthogonal projections
If v1,
, vn is an orthogonal basis of V , and x is in V , then
x = c1v1 +
+ cnvn
with
cj =
hx, v j i
.
hv j , v j i
with
cj =
hx, v j i
.
hv j , v j i
in V
(this
x
x
v1
x
v2
Armin Straub
[email protected]
1
1 .
0
1
1
h 1 , 1 i
0
0
1
1
h 1 , 1 i
0
0
Wrong approach!!
(c)
0
0 .
0
1
1
1 , 1
1
0
1
of 1
0
1
of 1
0
1
1 +
0
0
1
0 , 1 ?
0
0
onto span
1
1
1 , 1 ?
1
0
onto span
1
1
h 1 , 1 i
1
0
1
1
h 1 , 1 i
1
1
0
1
1 = 0
0
1
1
What is the orthogonal projection of 1
0
1
Solution: The projection is 1 .
1
1
1 , 1 ?
1
0
onto span
Wrong!!
1
1
h 1 , 1 i
0
0
1
1
h 1 , 1 i
0
0
1
1 +
0
1
1
Corrected : 1 , 1
1
0
1
1
h 1 , 1
0
0
1
1
h 1 , 1
0
0
1
1 +
i
0
1
1
h 1 , 1
1
0
1
1
h 1 , 1
1
1
0
1
1 , 0
1
0
0
1
h 1 , 0 i
1
0
0
1
h 1 , 0 i
1
1
1
1
1 = 1 +
i
0
1
1
2
1
3
1
0
1
0
0 = 1 + 0 0
1
0
1
span
1
0
1 , 1
0
0
1 0 0
Solution: The projection matrix is 0 1 0 .
0 0 0
1
1
0
0
1 , 0
What would GramSchmidt do? 1 , 1
0
0
0
0
(
1
What is the orthogonal projection of 1 onto span
1
(e)
Armin Straub
[email protected]
1
0
1 , 1 ?
0
0
1
1
1 0 0
is 0 1 0 1 = 1 .
0
1
0 0 0
The space of all nice functions with period 2 has the natural inner product hf ,
R 2
[in R n: hx, yi = x1 y1 +
+ xnyn]
gi = 0 f (x)g(x)dx.
The functions
Least squares
2
f (x)sin(2x)dx
0
R 2
sin2 (2x)dx
0
Example 3. Find the least squares line for the data points (2, 1), (5, 2), (7, 3), (8, 3).
Solution.
Looking for 1, 2 such that the line y = 1 + 2x best fits the data.
The equations yi = 1 + 2xi in matrix form:
1
1
1
1
y1
x1
y2
x2
=
y3
x3
2
y4
x4
d esign m atrix X
Armin Straub
[email protected]
ob servatio n
vector y
1
1
1
1
X TX
1 1
2 5
X Ty =
Solving
4 22
22 142
9
57
1
2
2
5
7
8
1
1
2
2 = 3
3
1 2
1 1
1 5 =
7 8 1 7
1 8
1
1 1 1
2 =
5 7 8 3
3
, we find
1
2
2/7
5/14
4 22
22 142
9
57
GramSchmidt
Recipe. (GramSchmidt orthonormalization)
b1
kb1k
b
q2 = 2
kb2k
b
q3 = 3
kb3k
q1 =
Armin Straub
[email protected]
1 1
A = 2 0 .
0 1
1 1
2 = q1
5 0
1
1
0 h 0 ,
1
1
1
4/5
1
1
1
q1iq1 = 0 2 = 2/5 ,
5 5 0
1
1
Hence: Q = [ q1
q2 ] =
5
4
45
And: R = QTA =
45
2
45
5
45
5
2
5
2
45
0
5
45
4/5
2/5 =
p
9/5
1
5
1 1
5
2 0 =
0
0 1
5
9
45
q2
Determinants
A is invertible
det (A) 0
1
0
0
0
2
2
0
0
3
1
2
3
4
5
1
5
R4R4 3 R3
2
Armin Straub
[email protected]
1
0
0
0
2
2
0
0
3 4
1 5
7
2 1 = 1 2 2 2
7
0 2
= 14
0
= 2 3
+ (1)
2
+
2
2
1
1
= 2 (1) + (1) 1 0 = 1
Example 5. What is
1
1
0
2
1
2
3
0
1
2
3
0
4
5
1
5
1
0
0 3
2
Solution. The determinant is 0 because the matrix is not invertible (second and third
column are the same).
det (A I)
= 0.
characteristic polynomial
(A I)x = 0.
Eigenvectors x1,
, xm of A corresponding to different eigenvalues are independent.
Useful for checking: sum of eigenvalues = sum of diagonal entries
Armin Straub
[email protected]
Welcome back!
The final exam is on Friday, December 12, 7-10pm
If you have a conflict (overlapping exam, or more than 2 exams within 24h), please email
Mahmood until Sunday to sign-up for the Monday conflict.
1 2
What are the eigenspaces of 0 3 ?
n o
= 1 has eigenspace Nul 00 22 = span 10
n o
2 2
= span 11
= 3 has eigenspace Nul
0 0
n o
INCORRECT: eigenspace span 10 , 11
Transition matrices
Powers of matrices can describe transition of a system.
Example 1. (review)
Hence:
Fn+1
Fn
Fn+1
Fn
n
F1
1 1
= 1 0
F0
Fn+1 = Fn + Fn1
1 1
1 0
Fn
Fn 1
Example 2. Consider a fixed population of people with or without a job. Suppose that,
each year, 50% of those unemployed find a job while 10% of those employed loose their
job.
What is the unemployment rate in the long term equilibrium?
Solution.
0.5
employed
0.9
0.1
no job
0.5
0 .9 0 .5
0 .1 0 .5
Armin Straub
[email protected]
x
y
is an equilibrium if
x
y
0.9 0.5
0.1 0.5
x
y
x
y
x
y
5/6
1/6
Page rank
Googles success is based on an algorithm to rank webpages, the Page rank, named
after Google founder Larry Page.
The basic idea is to determine how likely it is that a web user randomly gets to a given
webpage. The webpages are then ranked by these probabilities.
Example 3. Suppose the internet consisted of only the four webpages A, B , C , D linked
as in the following graph:
Imagine a surfer following these links at random.
P R n(A)
P R n(B)
=
PR n(C)
P R n(D)
0
1
3
1
3
1
3
The PageRank
PR n 1(A)
0 0 0
PR n 1(B)
PR n 1(C)
0 0 1
PR n 1(D)
1
0 0
2
P R (A)
PR(A)
PR(B) P R (B)
P R (D)
PR(D)
1
2
1 0
1
1
3
1
3
1
3
1
2
>
1 0 0 2
2
0 1 0 3
1 0
0
RREF
0 1 1
0 0 1 3
1
0 0 0 0
0 1
2
1
eigenspace of = 1 spanned by
Armin Straub
[email protected]
2
3
5
3
2
PR(A)
2
PR(B)
3
PR(C) = 16 5
3
PR(D)
1
0.375
0.125
=
0.313
0.188
Practice problems
Problem 1. Can you see why 1 is an eigenvalue for every Markov matrix?
Problem 2. (just for fun) The real web contains pages which have no outgoing links.
In that case, our random surfer would get stuck (the transition matrix is not a Markov
matrix). Do you have an idea how to deal with this issue?
Armin Straub
[email protected]
Review
We model a surfer randomly clicking webpages.
Let PRn(A) be the probability that he is at A (after n steps).
1
1
PRn(A) = PRn1(B) 2 + PRn1(C) 1
0 2 1 0
PR n(A)
1
P R n 1(A)
PR n(B)
0 0 0
P R n 1(B)
3
=
PR n(C) 1
PR n 1(C)
3 0 0 1
PR n(D)
P R n 1(D)
1 1
0 0
3 2
+ PRn1(D)
0
1
=T
The PageRank
PR(A)
vector PR(B)
PR(C)
PR(D)
PR(A)
= T
satisfies PR(B)
PR(C)
PR(D)
PR(A)
PR(B)
.
PR(C)
PR(D)
1
1
3
1
3
1
3
1
2
>
1 0 0 2
2
0 1 0 3
1 0
0
RREF
5
0 1 1
0
0
1
3
1
0
0
0
0
0 1
2
1
eigenspace of = 1 spanned by 35
3
1
2
0.375
PR(A)
2
PR(B)
3 0.125
PR(C) = 16 5 = 0.313 This
3
PR(D)
0.188
1
Armin Straub
[email protected]
Here: T
1/4
=
T 1/4
1/4
1/4
1
2
1
3
1
3
1
3
0 0 0
0 0 1
1
0
0
2
1 0
3/8
1/12
=
1/3
5/24
P R(A)
P R(B)
PR(C) =
P R(D)
0.375
0.125
0.313
0.188
0.375
0.083
0.333
0.208
=
T 2 1/4
1/4
1/4
1/4
=
T 3 1/4
1/4
1/4
0.375
0.125
0.333
0.167
0.396
0.125
0.292
0.188
Remark 2.
If all entries of T are positive, then the power method is guaranteed to work.
In the context of PageRank, we can make sure that this is the case, by replacing T
with
0 2 1
1
0 0
3
(1 p)
1
3 0 0
1 1
0
3 2
0
+ p
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
Just to make sure: still a Markov matrix, now with positive entries
Google used to use p = 0.15.
m
T m(c1x1 +
+ cnxn) = c1m
1 x1 +
+ cnn xn
Armin Straub
[email protected]
t2
t3
y1(0) = 1
y2(0) = 0
y3(0) = 2
In matrix form:
2 0 0
y = 1 3 1 y,
1 1 3
1
y(0) = 0
2
Armin Straub
[email protected]
Review of diagonalization
If Ax = x, then x is an eigenvector of A with eigenvalue .
Put the eigenvectors x1,
, xn as columns into a matrix P .
Axi = ixi
|
A x1
|
In summary: AP = PD
|
|
|
xn = 1x1 nxn
|
|
|
1
|
|
= x1 xn
|
|
n
2 0 0
A = 1 3 1
1 1 3
Solution.
= 2:
0 0 0
1 1 1
1 1 1
eigenspace span
2 0
0
= 4: 1 1 1
eigenspace
1 1 1
1 1 0
2
= 1 0 1 and D = 2
4
0 1 1
1
1
1 , 0
1
0
)
0
1
1
span
A = PDP 1
2 0 0
1 1 0
1 1 0
2
1 3 1 1 0 1 = 1 0 1
2
1 1 3
0 1 1
0 1 1
4
Armin Straub
[email protected]
Review
Let A be n n with independent eigenvectors x1,
, xn.
Then A can be diagonalized as A = PDP 1.
the columns of P are the eigenvectors
the diagonal matrix D has the eigenvalues on the diagonal
Why? We need to see that AP = PD:
Axi = ixi
A x1
|
|
|
|
xn = 1x1 nxn
|
|
|
1
|
|
= x1 xn
n
|
|
t2
2
y = 1
1
t3
of systems like:
0 0
1
y(0) = 2
3 1 y,
1 3
1
1 2 1 3
A + A +
2!
3!
d At
e = AeA t
dt
1 22 1 33
d At
d
I + At + A t + A t +
e
=
2!
dt
dt
3!
1 2
1 32
= A + A t + A t + = AeA t
1!
2!
Why?
Example 2. If A =
2 0
0 5
, then:
#
"
#
"
2 0
2 0
1
e
2
0
2
eA =
+
+
+ =
0 5
2! 0 52
0 e5
#
"
#
"
1 (2t)2
0
1 0
2t 0
e2t 0
At
+ =
e =
+
+
0 1
0 5t
2!
0
(5t)2
0 e5t
1 0
0 1
eA = I + A +
y =
y,
y(0) =
.
1 0
0
Solution. The solution to y = Ay, y(0) = y0 is y(t) = eA ty0.
Diagonalize A =
1
1
0 1
1 0
= 2 1,
1 1
1 1
y = PeDtP 1"y0
#
t
1 1
e 0 1
=
1 1
0 et 2
#
" t
1 1 1
e 0
=
2 1 1
0 et
"
#
t
1 1 1
e
=
2 1 1
et
"
#
t
t
1 e +e
=
2 et et
Armin Straub
[email protected]
and D =
1 1
1 1
1
1
1 0
0 1
1
0
2 0 0
y = 1 3 1 y,
1 1 3
1
y(0) = 2 .
1
Solution.
Recall that the solution to y = Ay, y(0) = y0 is y = eA ty0.
A has eigenvalues 2 and 4.
= 2:
0 0 0
1 1 1
1 1 1
eigenspace span
2 0
0
= 4: 1 1 1
1 1 1
A = PDP
with P
eigenspace span
1 1 0
= 1 0 1 ,
0 1 1
y = eAty0 = PeD tP 1 y0
2t
e
1 1 0
= 1 0 1
0 1 1
2t
e
1 1 0
= 1 0 1
0 1 1
1 1 0
e2t
= 1 0 1 0
0 1 1
e4t
e2t
y = e2t + e4t
e4t
1
1
1 , 0
1
0
D =
)
0
1
1
2
2
4
1 1 0 1 1
1 0 1 2
e2t
4t
0 1 1
1
e
1
0
e2t
1
e4t
e2t
2t
= e + e4t
e4t
2e2t
e2t
2
0
0
Remark 7. The matrix exponential shares many other properties of the usual exponential:
eA is invertible and (eA)1 = eA
eAeB = eA+B = eBeA if AB = BA
Armin Straub
[email protected]
perimeter = 4
perimeter = 4
perimeter =
perimeter =
perimeter = 4
perimeter = 4
perimeter = 4
perimeter =
perimeter =
perimeter =
b
a
1 + y (x)2 dx.
(That is, two functions can be close without their derivatives being close.)
Even more extreme examples are provided by fractals. The Koch snowflake:
Armin Straub
[email protected]
d = 1 = log3 (3)
d = 2 = log3 (3)
d = log3 (4)
Such fractal behaviour is also observed when attempting to measure the length of
a coastline: the measured length increases by a factor when using a smaller scale.
See: http://en.wikipedia.org/wiki/Coastline_paradox
Armin Straub
[email protected]