(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "NeXT Mathematica Notebook Front End Version 2.2"; NeXTStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8, 24, "Times"; ; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6, 18, "Times"; ; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6, 14, "Times"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20, 18, "Times"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15, 14, "Times"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12, 12, "Times"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 10, "Times"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1, 12, "Courier"; ; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, L1, 10, "Times"; ; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = leftheader, 12; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = leftfooter, 12; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12, "Courier"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; paletteColors = 128; magnification = 125; currentKernel; ] :[font = title; inactive; Cclosed; preserveAspect; startGroup] Inner Products and Gram-Schmidt :[font = subsection; inactive; Cclosed; preserveAspect; startGroup] Review of Norms and Inner Products :[font = text; inactive; preserveAspect; endGroup] Let's recall what the situation is: inspired by the standard norm, we elevate its basic properties into a definition. This definition gives us the ability to invent various concepts of ª lengthº of vectors, which is the main purpose of norms. DEFINITION: A norm on a vector space V is a real valued function ÷ç v÷ç defined for all vectors v in V which has the following properties: For all vectors u, v in V and scalars a, (1) ÷ç u ÷ç ³ 0 with equality if and only if v = 0. (2) ÷ç a u ÷ç = ½a ½ ÷ç u ÷ç. (3) ÷ç u + v ÷ç £ ÷ç u ÷ç + ÷ç v ÷ç. A vector space, together with a norm defined on it, is called a normed vector space. The classical examples are the standard (a.k.a. Euclidean ) norms: EXAMPLE 1: V = R3 and ÷ç(x1, x2, x3) ÷ç = Sqrt [ x12 + x22+ x32 ] EXAMPLE 2: V = C2 and __ __ ÷ç(z1, z2)÷ç = Sqrt [ z1 z1 + z2 z2 ] A non-standard example: EXAMPLE 3: V = R3 and ÷ç(x1, x2, x3)÷ç = ½ x1 ½ + ½ x2 ½ + ½ x3 ½ Norms, by themselves, cannot give us a concept of ªangle between vectorsº which we need for ideas like ª parallelº and ªperpendicular ( = orthogonal)º vectors. For this we need the concept of an ª inner productº, which is again completely inspired by the standard inner products on a vector space. Here is the definition: DEFINITION: An inner product on a vector space V is a scalar valued function defined for all vectors u, v in V which has the following properties: For all vectors u, v, w in V and scalars a, ____ (1) = (if scalars are the reals, ignore the conjugate) (2) = + (3) = a (4) ³ 0 with equality if and only if u = 0. A vector space, together with an inner product on it, is called an inner product space. There are a number of laws that can be deduced from these properties, e.g., that fact that <0, v> = 0 for any vector v. See your text for a larger listing. Some of the more important outcomes of the definition are as follows: (1) We can deduce the Cauchy-Schwarz Inequality: For all vectors u, v in V, ½½2 £ . (2) We can define a norm, called the induced norm, in terms of the inner product: ÷ç u ÷ç = Sqrt [ ] As you might expect, the standard inner products induce the standard norms (check this). (3) Thanks to the Cauchy-Schwarz inequality we can introduce the angle, t, between two vectors u and v by the formula Cos [t] = / (÷ç u ÷ç . ÷ç v ÷ç). In particular, two vectors are orthogonal iff Cos [t] = 0, i.e., = 0. (4) We can calculate the projection p of the vector u along the vector a according to the formula p = proja (u) = ( / ) a Thus we get that u = p + (u - p) is the sum of a vector parallel to a and a vector orthogonal to a. The classical examples are the standard (a.k.a. Euclidean ) inner products: EXAMPLE 4: V = R3 and <(x1, x2, x3) , (y1, y2, y3)> = (x1, x2, x3) . (y1, y2, y3) = x1 y1 + x2 y2 + x3 y3 EXAMPLE 5: V = C2 and __ __ <(z1, z2) , (w1, w2)> = (z1, z2) . (w1, w2) = z1 w1 + z2 w2] A non-standard example: EXAMPLE 6: V = R3 and <(x1, x2, x3) , (y1, y2, y3)> = 4 x1 y1 + 3 x2 y2 + 2 x3 y3 This gives rise to a non-standard norm, namely ÷ç (x1, x2, x3) ÷ç = Sqrt [ 4 x12 + 3 x22 + 2 x32] We'll see another non-standard example in the third section. Here are two more definitions that are inspired by the inner product idea and have proved to be useful. They are motivated by a desire to abstract the good properties of the standard basis e1, e2, ...., en of Rn (or Cn). DEFINITION: a set of vectors v1, v2, ..., vn is an orthogonal set of vectors if = 0 for all i ¹ j. If, in addition, each vi is normal, i.e., has unit length, then we say that the set of vectors is an orthonormal set of vectors. Note that the property of being an orthonormal or orthogonal set is a property of the whole set of vectors. The standard example of an orthonormal set is (what else) the standard basis {e1, e2, ..., en}. Here is an orthogonal set of vectors that is not standard (still using the standard inner product, however): v1 = (1, 1, 0), v2 = (1, -1, 0), v3 = (0, 0, 1). Notice that this set of vectors is not orthonormal, since the first two vectors don't have unit length. This shortcoming is easy to fix up provided the vectors are all nonzero: simply divide each vector by its length to obtain a unit length vector. In this case we would obtain: u1 = (1/Sqrt [2]) (1, 1, 0), u2 = (1/Sqrt [2]) (1, -1, 0), u3 = (0, 0, 1). Here is an important fact about orthogonal sets of nonzero vectors (notice that automatically includes any orthonormal set of vectors): FACT: Any orthogonal set of nonzero vectors is a linearly independent set. Proof: Suppose a linear combination of the orthogonal set v1, v2, ...vn of nonzero vectors added up to 0: c1 v1 + c2 v2 + ... + cn vn = 0. Take the inner product of both sides with the vector vi, use the linearity property of inner products and obtain that 0 = = = c1 + c2 + ... + cn = ci But = ÷ç vi ÷ç2 ¹ 0, since vi is not the zero vector. Hence, we may divide by and obtain ci = 0. This is true for any index i, so the linear combination must be trivial. Therefore, the vectors v1, v2, ...., vn form a linearly independent set. What good are orthonormal sets? Here is a nifty application: suppose we are given a vector u in the vector space V along with a subspace W. The problem is to find the vector in W nearest to u. If you use your 3-D intuition, visualizing V as R3 and W as a plane in R3 through the origin, you will see that what we are really looking for is the projection p of the vector u into the subspace W. That is, a vector p in W such that u - p is orthogonal to all vectors in W. Now if u1, ..., un is an orthonormal basis of W, this projection is easy to find: p = projW (u) = u1 + u2 + ... + un. Check for yourself that u - p is orthogonal to every ui. Since every vector in W is a combination of these ui's, it follows that u - p is orthogonal to every vector in W. This is exactly what we were looking for. ;[s] 448:0,0;267,1;271,2;321,3;323,4;325,5;327,6;451,7;453,8;456,9;458,10;460,11;461,12;509,13;511,14;516,15;518,16;523,17;524,18;526,19;527,20;528,21;530,22;533,23;535,24;543,25;545,26;554,27;556,28;558,29;559,30;561,31;563,32;566,33;568,34;572,35;574,36;577,37;579,38;645,39;664,40;758,41;759,42;768,43;770,44;772,45;773,46;776,47;777,48;780,49;781,50;783,51;785,52;798,53;799,54;800,55;804,56;805,57;806,58;809,59;810,60;811,61;834,62;835,63;860,64;862,65;864,66;865,67;868,68;869,69;870,70;872,71;886,72;887,73;889,74;890,75;894,76;895,77;897,78;899,79;945,80;946,81;953,82;955,83;957,84;958,85;961,86;962,87;965,88;966,89;967,90;969,91;974,92;975,93;977,94;978,95;979,96;980,97;983,98;984,99;986,100;988,101;989,102;992,103;993,104;995,105;996,106;997,107;998,108;1348,109;1361,110;1707,111;1708,112;1816,113;1835,114;1959,115;1960,116;2095,117;2120,118;2156,119;2157,120;2163,121;2164,122;2165,123;2167,124;2168,125;2222,126;2234,127;2270,128;2272,129;2275,130;2277,131;2526,132;2532,133;2534,134;2535,135;2537,136;2540,137;2542,138;2545,139;2547,140;2550,141;2552,142;2553,143;2586,144;2596,145;2675,146;2676,147;2692,148;2693,149;2711,150;2712,151;2749,152;2750,153;2760,154;2766,155;2769,156;2775,157;2850,158;2851,159;2879,160;2880,161;2981,162;2982,163;2994,164;2995,165;2998,166;2999,167;3002,168;3003,169;3009,170;3010,171;3013,172;3014,173;3017,174;3018,175;3027,176;3028,177;3031,178;3032,179;3035,180;3036,181;3043,182;3044,183;3047,184;3048,185;3051,186;3052,187;3059,188;3060,189;3062,190;3063,191;3067,192;3068,193;3070,194;3071,195;3075,196;3076,197;3078,198;3079,199;3100,200;3101,201;3159,202;3160,203;3163,204;3164,205;3170,206;3171,207;3174,208;3175,209;3184,210;3185,211;3188,212;3189,213;3196,214;3197,215;3200,216;3201,217;3208,218;3209,219;3211,220;3212,221;3216,222;3217,223;3219,224;3220,225;3269,226;3270,227;3280,228;3281,229;3284,230;3285,231;3288,232;3289,233;3295,234;3296,235;3299,236;3300,237;3303,238;3304,239;3315,240;3316,241;3318,242;3319,243;3325,244;3326,245;3328,246;3329,247;3335,248;3336,249;3338,250;3339,251;3388,252;3390,253;3393,254;3394,255;3397,256;3398,257;3401,258;3402,259;3404,260;3406,261;3422,262;3423,263;3424,264;3430,265;3431,266;3432,267;3438,268;3439,269;3440,270;3696,271;3697,272;3700,273;3701,274;3710,275;3711,276;3718,277;3719,278;3727,279;3728,280;3764,281;3765,282;3768,283;3769,284;3777,285;3778,286;3787,287;3812,288;3819,289;3820,290;3823,291;3824,292;3843,293;3844,294;3873,295;3874,296;3951,297;3977,298;4171,299;4172,300;4175,301;4176,302;4184,303;4185,304;4302,305;4303,306;4319,307;4320,308;4337,309;4338,310;4640,311;4641,312;4645,313;4646,314;4647,315;4655,316;4670,317;4671,318;4675,319;4676,320;4677,321;4685,322;4701,323;4702,324;4991,325;4992,326;4995,327;4996,328;5002,329;5003,330;5040,331;5041,332;5043,333;5044,334;5048,335;5049,336;5051,337;5052,338;5062,339;5063,340;5065,341;5066,342;5127,343;5128,344;5199,345;5200,346;5215,347;5216,348;5218,349;5219,350;5223,351;5224,352;5226,353;5227,354;5237,355;5238,356;5240,357;5241,358;5267,359;5268,360;5271,361;5272,362;5275,363;5276,364;5281,365;5282,366;5285,367;5286,368;5289,369;5290,370;5301,371;5302,372;5305,373;5306,374;5309,375;5310,376;5336,377;5337,378;5340,379;5341,380;5344,381;5345,382;5354,383;5355,384;5358,385;5359,386;5363,387;5365,388;5367,389;5368,390;5369,391;5371,392;5372,393;5374,394;5375,395;5387,396;5388,397;5443,398;5444,399;5447,400;5448,401;5463,402;5464,403;5499,404;5500,405;5572,406;5573,407;5576,408;5577,409;5586,410;5587,411;5719,412;5720,413;5825,414;5826,415;5882,416;5883,417;5907,418;5908,419;5999,420;6000,421;6016,422;6017,423;6063,424;6064,425;6138,426;6139,427;6147,428;6148,429;6224,430;6225,431;6236,432;6237,433;6243,434;6244,435;6249,436;6250,437;6256,438;6257,439;6268,440;6269,441;6275,442;6276,443;6334,444;6335,445;6392,446;6393,447;6504,-1; 448:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = subsection; inactive; Cclosed; preserveAspect; startGroup] The Gram-Schmidt Algorithm :[font = text; inactive; preserveAspect] Here is the situation: we have a subspace W of R3 given to us by way of a spanning set. W = lin{v1, v2, v3}, where v1 = {1, -1, 1}, v2 = {1, 2, 1}, v3 = {-1, -3, 0}. How can we understand what the subspace looks like? For one thing, we can replace the spanning set by a basis of the space. This tells us the fewest number of vectors of W needed to generate the other vectors of W as linear combinations. Click on the next cells to determine pivot columns of the Row Echelon Form of A = {v1, v2, v3}. ;[s] 21:0,0;51,1;52,2;105,3;106,4;109,5;110,6;113,7;114,8;125,9;126,10;143,11;144,12;160,13;161,14;511,15;512,16;515,17;516,18;519,19;520,20;523,-1; 21:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; autoActive; preserveAspect; startGroup] v1 = N[{1, -1, 1}] :[font = input; preserveAspect] v2 = N[{2, 2, 1}] :[font = input; preserveAspect] v3 = N[{4, 0, 3}] :[font = input; preserveAspect] a = Transpose[{v1,v2,v3}] :[font = input; preserveAspect; endGroup] MatrixForm[RowReduce[a]] :[font = text; inactive; preserveAspect] Now we see that v1 and v2 form a basis for W. In fact, you can figure out a linear combination of v1 and v2 that give v3 from the Row Echelon Form. See it? Click on the next cell for a useful definition: ;[s] 9:0,0;18,1;19,2;25,3;26,4;102,5;103,6;109,7;110,8;209,-1; 9:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] VectorPlot[v_,view_]:= Show[Graphics3D[Join[Map[Line[{{0,0,0},#}]&,v], {PointSize[0.02], Map[Point[#]&,v]}]],Axes->Automatic, AxesLabel->{"x","y","z"}, ViewPoint->view] :[font = text; inactive; preserveAspect] Now let's get a picture of the vectors v1, v2, v3. Click the next cells: ;[s] 7:0,0;40,1;41,2;44,3;45,4;48,5;49,6;74,-1; 7:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] VectorPlot[{v1,v2,v3},{5,-5,10}] :[font = text; inactive; preserveAspect] If you're not satisfied with the picture, move the point of your eyeball {5, -5, 10} around a bit and reclick the previous cell to see it from different angles (don't use {0,0,0}). Rather than work with the basis v1, v2 of W, we would like to work with something like the standard basis e1, e2. In other words, we would rather work with an orthonormal basis of vectors. Is this possible? Yes !! Let's use v1 for our first vector. But this isn't quite right, since v1 does not have unit length. Rather, let's replace v1 by the vector u1 = v1 / ÷ç v1÷ç: ;[s] 22:0,0;218,1;219,2;222,3;223,4;294,5;295,6;298,7;299,8;416,9;417,10;477,11;478,12;532,13;533,14;551,15;552,16;555,17;556,18;560,19;562,20;565,21;569,-1; 22:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,0,0,Symbol,64,12,0,0,0; :[font = input; preserveAspect] u1 = v1 / Sqrt[v1.v1] :[font = text; inactive; preserveAspect] Next, let's replace v2 by a vector orthogonal to v1. In fact, all we have to do is subtract the projection of v2 along u1 from the vector v2 to obtain a vector orthogonal to u1. This won't be a unit length vector, so let's denote the result by u2'. By the way, notice that in the following formula for a projection, we don't divide by the factor u1.u1. Why so? ;[s] 19:0,0;22,1;23,2;52,3;53,4;114,5;115,6;123,7;124,8;142,9;143,10;178,11;179,12;250,13;251,14;355,15;356,16;358,17;362,18;363,-1; 19:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0; :[font = input; preserveAspect] u2p = v2 - (u1.v2) u1 :[font = text; inactive; preserveAspect] Now let's turn u2' into a unit vector u2 by normalizing it. ;[s] 5:0,0;16,1;17,2;39,3;43,4;44,-1; 5:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0; :[font = input; preserveAspect] u2 = u2p/Sqrt[u2p.u2p] :[font = text; inactive; preserveAspect] Finally, let's see what these vectors look like: :[font = input; preserveAspect] VectorPlot[{u1,u2},{5,-5,10}] :[font = text; inactive; preserveAspect] If your'e not convinced that these vectors are orthogonal, you could adjust the viewpoint. Or simply click on the next cell: :[font = input; preserveAspect] u1.u2 :[font = text; inactive; preserveAspect] What we have now is an orthonormal basis of W, namely, the vectors u1 and u2. Consider the following problem: what is the projection of u into W, where u is given by the next cell? Now that we have an orthonormal basis of W, we can use the nice projection formula given in the previous section. That is the next cell. Click it, as well as the cells that verify the correctness of our calculations immediately following. ;[s] 9:0,0;71,1;72,2;78,3;79,4;142,5;143,6;162,7;163,8;437,-1; 9:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] u = {2,1,1} :[font = input; preserveAspect] p = (u1.u)*u1 + (u2.u)*u2 :[font = input; preserveAspect] (u-p).u1 :[font = input; preserveAspect] (u-p).u2 :[font = text; inactive; preserveAspect] O.K., now here's the basic goal of the Gram-Schmidt algorithm: given a linearly independent set of vectors, v1, v2, .... , vn, we would like to replace these vectors by an orthonormal set of vectors u1, u2, .... , un, such that for 1 £ i £ n, the vectors v1, v2, ...., vi have exactly the same span as the vectors u1, u2, .... , ui. Here's how it is done: Given that we already have built orthonormal vectors u1, u2, .... , ui-1 with the desired properties, subtract the projections of vi in each of the directions u1, u2, ...., ui-1 from vi and then normalize the resulting vector ui' by dividing by its length to get the vector ui. Continue in this way til done. Remember that the projection of a vector v in the direction of a unit vector u has the simple formula proju(v) = u Here are the Gram-Schmidt formulas: ui' = vi - u1 - u2 - ... - ui-1, ui = ui' / Sqrt [] Now let's see how this works on our v1, v2 (remember, we don't need v3). Notice that for two vectors, these formulas aren't really new. We already did these calculations. ;[s] 94:0,0;40,1;62,2;112,3;113,4;117,5;118,6;129,7;130,8;206,9;207,10;211,11;212,12;223,13;224,14;243,15;244,16;247,17;248,18;267,19;268,20;271,21;272,22;281,23;282,24;327,25;328,26;332,27;333,28;344,29;345,30;427,31;428,32;431,33;432,34;442,35;445,36;506,37;507,38;536,39;537,40;541,41;542,42;553,43;556,44;564,45;565,46;607,47;608,48;655,49;656,50;733,51;734,52;769,53;770,54;802,55;803,56;861,57;862,58;869,59;870,60;877,61;878,62;881,63;882,64;886,65;887,66;893,67;894,68;897,69;898,70;901,71;902,72;913,73;916,74;919,75;920,76;924,77;927,78;941,79;942,80;943,81;944,82;948,83;956,84;957,85;962,86;963,87;966,88;1005,89;1006,90;1010,91;1011,92;1039,93;1144,-1; 94:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0; :[font = input; autoActive; preserveAspect; startGroup] up1 = v1 :[font = input; preserveAspect] u1 = up1 / Sqrt[up1 . up1] :[font = input; preserveAspect] up2 = v2 - (u1 . v2) u1 :[font = input; preserveAspect; endGroup] u2 = up2 / Sqrt[up2 . up2] :[font = input; preserveAspect] VectorPlot[{u1, u2},{-1,-5,10}] :[font = text; inactive; preserveAspect] Now to see how this works on three or more vectors, do the following: go back to the definition for v1, v2, v3 above and change the vector v3 slightly, so that the three are linearly independent. Then click on the following cells (you may want to adjust perspective in the last cell): ;[s] 9:0,0;103,1;104,2;107,3;108,4;111,5;112,6;143,7;144,8;294,-1; 9:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; autoActive; preserveAspect; startGroup] up1 = v1 :[font = input; preserveAspect] u1 = up1 / Sqrt[up1 . up1] :[font = input; preserveAspect] up2 = v2 - (u1 . v2) u1 :[font = input; preserveAspect] u2 = up2 / Sqrt[up2 . up2] :[font = input; preserveAspect] up3 = v3 - (u1 . v3) u1 - (u2 . v3) u2 :[font = input; preserveAspect; endGroup] u3 = up3 / Sqrt[up3 . up3] :[font = input; preserveAspect] VectorPlot[{u1, u2, u3},{5,-5,10}] :[font = text; inactive; preserveAspect] Just for fun, let's calculate the projection of our vector u from earlier cells into the subspace spanned by the orthonormal set u1, u2, u3. What does this give you? ;[s] 9:0,0;62,1;63,2;136,3;137,4;140,5;141,6;144,7;145,8;174,-1; 9:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] u :[font = input; preserveAspect; endGroup] (u1.u)*u1 + (u2.u)*u2 + (u3.u)*u3 :[font = subsection; inactive; Cclosed; preserveAspect; startGroup] Non-Standard Inner Products :[font = text; inactive; preserveAspect] We are going to look at a problem that, on the face of it, has nothing to do with inner products or even vector spaces. But analysis of the problem will illustrate why it is sometimes useful to develop ideas beyone the level of immediately obvious applications. Sometimes, rather abstract ideas can have unexpected practical applications. Suppose you work for a manufacturer of calculators, and are involved in the design of a new calculator. The problem is this : as one of the ªfeaturesº of this calculator, the designers decided that it would be nice to have a key which calculated a transcendental function. For the sake of argument, we'll take the function to be F[x] = Sin [ Exp [x]]. Of course, it would be more likely that the function would be something like Exp[x] or Log[x], but for purposes of our graphs, the differences I want to highlight for you show up better with this F[x]. Let's suppose that our job is to come up with an adequate way of calculating F[x], say with an error no worse than .1 (yes, I know the error is too large, but this will illustrate what's going on without getting too messy.) Moreover, suppose that it will only be necessary to compute F[x] for values between -1 and 1. Now your job is to find a simple way to calculate values of this function F[x], for -1 £ x £ 1. Polynomials are a natural idea for approximating functions. From a designer's point of view they are particularly attractive because they are so easy to implement. Given the coefficients of a polynomial, it is easy to design a very efficient and compact algorithm for calculating values of the polynomial. Such an algorithm, together with the coefficients of the polynomial, would fit nicely into a small ROM for the calculator, or could even be microcoded into the chip. ;[s] 5:0,0;1323,1;1324,2;1327,3;1328,4;1809,-1; 5:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = text; inactive; preserveAspect] The first idea that ought to occur you comes from Calculus: what about Taylor series, say centered at 0, since our interval is centered about 0. Mathematica has some nice functions for building polynomials. Let's try it. First, make a definition of the function F[x] for Mathematica to work on. :[font = input; preserveAspect] F[x_] := N[Sin[Exp[x]]] :[font = text; inactive; preserveAspect] Now for the Taylor Series of F, say of degree 3 :[font = input; preserveAspect] Series[F[x],{x,0,3}] :[font = text; inactive; preserveAspect] What's the weird stuff, O[x]? It says that the leftover terms behave no worse than a constant times x4, which is O.K. by the Remainder Formula for Taylor Polynomials. To get a sensible form without that last term, do this: ;[s] 3:0,0;103,1;104,2;227,-1; 3:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] q = Normal[Series[F[x],{x,0,3}]] :[font = text; inactive; preserveAspect] Let's plot these functions: :[font = input; preserveAspect] Plot[{F[x], q}, {x, -1,1}] :[font = text; inactive; preserveAspect] Not too good... Go to the previous cells for q and Plot, and change the 3 to a 4 and Enter. Then try a 5. Let's see what the error is. It appears the worst error is at 1. So... ;[s] 3:0,0;46,1;47,2;182,-1; 3:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] N[Abs[F[1] - (q /. {x -> 1})]] :[font = text; inactive; preserveAspect] There is another way, which is the point of this experiment. Let's adopt the point of view that our functions live in the inner product space C[-1,1] of continuous functions on the interval [-1, 1] with the integral type inner product. Now let's try to find the function in the space of cubic (3rd degree) polynomials P3 that is closest to our F[x]. We will build the necessary tools by using definitions of inner products as in class. In the following, we will assume that the independent variable in each function expression is x. ;[s] 5:0,0;321,1;322,2;535,3;536,4;538,-1; 5:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] InProd[f_,g_] := NIntegrate[f g, {x, -1, 1}] :[font = input; preserveAspect] Norm[f_] := Sqrt[InProd[f,f]] :[font = text; inactive; preserveAspect] Now use the Gram-Schmidt algorithm to generate orthonormal polynomials p0, p1, p2, and p3 from the polynomials 1, x, x2, x3. These polynomials are famous enough to have a name attached to them: they are the Legendre polynomials. ;[s] 15:0,0;72,1;73,2;76,3;77,4;80,5;81,6;88,7;89,8;120,9;121,10;124,11;125,12;211,13;231,14;233,-1; 15:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] p0 = 1 :[font = input; preserveAspect] p0 = p0 / Norm[p0] :[font = input; preserveAspect] p1 = x - InProd[p0,x] p0 :[font = input; preserveAspect] p1 = p1 / Norm[p1] :[font = input; preserveAspect] p2 = x^2 - InProd[p0,x^2] p0 - InProd[p1,x^2] p1 :[font = input; preserveAspect] p2 = p2 / Norm[p2] :[font = input; preserveAspect] p3 = x^3 - InProd[p0,x^3] p0 - InProd[p1,x^3] p1 - InProd[p2,x^3] p2 :[font = input; preserveAspect] p3 = p3 / Norm[p3] :[font = text; inactive; preserveAspect] Finally, let's calculate the projection of our F into P2 and see how it does against F[x]. ;[s] 3:0,0;55,1;56,2;91,-1; 3:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] p = InProd[p0,F[x]]p0+InProd[p1,F[x]]p1+InProd[p2,F[x]]p2 :[font = input; preserveAspect] Plot[{F[x],p},{x,-1,1}] :[font = text; inactive; preserveAspect] This isn't so great. Try adding an extra term so as to calculate the projection of F into P3. Testing, for example, at the endpoints, in the following line confirms what the graph suggests. ;[s] 3:0,0;93,1;94,2;193,-1; 3:1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] Abs[F[1] - p /. {x -> 1}] :[font = text; inactive; preserveAspect; endGroup] To summarize: what we have accomplished is to obtain a polynomial of degree 3 that does as nearly as good a job as the 5th degree Taylor polynomial in approximating F[x], at least as far as the worst error is concerned. Could we do better with a third degree? Actually, yes. But we would have to use an even weirder inner product : InProd[f_,g_] = NIntegrate[f g / Sqrt[1 - x^2], {x, -1, 1}]. The resulting orthonormal polynomials that would be generated from 1, x, x2, etc, are also famous enough to have a name: the Tschebychev polynomials. But that's a story for another course...... ;[s] 5:0,0;473,1;474,2;524,3;547,4;595,-1; 5:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = subsection; inactive; Cclosed; preserveAspect; startGroup] Exercises :[font = text; inactive; preserveAspect] (1) For each of the following sets of vectors, produce an orthonormal set which spans the same space as the original vectors: (a) {(1,1,0), (1,0,1), (1,1,1)} (b) {(0,1,1,1), (1,0,1,1), (1,1,2,2), (1,1,1,0)} (c) {(1,0,1,2,-1),(3,-1,3,7,4),(0,0,0,0,0),(-1,3,2,4,7),(-2,5,6,7,9)} :[font = text; inactive; preserveAspect; endGroup; endGroup] (2) Define the inner product f *g by f * g = Integrate [f(x) g(x), {x, 0, p}]. The set of continuous functions with this inner product is an inner product space. (a) Generate an othogonal basis for the span of the set of ªvectorsº {1, Exp[x], Exp [2 x], Exp [3 x]} (Hint: use N to approximate constants.) (b) Now try to generate an othogonal basis from the set of vectors {1, Sin [x], Sin [2 x], Sin [3 x]}. Can you make any further predictions? (c) Let f[x] = x, for -p / 2 £ x < p/2. Find the projection of f onto each of the vectors you obtained in (2b). The series å [(f * Sin [n x]) Sin [n x] + (f * Cos [n x]) Cos [n x] ] is called the Fourier Series of a function f. If f[x] = - f[-x] (as is here) then f * Cos [n x] = 0 "n. ;[s] 24:0,0;75,1;76,2;533,3;534,4;535,5;538,6;539,7;541,8;542,9;548,10;549,11;550,12;551,13;673,14;674,15;758,16;773,17;775,18;776,19;788,20;790,21;845,22;846,23;848,-1; 24:1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,0,0,Symbol,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,64,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,0,0,Symbol,0,12,0,0,0;1,11,8,Times,0,12,0,0,0; ^*)