1

The Nest and FixedPoint commands are extra material. Especially the loops of the previous excercise are much easier to implement using Do, While, etc.

In[20]:=

n = Input[] ;

Nest[{#[[1]] + #[[2]], Part[#, 1]} &, {1, 0}, n]

Nest[Append[#, Last[#] + Part[#, -2]] &, {0, 1}, n]

Out[21]=

{89, 55}

Out[22]=

{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89}

In[23]:=

n = Input[] ;

Nest[Append[#, Length[#]^2] &, {0}, n]

Sum[%[[i]], {i, 1, Length[%]}]

Out[24]=

{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100}

Out[25]=

385

This is the Henon map. The Nest function performs OK with this one.

In[26]:=

Nest[Append[#, {1 + Last[#][[2]] - α Last[#][[1]]^2, β Last[#][[1]]}] &, {{0, 0}}, 1000] ;

ListPlot[%]

[Graphics:../HTMLFiles/ex08_solutions_61.gif]

Out[27]=

⁃Graphics⁃


Created by Mathematica  (April 10, 2007) Valid XHTML 1.1!