CHAPTER 3 PROJECT 1

EXPLORING LINEAR COMBINATIONS AND SUBSPACES

========================================================================================================

BACKGROUND: These illustrations appear in the Background in this Project.

Plotting 3 vectors:

> restart:with(plots):
v:=spacecurve( [3*t, 4*t, 5*t], t = 0..1,color=blue,thickness=3):
w:=spacecurve( [t, 2*t, 4*t], t= 0..1,color=red,thickness=3):
z:=spacecurve( [4*t,6*t,9*t], t=0..1,color=green,thickness=3):
display(v,w,z,orientation=[-70,70],axes=normal);

[Maple Plot]

The plane through these 3 vectors

> with(linalg):plane:=evalm(a*[3,4,5]+b*[1,2,4]);

plane := vector([3*a+b, 4*a+2*b, 5*a+4*b])

> plane2:=plot3d([3*a+b, 4*a+2*b, 5*a+4*b],a=0..2,b=0..2,color=gray):display(plane2,v,w,z,orientation=[-70,70],axes=normal,style=wireframe);

[Maple Plot]

=================================================================

HINTS/ANSWERS TO PROJECT

===============================================================

Project Part 1: Let v = [3,4,5] , w = [1,2,4] and z = [4,6,9]. Graph the subspace which is the plane spanned by the vectors v and w together with the subspace formed by v and z. Show these two subspaces are one and the same.

> with(plots):
planevw:=plot3d([3*a+b, 4*a+2*b, 5*a+4*b], a = -4..4, b=-4..4, color=red):
planevz:=plot3d([3*a+4*b, 4*a+6*b, 5*a+9*b], a = -3..3, b=-3..3, color =green):
display(planevz,planevw,style=patchnogrid,view=[-2..2,-2..2,-4..4]);

[Maple Plot] [Maple Plot]

=======================

Project Part 2: Prove that the vectors [2,3,-5], [4,1,2], and [1,0,-4] are linearly independent using formal methods. Now eyeball the vectors by graphing them all together, using the "display" command. If these vectors are linearly independent they would form a 3-space, which you will be unable to graph in Maple. In fact, you can't graph this subspace in Maple, because it IS ALL of our 3-space (we only have one, the one we live in!). If we lived in 4-dimensions, this would, however, just be one of an infinite number of 3-spaces possible.

> with(linalg):A:=matrix([[2,3,-5],[4,1,2],[1,0,-4]]):rref(A);with(plots):

matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]])

> v:=spacecurve([2*t,3*t,-5*t],t=0..1,color=red,thickness=3):

> w:=spacecurve([4*t,1*t,2*t],t=0..1,color=blue,thickness=3):

> z:=spacecurve([ t,0,-4*t],t=0..1,color=black,thickness=3):

> display(v,w,z);

[Maple Plot] [Maple Plot]

We see, by rotating the diagram that the vectors span a 3-space ("our" 3-space, R^3).

=====================================

Project Part 3: Two subspaces, V and W , are complements of each other if any vector x in Rn can be expressed uniquely as x = v + w where v is in V and w is in W . Let's assume n = 3; i.e., we are in 3-space. Illustrate, using Maple, that the vector spaces

V = { r [2,3,-5] , r a real scalar} and
W = { s[4,1,2] + t[1,0,4], s and t real scalars}

are complements. Is the intersection of V and W the origin alone? Is dim V + dim W = 3?

> restart:with(plots):with(linalg): vplot:=spacecurve([2*r,3*r,-5*r],r=-1..1,color=black,thickness=3):

Warning, new definition for norm

Warning, new definition for trace

> wplot:=plot3d([4*s+t, s,2*s+4*t],s=-1..1,t=-1..1,color=red):

> display(vplot,wplot);

[Maple Plot]

We find the intersection is {0}. Also dim V = 1 and dim W = 2, so dim V + dim W = 3.

===================================================

Project Part 4: How can we tell if a vector lies on a subspace? Does [1,3,4,6] lie on the subspace which is linear combinations of [1,2,4,5], [-1,0,1,3], and [4,5,6,8]?

