Testing For Linear IndependenceWorksheet by Michael K. May S.J., revised by Russell Blythrestart: with(LinearAlgebra): with(plots): with(plottools):
<Text-field layout="Heading 1" style="Heading 1">Outline:</Text-field>The basic objectives are:1) Use Gauss-Jordan elimination to test the linear independence of column vectors of a matrix.2) Show that a set of real valued functions is linearly independent.3) Show that a set of real valued functions is linearly dependent.
<Text-field layout="Heading 1" style="Heading 1">Part 1: The Linear Independence of the Column Vectors of a Matrix</Text-field>Given a set of vectors, S = {NiMmJSJWRzYjIiIi, ... , NiMmJSJWRzYjJSJtRw==}, there are a number of questions we might ask concerning linear independence:Is S a set of linearly independent vectors?Can we find a maximal linearly independent subset of S?Can we express the other vectors in S as linear combinations of our maximal linearly independent subset?We first look at the case where the vectors are in NiMpJSJSRyUibkc=.For the first example, consider a set of 5 vectors in NiMqJCUiUkciIiQ=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]);Put the vectors together into a matrix (as column vectors).MatOfVec := <v1 | v2 | v3 | v4 | v5>;Next we compute the rank and row reduce the matrix to find a reduced echelon form.Rank(MatOfVec); RedMat := ReducedRowEchelonForm(MatOfVec);We conclude that:1) The rank of the matrix is 3, so the set of 5 column vectors cannot be linearly independent. The biggest subset of linearly independent vectors has size 3.2) The pivots of the reduced echelon form correspond to independent vectors. Thus {v1, v2, v4} is a linearly independent set.3) Reading the coefficients from the reduced matrix, v3 is the sum of v1 and v2, while v5 is equal to 47 times v1 minus 29 times v2 minus 22 times v4.To see why 3) works, compute the general solution of k1v1 + ... + k5v5 = 0:B:= Vector(3,[0,0,0]); gensol := LinearSolve(MatOfVec,B);eval(gensol,{_t0[3]=1,_t0[5]=0}); eval(gensol,{_t0[3]=0,_t0[5]=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.
<Text-field layout="Heading 2" style="Heading 2">Exercises:</Text-field>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 R5. 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=NiM8Ji1JJ21hdHJpeEc2IjYjNyQ3JCIiIiIiITckRitGKi1GJTYjNyQ3JCIiJCIiIzckLCRGKiEiIkYyLUYlNiM3JDckLCRGMkY1Rio3JCIiJyIiKC1GJTYjNyQ3JCwkIiImRjUsJEYxRjU3JCIiKUY8 of 2 x 2 matrices linearly independent? (Show the appropriate system of linear equations that you need to solve as part of your solution.)
<Text-field layout="Heading 1" style="Heading 1">Part 2: Showing a set of functions is linearly independent</Text-field>Another vector space we are interested in is the space of real-valued functions with domain all reals.To show that the functions NiMqJCUieEciIiM=, 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(eval(veceqn,x=Pi/4)); val2 := simplify(eval(veceqn,x=Pi/2)); val3 := simplify(eval(veceqn,x=Pi)); val4 := simplify(eval(veceqn,x=3*Pi/4));solve({val1, val2, val3, val4},{a1, a2, a3});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.
<Text-field layout="Heading 2" style="Heading 2">Exercises:</Text-field>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.)
<Text-field layout="Heading 1" style="Heading 1">Part 3: Showing a set of functions is linearly dependent</Text-field>If we show vectors are independent by showing that the vector equation has no nontrivial solutions, 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 {NiMpJSJlRyUieEc=, 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(eval(veceqn, x=0)); val2 := simplify(eval(veceqn, x=Pi/2)); val3 := simplify(eval(veceqn, x=Pi)); val4 := simplify(eval(veceqn, x=1)); val5 := simplify(eval(veceqn, x=3*Pi/2)); sol1 :=solve({val1, val2, val3, val4, val5});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 -(NiMpJSJlRyUieEc=) + sinh(x) + cosh(x) = 0which 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);(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 aboveveceqn := a1*sin(x) + a2*sin(2*x) + a3*sin(4*x) = 0; val1 := simplify(eval(veceqn, x=0)); val2 := simplify(eval(veceqn, x=Pi/2)); val3 := simplify(eval(veceqn, x=Pi/4)); val4 := simplify(eval(veceqn, x=3*Pi/4)); val5 := simplify(eval(veceqn, x=Pi)); sol1 :=solve({val1, val2, val3, val4, val5},{a1,a2, a3});Since a3 is a parameter which does not appear elsewhere in the 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.
<Text-field layout="Heading 2" style="Heading 2">Exercises:</Text-field>6) Find a dependence relationship for the functions ex, e-x, and sinh(x).7) Find a dependence relationship for the functions ex, 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.