{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 35 "Module 4: The Gramm Schmidt Pro cess" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 " \+ In the notes we have started with linearly independent vectors " } {XPPEDIT 18 0 "v[1],v[2],v[3];" "6%&%\"vG6#\"\"\"&F$6#\"\"#&F$6#\"\"$ " }{TEXT -1 26 ", ... and created an ortho" }{TEXT 259 6 "normal" } {TEXT -1 94 " family. The orthonormal family spans the same set that t he linearly independent vectors did. " }}{PARA 0 "" 0 "" {TEXT -1 171 " Here is a Modified Gramm Schmidt Process. We generate an orthogon al family, not necessarily an orthonormal family. We begin with the sa me linearly independent vectors." }}{PARA 0 "" 0 "" {TEXT -1 3 " " } {XPPEDIT 18 0 "theta[1];" "6#&%&thetaG6#\"\"\"" }{TEXT -1 3 " = " } {XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 3 " " }{XPPEDIT 18 0 "theta[2];" "6#&%&thetaG6#\"\"#" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "v[2]-*theta[1]/;" "6#,&&%\"vG6#\"\"#\"\"\"*(-%$<,>G6$&F%6#F'6#&%&thetaG6 #F(F(&F16#F(F(-F+6$&F16#F(6#&F16#F(!\"\"F<" }{TEXT -1 2 " ," }}{PARA 0 "" 0 "" {TEXT -1 3 " " }{XPPEDIT 18 0 "theta[3];" "6#&%&thetaG6#\" \"$" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "v[3]-*theta[1]/< theta[1],theta[1]>-*theta[2]/;" "6#, (&%\"vG6#\"\"$\"\"\"*(-%$<,>G6$&F%6#F'6#&%&thetaG6#F(F(&F16#F(F(-F+6$& F16#F(6#&F16#F(!\"\"F<*(-F+6$&F%6#F'6#&F16#\"\"#F(&F16#FEF(-F+6$&F16#F E6#&F16#FEF = 0;" "6#/-%$<,>G6$&%&thetaG6#\"\"#6#&F(6#\"\"\"\"\"!" }{TEXT -1 17 " , and that both " }{XPPEDIT 18 0 " = 0;" "6#/- %$<,>G6$&%&thetaG6#\"\"$6#&F(6#\"\"\"\"\"!" }{TEXT -1 5 " and " } {XPPEDIT 18 0 " = 0;" "6#/-%$<,>G6$&%&thetaG6#\"\"$ 6#&F(6#\"\"#\"\"!" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 29 "A Finite Dimensional example." }} {PARA 0 "" 0 "" {TEXT -1 75 " We create Maple code to perform the \+ Modified Gramm Schmidt Process on " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6# \"\"\"" }{TEXT -1 17 " = [1, 1, 1] and " }{XPPEDIT 18 0 "v[2];" "6#&% \"vG6#\"\"#" }{TEXT -1 14 " = [1, 0, 1]. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(LinearAlgebra):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "v[1]:=Vector([1,1,1]);\nv[2]:=Vector([1,0,1]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "theta[1]:=v[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "theta[2]:=v[2]-DotProduct(v[2],thet a[1])/\n DotProduct(theta[1],theta[1])*theta[1];" }}}{PARA 0 " " 0 "" {TEXT -1 23 "It is easy to see that " }{XPPEDIT 18 0 "theta[1]; " "6#&%&thetaG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "theta[2]; " "6#&%&thetaG6#\"\"#" }{TEXT -1 64 " do not have norm 1. Is it easy t o see that they are orthogonal?" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "DotProduct(theta[1],theta[2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 " We find the closest point in the plane generated by \+ " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 61 " to the vector u = [0, 1, 1]. This comes in three easy steps." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "u:=Vector([0,1,1]);" }}}{PARA 0 "" 0 "" {TEXT -1 45 "STEP 1: Perform the Gramm Schmidt Process on " }{XPPEDIT 18 0 " v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "v[2];" " 6#&%\"vG6#\"\"#" }{TEXT -1 2 " ." }}{PARA 0 "" 0 "" {TEXT -1 26 "We di d that above. We got:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "the ta[1];\ntheta[2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "STEP 2: U se the Fourier Inequality to compute the coefficients of " }{XPPEDIT 18 0 "theta[1];" "6#&%&thetaG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "theta[2];" "6#&%&thetaG6#\"\"#" }{TEXT -1 2 " ." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 119 "a[1]:=DotProduct(u,theta[1])/DotProduct( theta[1],theta[1]);\na[2]:=DotProduct(u,theta[2])/DotProduct(theta[2], theta[2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 30 "STEP 3: Write down the answer." }}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 37 "closest:=a[1]*theta[1]+a[2]*theta[2];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "It's Really True" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 210 " How could I convince you that this answer is correct? Draw a picture, you say. Pictures can lie! Let me show you that this is the closest point in an analytic way. First agree that the plane determined by " } {XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 23 " consists of all points" }}{PARA 0 "" 0 "" {TEXT -1 19 " s " } {XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " + t " } {XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 107 "where s and t range over all real numbers. The distan ce of any point in this plane to [0, 1, 1] is given by" }}{PARA 0 "" 0 "" {TEXT -1 14 " | s " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\" \"\"" }{TEXT -1 5 " + t " }{XPPEDIT 18 0 "v[2];" "6#&%\"vG6#\"\"#" } {TEXT -1 19 " - [0, 1, 1] | = " }{XPPEDIT 18 0 "sqrt((s+t-0)^2+(s-1) ^2+(s+t-1)^2);" "6#-%%sqrtG6#,(*$,(%\"sG\"\"\"%\"tGF*\"\"!!\"\"\"\"#F* *$,&F)F*F*F-F.F**$,(F)F*F+F*F*F-F.F*" }{TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Norm(s*v[1]+t*v[2]-u,2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 72 "The square of the norm is a function of t wo variables which we can plot." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "d:=(s,t)->(s+t)^2+(s-1)^2+(s+t-1)^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "plot3d(d(s,t),s=-1..2,t=-1..2,axes=NORMAL);" }}} {PARA 0 "" 0 "" {TEXT -1 150 "This is a parabolic curve. To find the m inimum value, take the derivative with respect to s and with respect t o t, set these equal to zero, and solve." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "solve(\{diff(d(s,t),s)=0,diff(d(s,t),t)=0\},\{s,t\}); " }}}{PARA 0 "" 0 "" {TEXT -1 59 "We get a value for s and a value for t. Assign these value." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "a ssign(%);" }}}{PARA 0 "" 0 "" {TEXT -1 8 "Compute " }{XPPEDIT 18 0 "s* v[1]+t*v[2];" "6#,&*&%\"sG\"\"\"&%\"vG6#F&F&F&*&%\"tGF&&F(6#\"\"#F&F& " }{TEXT -1 88 ". If we get the same value we had for closest, we've g ot the correct value --- two ways!" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "s*v[1]+t*v[2];" }}}{PARA 0 "" 0 "" {TEXT -1 178 "You \+ ask, why not do the problem this geometric way every time? Why have al l this Fourier stuff? Look at the next example where all notions of pl anes and three dimensions is lost." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "An Example in C([-1,1])" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 "" {TEXT -1 71 " We perform the Mod ified Gramm Schmidt Process on the functions 1, " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "x^3;" "6#*$%\"xG\"\"$" }{TEXT -1 46 " \+ in C([-1,1]). First, we define the functions " }{XPPEDIT 18 0 "v[1];" "6#&%\"vG6#\"\"\"" }{TEXT -1 9 " through " }{XPPEDIT 18 0 "v[4];" "6#& %\"vG6#\"\"%" }{TEXT -1 28 ". Since we form the quotient" }}{PARA 0 " " 0 "" {TEXT -1 15 " " }{XPPEDIT 18 0 "*g/;" " 6#*(-%$<,>G6$%\"fG6#%\"gG\"\"\"F)F*-F%6$F)6#F)!\"\"" }{TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 198 "so many times, why not make that a speci al function of f and g. In this case, the dot product is an integral f rom -1 to 1. Thus, for convenience, we define a function of f and g th at we will call P." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "P:=(f, g)->g(x)*int(f(t)*g(t),t=-1..1)/int(g(t)^2,t=-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "v[1]:=x->1;\nv[2]:=x->x;\nv[3]:=x->x^2;\n v[4]:=x->x^3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "theta[1]:= v[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "form:=v[2](x)-P(v[ 2],theta[1]);\ntheta[2]:=unapply(form,x);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 89 "form:=v[3](x)-P(v[3],theta[1])\n -P(v[3 ],theta[2]);\ntheta[3]:=unapply(form,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 120 "form:=v[4](x)-P(v[4],theta[1])\n -P(v[4] ,theta[2])\n -P(v[4],theta[3]);\ntheta[4]:=unapply(form,x) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 132 " We find the \"best \+ approximation\" in C([-1, 1]) to the absolute value function with a po lynomial of degree three. We follow the " }{TEXT 256 4 "same" }{TEXT -1 21 " four steps as above." }}{PARA 0 "" 0 "" {TEXT -1 55 "STEP 1: P erform a Modified Gramm Schmidt Process on 1, " }{XPPEDIT 18 0 "x;" "6 #%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x^2;" "6#*$%\"xG\"\"#" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "x^3;" "6#*$%\"xG\"\"$" }{TEXT -1 2 " . " }}{PARA 0 "" 0 "" {TEXT -1 25 "We did that above. We got" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "theta[1](x);\ntheta[2](x);\ntheta[3 ](x);\ntheta[4](x);" }}}{PARA 0 "" 0 "" {TEXT -1 38 "STEP 2: Form the \+ Fourier coefficients." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 263 "a[ 1]:=int(abs(t)*theta[1](t),t=-1..1)/int(theta[1](t)^2,t=-1..1);\na[2]: =int(abs(t)*theta[2](t),t=-1..1)/int(theta[2](t)^2,t=-1..1);\na[3]:=in t(abs(t)*theta[3](t),t=-1..1)/int(theta[3](t)^2,t=-1..1);\na[4]:=int(a bs(t)*theta[4](t),t=-1..1)/int(theta[4](t)^2,t=-1..1);" }}}{PARA 0 "" 0 "" {TEXT -1 30 "STEP 3: Write down the answer." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 51 "sum(a[p]*theta[p](x),p=1..3);\napprox:=unapply (%,x);" }}}{PARA 0 "" 0 "" {TEXT -1 58 "You might like to see the grap h of these two superimposed." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "plot([abs(x),approx(x)],x=-1..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 11 "Assignment:" }{TEXT -1 110 " Find the \"best approximati on\" in C([-1, 1]) to the absolute value function with a polynomial of degree four. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 18 "Remarks in closing" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 227 "Perhaps it is no surprise that Maple a lready knows these polynomials on [-1, 1]. After all, polynomial appro ximations for functions is common. Here is how to access these in Mapl e and a listing of the first four for comparison." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(orthopoly);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "theta[1](x);P(0,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[2](x);P(1,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[3](x);P(2,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "theta[4](x);P(3,x);" }}}{PARA 0 "" 0 "" {TEXT -1 111 "We see that Maple's listing of the Legendre Polynomials differs from \+ our computation only by a constant factor." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 200 "Finally, we verify that if we \+ found the cubic polynomial closest to |x| in C([-1, 1]) as a freshman \+ would -- take the derivative and set it equal to zero, then we get th e same answer as we did above." }}{PARA 0 "" 0 "" {TEXT -1 46 "We will define the generic cubic polynomial as" }}{PARA 0 "" 0 "" {TEXT -1 6 " " }{XPPEDIT 18 0 "a+b*x+c*x^2+d*x^3;" "6#,*%\"aG\"\"\"*&%\"bGF% %\"xGF%F%*&%\"cGF%*$)F(\"\"#F%F%F%*&%\"dGF%*$)F(\"\"$F%F%F%" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 26 "We restart Maple to clear " } {TEXT 260 9 "a, b, c, " }{TEXT -1 4 "and " }{TEXT 261 2 "d." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "res tart;" }}}{PARA 0 "" 0 "" {TEXT -1 73 "First, we compute the distance \+ from |x| to an arbitrary cubic polynomial." }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 42 "int((a+b*x+c*x^2+d*x^3-abs(x))^2,x=-1..1);" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT -1 45 "Now, we define this as the distance function." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "dist: =unapply(%,(a,b,c,d));" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT -1 49 "We set up the four equations with four unknowns. " }}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 105 "eq:=diff(dist(a,b,c,d),a)=0,diff(dist(a,b,c ,d),b)=0,\n diff(dist(a,b,c,d),c)=0,diff(dist(a,b,c,d),d)=0;" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT -1 44 "We solve these equations f or a, b, c, and d." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "solve( \{eq\},\{a,b,c,d\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "ass ign(%);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT -1 37 "We define the \+ polynomial and compare." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "a +b*x+c*x^2+d*x^3;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT -1 126 "Thi s answer calculated in the manner of freshmen is the same as the metho d of orthogonal polynomials and Fourier Coefficients." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 1 " " }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }