6.4 - 6.3 Continued, 6.4 Gram-Schmidt Process Recall:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6.3 Continued, 6.4 Gram-Schmidt Process Recall: distance from y to u1 is y − u1 y ∈ Rn and orthonormal vectors {u1 , · · ·, up } W = Span{u1 , · · ·, up } the distance from y to W is the distance from y to the nearest point in W = y −ProjW y . 3 1 −4 −1 −2 1 y = , u1 = , u2 = . EX: 1 −1 0 13 2 3 {u1 , u2 } orthogonal basis. 4 4 y −y = ˆ 4 4 W = Span{u1 , u2 }, −1 −5 y · u2 y · u1 u1 + u2 = 3u1 +u2 = , y= ˆ −3 u1 · u1 u2 · u2 9 distance from y to W = y−y = ˆ √ 64 = 8. Theorem: Rn ⇒ {u1 , · · ·, up } orthonormal basis for W ⊆ ProjW y = (y · u1 )u1 + (y · u2 )u2 + · · · + (y · up )up U = [u1 u2 · · · up ] ⇒ ProjW y = U U T y for all y ∈ Rn Question: Why? 1 Answer: Because uT 1 uT 2 U U T y = [ u1 u2 · · · up ] . y . . uT p T uy 1 uT y = [ u1 u2 · · · up ] 2 . . . uT y p u ·y 1 u · y 2 = [ u1 u2 · · · up ] . . . up · y = ProjW y = (u1 · y )u1 + (u2 · y )u2 + · · · + (up · y )up 1 1 1 p = 1, v1 = 2, so u1 = 2, W = Span{u1 }. EX: 3 2 2 1/3 1/9 2/9 2/9 U U T = u1 uT = 2/3 [ 1/3 2/3 2/3 ] = 2/9 4/9 4/9 1 2/3 2/9 4/9 4/9 2 1 If y = 1, then 1 1 5/9 ProjW y = 2/9 4/9 4/9 1 = 10/9 2/9 4/9 4/9 1 10/9 1/9 2/9 2/9 Question: Suppose we have linearly independent vectors x1 , · · ·, xp and W = Span{x1, · · ·, xp }. How can we construct an orthogonal or orthonormal basis {v1 , v2 , · · ·, vp }? Use the Answer: Gram-Schmidt Process: The basic idea: At step l, if we have orthogonal v1 , · · ·, vl Wl = Span{x1, · · ·, xl } = Span{v1, · · ·, vl }, then let vl+1 = xl+1 − ProjWl xl+1 . Once we have orthogonal v1 , v2, · · ·, vp , easy to get orvp v1 , · · ·, up = . thonormal u1 = v1 vp computed from x1, · · ·, xl with 3 EX: 1 x1 = −1, 0 2 x2 = 0 , −2 3 x3 = −3, 3 W1 = Span{x1}, W2 = Span{x1 , x2 }. 1 v1 = x1 = −1, 0 x2 · v1 v2 = x2 − ProjW1 x2 = x2 − v1 v · v1 1 2 1 1 2 = 0 − −1 = 1 2 −2 0 −2 x3 · v2 x3 · v1 v1 − v2 v3 = x3 − ProjW2 x3 = x3 − v1 · v1 v2 · v2 3 1 1 1 6 6 = −3 − −1 + 1 = 1 2 6 3 0 −2 1 1 1 v1 = √ −1 , u1 = v1 2 0 1 v3 1 u3 = = √ 1 . v3 3 1 4 ∴ 1 v2 1 u2 = = √ 1 , v2 6 −2 v3 x3 v2 0 v1 W2 = Span{v1 , v2 } Figure 1: The construction of v3 from x3 and W2 . ProjW2 x3 Summary of Gram-Schmidt process: Given basis {x1 , · · ·, xp } for subspace W of Rn Construct v1 = x1 ( W1 = Span{x1} ) ( W2 = Span{x1, x2 } ) ( W3 = Span{x1, x2 , x3 } ) v2 = x2 − ProjW1 x2 v3 = x3 − ProjW2 x3 . . . vp = xp − ProjWp−1 xp 5 Explicitly: v1 = x1 v2 = x2 − v3 = x3 − . . . vp = xp − x2 · v1 v1 · v1 v1 · v1 x3 · v1 v1 v1 − x3 · v2 v2 · v2 v2 xp · v1 v1 · v1 v1 − · · · − vp−1 · vp−1 xp · vp−1 vp−1 Then {v1, · · ·, vp } orthogonal basis for W . Important note: If there are a lot of vectors, so this is being done on a computer. The arithmetic has to be done slightly differently (using the modified Gram-Schmidt process) to avoid bad roundoff errors from the computer’s floating point arithmetic. Basic idea: At step l, have v1 , · · ·, vl , which are orthogonal it orthogonal to all of the remaining vectors {xl+2 , · · ·, xp } to {xl+1, · · ·, xp }, then compute vl+1 from xl+1 and make ˆ before computing vl+2 . All of the arithmetic is the same as for the Gram-Schmidt process, but the order things are done is slightly different. 6 ...
View Full Document

Ask a homework question - tutors are online