EC 313   Spring,  2000   Problem Set 1

1.a.  Plot the sine function over {-2 π,2 π}

Plot[Sin[x], {x, -2 π, 2  π}]

1. b. Plot the sine function, nested 5 times, over the same interval.

Plot[Nest[Sin, x, 5], {x, -2 π, 2  π}]

1. c. Plot the sine function, nested 100 and 1000 times over the same interval, and comment on the transformation of the function.

Plot[Nest[Sin, x, 100], {x, -2 π, 2  π}]

Plot[Nest[Sin, x, 1000], {x, -2 π, 2  π}]

The function is turning into a square wave with the same frequency as Sin[x],and its amplitude is decreasing. If nested sufficiently, the amplitude should -> 0.

2. a. Define f[x_] = 1 / (1+x) and use NestList to embed the function within itself.

f[x_] = 1/(1 + x)

NestList[f, x, 6]

b. Apply NestList to the function 20 times, using 1 as the starting point. What pattern is evident in the resulting numerators and denominators?

NestList[f, 1, 20]

The numerators and denominators follow the Fibonacci series, where b(1)=1, b(2)=1, b(3)=b(2)+b(1),...b(j)=b(j-1)+b(j-2).

c. Apply NestList 50 times, and get the numeric result.How does it compare to the "Golden Ratio"?

NestList[f, 1, 50] // N

GoldenRatio // N

?GoldenRatio

Note that the value to which this series is converging is one less than the Golden Ratio.

3. a. Use tbe Table function to produce a table of the powers of x, 0 through 9.

Table[x^i, {i, 0, 9}]

b. Use Table and TableForm to produce a table of the product of (x-j) for i={0,5} and j={0,i}.

TableForm[Table[(x - j)^i, {i, 0, 5}, {j, 0, i}]]

c. Display a 5x5 Vandermonde matrix with elements x(i)^j for i={1,5},j={0,4}.

v = 
        Table[ x [i]^j, {i, 1, 5}, {j, 0, 4}];
MatrixForm[v]

d. Calculate the symbolic determinant of this matrix with Det[] and Factor[]. Is there a discernable pattern?

d = Det[v]

Factor[d]

The determinant of the product of 10 terms, each of which is the difference between one of the x values and a later value.