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 ~π’ . β~π’π β π