> with(linalg):
A:=matrix([[1,-1,4,1], [2,0,5,3], [4,1,6,4],[5,3,8,6]]);
rref(A);

A := matrix([[1, -1, 4, 1], [2, 0, 5, 3], [4, 1, 6, 4], [5, 3, 8, 6]])

matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])

S ince this matrix reduces to the identity matrix, representing 4 good dimensions, the vector [1,3,4,6] does NOT lie on the subspace. The last equation says that 0a+0b+0c = 1, impossible. Since the equations are not consistent we cannot express [1,3,4,6] in terms of the other vectors.

=======================================================

Project Part 5 : Exactly what linear combination of [1,3,4,5,], [-1,2,4,0], and [3,4,5,-2] is the vector [6,8, 9,8]? Find your answer by solving the appropriate equations.

We must solve:

[6,8,9,8] = a[1,3,4,5] + b[-1,2,4,0] + c[3,4,5,-2] for a, b , c

> A:=matrix([[1,-1,3,6],[3,2,4,8],[4,4,5,9],[5,0,-2,8]]);

A := matrix([[1, -1, 3, 6], [3, 2, 4, 8], [4, 4, 5, 9], [5, 0, -2, 8]])

> rref(A);

matrix([[1, 0, 0, 2], [0, 1, 0, -1], [0, 0, 1, 1], [0, 0, 0, 0]])

We find that a= 2, b = -1, and c = 1. That is 2 [1,3,4,5,] - [-1,2,4,0] + [3,4,5,-2] =[3,9,13]

========================================================

Project Part 6 : Find the intersection of the planes x + y -z = 1 and x + 3y + z =2.

> with(plots):with(linalg):

> plane1:=implicitplot3d(x+y-z=1,x=-5..5,y=-5..5,z=-5..5,color=red):

> plane2:=implicitplot3d(x+3*y+z=2,x=-5..5,y=-5..5,z=-5..5,color=green):

> display(plane1, plane2,axes=normal);

[Maple Plot]

> A:=matrix([[1,1,-1,1],[1,3,1,2]]);

A := matrix([[1, 1, -1, 1], [1, 3, 1, 2]])

> rref(A);

matrix([[1, 0, -2, 1/2], [0, 1, 1, 1/2]])

The equation of the line intersection is x - 2z = 1/2, y + z = 1/2, or [2z+1/2, -z+1/2, z]

> m3:=spacecurve([2*z+1/2,-z+1/2,z],z=-5..5,color=black,thickness=3):display(plane1,plane2,m3,axes=normal);

[Maple Plot] [Maple Plot]

================================================

Project Part 7: Finding the orthogonal projection of a vector onto a subspace (plane).

> restart:with(plots):with(linalg):

Warning, new definition for norm

Warning, new definition for trace

> v:=vector([1,2,3]):w:=vector([1,0,2]):z:=vector([0,-1,1]):GramSchmidt({w,z},normalized);plane:=evalm(c*w+d*z);

{vector([1/3*3^(1/2), 1/3*3^(1/2), 1/3*3^(1/2)]), vector([0, -1/2*2^(1/2), 1/2*2^(1/2)])}

plane := vector([c, -d, 2*c+d])

> w:=[1/3*3^(1/2), 1/3*3^(1/2), 1/3*3^(1/2)];z:=[0, -1/2*2^(1/2), 1/2*2^(1/2)];

w := [1/3*3^(1/2), 1/3*3^(1/2), 1/3*3^(1/2)]

z := [0, -1/2*2^(1/2), 1/2*2^(1/2)]

> proj:=evalm(dotprod(v,w)*w+dotprod(v,z)*z);

proj := vector([2, 3/2, 5/2])

> plotv:=spacecurve([t,2*t,3*t],t=0..1,color=red,thickness=3):

> plotproj:=spacecurve([2*t,3*t/2,5*t/2],t=0..1,color=green,thickness=3):plotplane:=plot3d([c,-d,2*c+d],c=-4..4,d=-4..4,color=gray,style=patchnogrid):display(plotplane,plotproj,plotv,scaling=constrained,axes=normal,view=[-3..3,-3..3,-3..3]);

[Maple Plot] [Maple Plot]