OnLine2-1-TestingLinInd.mws

Linear Algebra Powertool

Testing For Linear Independence

On Line Section 2.1

Worksheet by Michael K. May S.J., revised by Russell Blyth

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

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

Outline

This worksheet covers material that corresponds to section 2.1 of the text.

The basic objectives are:

Part 1: The Linear Independence of the Column Vectors of a Matrix

Given a set of vectors, S = { V[1] , ... , V[m] }, there are a number of questions we might ask concerning linear independence:

We first look at the case where the vectors are in R^n .

For the first example, consider a set of 5 vectors in R^3

> v1 := vector(3,[1,2,3]); v2 := vector(3,[1,2,5]);
v3 := vector(3,[2,4,8]); v4 := vector(3,[1,1,1]);
v5 := vector(3,[-4,14,-26]);

v1 := vector([1, 2, 3])

v2 := vector([1, 2, 5])

v3 := vector([2, 4, 8])

v4 := vector([1, 1, 1])

v5 := vector([-4, 14, -26])

Put the vectors together into a matrix (as column vectors).

> MatOfVec := augment(v1, v2, v3, v4, v5);

MatOfVec := matrix([[1, 1, 2, 1, -4], [2, 2, 4, 1, ...

Next we compute the rank and row reduce the matrix to find a reduced echelon form.

> rank(MatOfVec);
RedMat := gaussjord(MatOfVec);

3

RedMat := matrix([[1, 0, 1, 0, 47], [0, 1, 1, 0, -2...

We conclude that:

> B:= vector(3,[0,0,0]);
gensol := linsolve(MatOfVec,B);

B := vector([0, 0, 0])

gensol := vector([-_t[1]-47*_t[2], -_t[1]+29*_t[2],...

> subs(_t[1]=1,_t[2]=0,op(gensol));
subs(_t[1]=0,_t[2]=1,op(gensol));

vector([-1, -1, 1, 0, 0])

vector([-47, 29, 0, 22, 1])

The first particular solution says that v3 = v1 + v2. The second particular solution says v5 = 47v1 - 29v2 - 22v4. Note that the reduced echelon matrix has the appropriate coefficients already computed in terms of the pivots.

Exercises:

1) Explain why we are justified in using the reduced form of the matrix to draw conclusions about the original set of vectors. (Your answer should connect equations of vectors to solutions of systems of equations.)

>

2) (Read carefully:) Use the phone numbers of 5 friends to produce 7 vectors in R^5 . Find a maximal linearly independent subset of the vectors. Express the other vectors as linear combinations of vectors in the subset.

>

3) Is the set S={ matrix([[1, 0], [0, 1]]) , matrix([[3, 2], [-1, 2]]) , matrix([[-2, 1], [6, 7]]) , matrix([[-5, -3], [8, 6]]) ])} of 2 x 2 matrices linearly independent? (Show the appropriate system of linear equations that you need to solve as part of your solution.)

>

Part 2: Showing a set of functions is linearly independent

Another vector space we are interested in is the space of real-valued functions with domain all reals.

To show that the functions x^2 , sin(x), and sin(2x) are linearly independent, we need to show that the equation


a1*x^2 + a2*sin(x) + a3*sin(2*x) = 0


has only the trivial solution (for unknowns a1, a2 and a3). Thus we need to show that the equation does not hold if any of the ai has a nonzero value. The trick is to note that any solution that works for all values of x must work for particular values of x. Plugging in some well chosen values for x gives us linear equations in a1, a2, and a3. Since there are three unknowns we want to use at least three equations. (We will try four equations just to be safe.)

> veceqn := a1*x^2 + a2*sin(x) + a3*sin(2*x) = 0;
val1 := simplify(subs(x=Pi/4,veceqn));
val2 := simplify(subs(x=Pi/2,veceqn));
val3 := simplify(subs(x=Pi,veceqn));
val4 := simplify(subs(x=3*Pi/4,veceqn));

veceqn := a1*x^2+a2*sin(x)+a3*sin(2*x) = 0

val1 := 1/16*a1*Pi^2+1/2*a2*sqrt(2)+a3 = 0

val2 := 1/4*a1*Pi^2+a2 = 0

val3 := a1*Pi^2 = 0

val4 := 9/16*a1*Pi^2+1/2*a2*sqrt(2)-a3 = 0

> solve({val1, val2, val3, val4},{a1, a2, a3});

{a1 = 0, a2 = 0, a3 = 0}

Since we have shown the system of equations obtained by using specific values of x only has the trivial solution, we have shown that veceqn can only have the trivial solution.

>

Exercises:

4) Show that the functions sin(x), sin(2x), and sin(3x) are linearly independent.

>

5) Show that the functions e^x , e^(2*x) and e^(-x) are linearly independent. (Recall that the function e^x is written exp(x) in Maple.)

>

Part 3: Showing a set of functions is linearly dependent

If we show vectors are independent by showing that the vector equation has no nontrivial solution, it follows that we show a set of vectors is dependent if we find a nontrivial solution to that equation. As an example, suppose we want to test the independence of the set of functions { e^x , sinh(x), cos(x), cosh(x)}. (For the time being, pretend that you have forgotten the definitions of sinh(x) and cosh(x).)

> veceqn := a1*exp(x) + a2*sinh(x) + a3*cos(x) +a4*cosh(x) = 0;
val1 := simplify(subs(x=0,veceqn));
val2 := simplify(subs(x=Pi/2,veceqn));
val3 := simplify(subs(x=Pi,veceqn));
val4 := simplify(subs(x=1,veceqn));
val5 := simplify(subs(x=3*Pi/2,veceqn));
sol1 :=solve({val1, val2, val3, val4, val5});

veceqn := a1*exp(x)+a2*sinh(x)+a3*cos(x)+a4*cosh(x)...

val1 := a1+a3+a4 = 0

val2 := a1*exp(1/2*Pi)+a2*sinh(1/2*Pi)+a4*cosh(1/2*...

val3 := a1*exp(Pi)+a2*sinh(Pi)-a3+a4*cosh(Pi) = 0

val4 := a1*exp(1)+a2*sinh(1)+a3*cos(1)+a4*cosh(1) =...

val5 := a1*exp(3/2*Pi)+a2*sinh(3/2*Pi)+a4*cosh(3/2*...

sol1 := {a4 = a2, a2 = a2, a1 = -a2, a3 = 0}

Note that instead of finding only the trivial solution, we get a one parameter family of solutions. Setting a4 to 1, we get the equation

-( e^x ) + sinh(x) + cosh(x) = 0

which is a dependency relation if it is true. (It follows easily from the definition of sinh(x) and cosh(x).) Now that we have a candidate nontrivial solution for the vector equation, we want to see if it works for all values of x, or perhaps only for the 5 values we chose. We can check intervals by plotting the graph.

> plot({-exp(x) + sinh(x) + cosh(x),x}, x=-10..10,axes=boxed);

[Maple Plot]

(We plotted the function y=x as well to give a reasonable viewing window. If we plot just the linear combination we can get problems arising from cancellation errors.) Thus we see that we have found a dependency relationship between the functions, so they are linearly dependent. (Actually, we only showed the functions are dependent on the domain from -10 to 10. We rely on a theorem beyond the scope of this class to claim that we have shown enough.)

The technique we used to find the coefficients of a dependence relationship can run into trouble if the values of x we choose fit too nicely. Consider a slight variation on the functions from exercise 4 above

> veceqn := a1*sin(x) + a2*sin(2*x) + a3*sin(4*x) = 0;
val1 := simplify(subs(x=0,veceqn));
val2 := simplify(subs(x=Pi/2,veceqn));
val3 := simplify(subs(x=Pi/4,veceqn));
val4 := simplify(subs(x=3*Pi/4,veceqn));
val5 := simplify(subs(x=Pi,veceqn));
sol1 :=solve({val1, val2, val3, val4, val5},{a1,a2, a3});

veceqn := a1*sin(x)+a2*sin(2*x)+a3*sin(4*x) = 0

val1 := sin(0)*(a1+a2+a3) = 0

val2 := a1*sin(1/2*Pi)+a2*sin(Pi)+a3*sin(2*Pi) = 0

val3 := a1*sin(1/4*Pi)+a2*sin(1/2*Pi)+a3*sin(Pi) = ...

val4 := a1*sin(3/4*Pi)+a2*sin(3/2*Pi)+a3*sin(3*Pi) ...

val5 := a1*sin(Pi)+a2*sin(2*Pi)+a3*sin(4*Pi) = 0

sol1 := {a2 = 0, a3 = a3, a1 = 0}

Since a3 is a parameter which does not appear elsewhere in thre solution, this seems to suggest that sin(4x) = 0. Clearly this is false. We need to include a point where the third function is not zero.

Exercises:

6) Find a dependence relationship for the functions e^x , e^(-x) , and sinh(x).

>

7) Find a dependence relationship for the functions e^x , e^(-x) , and cosh(x).

>

8) As mentioned above, the technique we used to find the coefficients of a dependence relationship can run into trouble if the values of x we choose fit too nicely. Explore what happens if we test the linear independence of sin(x), sin(3x), and sin(5x) with x taking on the values 0, Pi/2, Pi, 3Pi/2, and 2Pi. Graphically show that the proposed dependence relation is false. Show that the functions are actually linearly independent.

>

>

>