18.06.19: Gram–Schmidt Crackers Lecturer: Barwick Monday, 28 March 2016

advertisement
18.06.19: Gram–Schmidt
Crackers
Lecturer: Barwick
Monday, 28 March 2016
18.06.19: Gram–Schmidt Crackers
A collection of vectors ~𝑣1 , … ,~π‘£π‘˜ ∈ R𝑛 are said to be orthogonal if any two of
them are perpindicular, i.e., if
~𝑣𝑖 ⋅ ~𝑣𝑗 = 0 if 𝑖 ≠ 𝑗.
More particularly, ~𝑣1 , … ,~π‘£π‘˜ ∈ R𝑛 are said to be orthnormal if any one of them
is a unit vector, and any two of them are perpindicular, i.e., if
~𝑣𝑖 ⋅ ~𝑣𝑗 = 𝛿𝑖𝑗 = {
0 if 𝑖 ≠ 𝑗;
1 if 𝑖 = 𝑗.
18.06.19: Gram–Schmidt Crackers
Recall from the first problem set that an orthonormal collection of vectors
is linearly independent. Of course, there are lots of linearly independent collections of vectors that aren’t orthonormal. That’s an issue when it comes to
understanding their geometry.
18.06.19: Gram–Schmidt Crackers
Why? Well, suppose we have a vector subspace π‘Š ⊆ R𝑛 , and suppose we have
an orthonormal basis {Μ‚
𝑒1 , … , π‘’Μ‚π‘˜ } of π‘Š. So take some vectors ~π‘Ž, ~𝑏 ∈ π‘Š and
write them as
π‘˜
π‘˜
~π‘Ž = ∑ π‘Žπ‘– 𝑒̂𝑖
and ~𝑏 = ∑ 𝑏𝑖 𝑒̂𝑖 .
𝑖=1
We then find
𝑖=1
π‘˜
~π‘Ž ⋅ ~𝑏 = ∑ π‘Žπ‘– 𝑏𝑖 .
𝑖=1
In other words, the geometry of ~π‘Ž and ~𝑏 can be extracted with a minimum of
thought from these coefficients.
18.06.19: Gram–Schmidt Crackers
But now we run into a problem: when we’re thinking about the kinds of bases
for subspaces we can get our hands on, nothing makes them orthonormal. Our
ways of computing kernels of bases, for example, don’t ensure any orthonormality.
So there’s the question: we’d like a way of taking some linearly independent vectors ~𝑣1 , … ,~π‘£π‘˜ ∈ R𝑛 and generating a new, orthonormal, collection of vectors
𝑒̂1 , … , π‘’Μ‚π‘˜ ∈ R𝑛 such that for any 𝑖, we have
im ( 𝑒̂1 … 𝑒̂𝑖 ) = im ( ~𝑣1 … ~𝑣𝑖 ) .
18.06.19: Gram–Schmidt Crackers
Recall: the projection of a vector ~𝑏 onto a vector ~π‘Ž is the vector
~π‘Ž ⋅ ~𝑏
~π‘Ž.
πœ‹~π‘Ž (~𝑏) ≔ (Μ‚
π‘Ž ⋅ ~𝑏)Μ‚
π‘Ž=
~π‘Ž ⋅ ~π‘Ž
~π‘Ž
.
~𝑏
πœ‹~π‘Ž (~𝑏)
18.06.19: Gram–Schmidt Crackers
We spoke a little about this, but we let’s examine more. First of all, what happens
if you scale the vector ~π‘Ž onto which you’re projecting?
~π‘Ž ⋅ ~𝑏
(π‘Ÿ~π‘Ž) ⋅ ~𝑏
π‘Ÿ(~π‘Ž ⋅ ~𝑏)
~π‘Ž = πœ‹~π‘Ž (~𝑏).
πœ‹π‘Ÿ~π‘Ž (~𝑏) =
(π‘Ÿ~π‘Ž) = 2
(π‘Ÿ~π‘Ž) =
~π‘Ž ⋅ ~π‘Ž
(π‘Ÿ~π‘Ž) ⋅ (π‘Ÿ~π‘Ž)
π‘Ÿ (~π‘Ž ⋅ ~π‘Ž)
So we can think of this not as the projection of ~𝑏 onto ~π‘Ž, but as the projection
of ~𝑏 onto the line 𝐿 spanned by ~π‘Ž. We write πœ‹πΏ (~𝑏).
18.06.19: Gram–Schmidt Crackers
Next, the projection is sometimes called the orthogonal projection, because
you’re taking ~𝑏, and πœ‹πΏ (~𝑏) is the approximation to ~𝑏 in 𝐿 that differs from ~𝑏 by
a perpindicular vector. That is,
(~𝑏 − πœ‹πΏ (~𝑏)) ⋅ ~π‘Ž = 0.
(Why?)
18.06.19: Gram–Schmidt Crackers
Let’s try to generalize this. Suppose I have a vector subspace π‘Š ⊆ R𝑛 . We
might like to define the projection of ~𝑏 onto π‘Š.
How might we do this? Well, suppose we have a orthogonal basis {~𝑒1 , … , ~π‘’π‘˜ }
of π‘Š. Then we can write
π‘˜
πœ‹π‘Š (~𝑏) ≔ ∑ πœ‹~𝑒𝑖 (~𝑏).
𝑖=1
~ ∈ π‘Š, then
The difference ~𝑏 − πœ‹π‘Š (~𝑏) is perpindicular to π‘Š; that is, if 𝑀
~ = 0.
(~𝑏 − πœ‹π‘Š (~𝑏)) ⋅ 𝑀
18.06.19: Gram–Schmidt Crackers
To explain this, let’s remember a vector is a perpindicular to a subspace if and
only if it’s perpindicular to a basis for that subspace. So all we need to show is
that for any 𝑗,
(~𝑏 − πœ‹π‘Š (~𝑏)) ⋅ ~𝑒𝑗 = 0.
But that’s true:
π‘˜
(~𝑏 − πœ‹π‘Š (~𝑏)) ⋅ ~𝑒𝑖 = (~𝑏 − ∑ πœ‹~𝑒𝑖 (~𝑏)) ⋅ ~𝑒𝑗
𝑖=1
= (~𝑏 − πœ‹~𝑒𝑗 (~𝑏)) ⋅ ~𝑒𝑗 − ∑ πœ‹~𝑒𝑖 (~𝑏) ⋅ ~𝑒𝑗 = ~0 − ∑ ~0 = ~0,
𝑖≠𝑗
because each πœ‹~𝑒𝑖 (~𝑏) is a scalar multiple of ~𝑒𝑖 .
𝑖≠𝑗
18.06.19: Gram–Schmidt Crackers
Here’s an key fact: if you have a different orthogonal basis {~𝑣1 , … ,~π‘£π‘˜ } of π‘Š,
then
π‘˜
π‘˜
∑ πœ‹~𝑒𝑖 (~𝑏) = ∑ πœ‹~𝑣𝑖 (~𝑏).
𝑖=1
𝑖=1
18.06.19: Gram–Schmidt Crackers
So if we have a linearly independent set ~𝑣1 , … ,~π‘£π‘˜ ∈ R𝑛 of vectors, let’s think
about how to use these projections to extract what we want. Again, the goal is
to get a new, orthonormal, collection of vectors 𝑒̂1 , … , π‘’Μ‚π‘˜ ∈ R𝑛 such that for
any 𝑖, we have
im ( 𝑒̂1 … 𝑒̂𝑖 ) = π‘Šπ‘– ,
where
π‘Šπ‘– ≔ im ( ~𝑣1 … ~𝑣𝑖 ) ,
so that we have this sequence of subspaces
0 = π‘Š0 ⊂ π‘Š1 ⊂ β‹― ⊂ π‘Šπ‘˜ = π‘Š.
18.06.19: Gram–Schmidt Crackers
So now we can think about the process.
(1) We start with the vector ~𝑣1 . The only problem there is that it’s not a unit
vector. So we take ~𝑒1 ≔ ~𝑣1 , and we normalize it: 𝑒̂1 ≔ β€–~𝑒1 β€– ~𝑒1 .
1
(2) Next, we take the vector ~𝑣2 , and we remove the best approximation to ~𝑣2
that lies in π‘Š1 :
~𝑒2 ≔ ~𝑣2 − πœ‹π‘Š1 (~𝑣2 ) = ~𝑣2 − πœ‹~𝑒1 (~𝑣2 ),
and we normalize it: 𝑒̂2 =
1
~𝑒 .
β€–~𝑒2 β€– 2
18.06.19: Gram–Schmidt Crackers
(3) Now, we take ~𝑣3 . Here something important happens: we want to write
~𝑒3 ≔ ~𝑣3 − πœ‹π‘Š2 (~𝑣3 ),
but to compute this, we need an orthogonal basis of π‘Š2 . But good news!
We created it in the last step! So
~𝑒3 ≔ ~𝑣3 − πœ‹π‘Š2 (~𝑣3 ) = ~𝑣3 − πœ‹~𝑒1 (~𝑣3 ) − πœ‹~𝑒2 (~𝑣3 ),
and we normalize: 𝑒̂3 =
1
~𝑒 .
β€–~𝑒3 β€– 3
18.06.19: Gram–Schmidt Crackers
(4) We can keep doing this. We write
~𝑒𝑖 = ~𝑣𝑖 − πœ‹π‘Šπ‘–−1 (~𝑣𝑖 ) = ~𝑣𝑖 − πœ‹~𝑒1 (~𝑣𝑖 ) − β‹― − πœ‹~𝑒𝑖−1 (~𝑣𝑖 ),
and we normalize: 𝑒̂𝑖 =
1
~𝑒 .
β€–~𝑒𝑖 β€– 𝑖
Download