Math 615: October 14, 2015
The Table Function

Question: Are the functions {sin(x), sin(2x), sin(3x)} linearly independent in the vector space of real-valued functions?

To show they are linearly independent, we must show that the only solution (r1, r2, r3) to the equation
r1 sin(x) + r2 sin(2x) + r3 sin(3x) = 0 is r1=r2=r3=0.  Note that this equation is an equation of functions; it must hold for all values of x.

Therefore, we can try to evaluate at a few values of x to obtain a linear system.  Evaluating at x=1, x=2 and x=3 gives us the following, we see that the three functions are linearly independent.

RowReduce[(({{Sin[1], Sin[2], Sin[3]}, {Sin[2], Sin[4], Sin[6]}, {Sin[3], Sin[6], Sin[9]}}))] // MatrixForm

Can we “automate” this process?  Yes!  Use the Table function.  Here is the documentation.

?Table

In the above example, we can perform our calculation by first using the Table to create our matrix.

(a = Table[ {Sin[x], Sin[2x], Sin[3x]}, {x, 1, 3}] ) // MatrixForm
RowReduce[a] // MatrixForm

In fact, we could use the Table function twice to create our matrix.  First note that...

Table[Sin[k x], {k, 1, 3}]

Therefore, we can use nested Table functions to create a list of lists.

a=Table[Table[Sin[k x], {k, 1, 3}], {x, 1, 3}]
MatrixForm[a]
RowReduce[a] // MatrixForm

Question: Is {sin(x), sin(2x), sin(3x), ..., sin(25x) } linearly independent?

Solution: Use the same process as above.  Note that we will need to evaluate the functions at at least 25 different values of x.

a=Table[Table[Sin[k x], {k, 1, 25}], {x, 1, 25}];
MatrixForm[a]
RowReduce[a] // MatrixForm

As discussed in class, symbolic computations take much longer to perform.  The above calculation may take a very long time to perform.  In such a case, select the “Evaluation” menu and “Abort Evaluation.”

Let’s run the above again, but this time using numerical values.

a=N[Table[Table[Sin[k x], {k, 1, 25}], {x, 1, 25}]];
MatrixForm[a]
RowReduce[a] // MatrixForm

If we had evaluated at even more test points, it would not have hurt.  It would just give us redundant information.

a=N[Table[Table[Sin[k x], {k, 1, 25}], {x, 1, 35}]];
MatrixForm[a]
RowReduce[a] // MatrixForm

Question: are the functions {sin(π x), sin(2π x), sin(3π x), ..., sin(10π x)} linearly independent?

If we only evaluate at integers, we will not be able to determine the answer.

a=Table[Table[Sin[k π x], {k, 1, 10}], {x, 1, 10}];
MatrixForm[a]
RowReduce[a] // MatrixForm

In this situation, we should try using a different step size.

a=Table[Table[Sin[k π x], {k, 1, 10}], {x, 1, 2, .1}];
MatrixForm[a]
RowReduce[a] // MatrixForm

Whoops, the above does not yet show linear independence.  Let’s evaluate at a few more values of x.  This will allow us to conclude the functions are linearly independent.

RowReduce[
Table[Table[Sin[k π x], {k, 1, 10}], {x, 1, 2, .05}]   ] // MatrixForm