Math 2325
(Chapter 14) - Iteration of Quadratic Functions

The following program performs quadratic iteration, using the function f(x)=ax(1-x), much as the linear iteration program in Chapter 1 worked.  You must run this program before you do anything else in this notebook; everything else runs independently of one another.

IterQuad[a_,n_,x0_]:=NestList[Function[x,a x(1-x)],x0,n]

Here is an example, where a=1.5, the number of iterations n=50, and the initial value (Subscript[x, 0])=.1.  Always set a to a number between 0 and 4, and (Subscript[x, 0]) to a value between 0 and 1.

IterQuad[1.6,50,.1]

Applications

Cobweb Diagrams

The following program will display a "cobweb" diagram for quadratic iteration, with the same inputs as IterQuad:

ItPoints[itlist_]:=Partition[Drop[Drop[Flatten[Transpose[{itlist,itlist,itlist,itlist}]],1],-1],2];
IterGraph[a_,n_,x0_]:=Show[ListPlot[ItPoints[IterQuad[a,n,x0]],Joined->True,DisplayFunction->Identity],Plot[{x,a x (1-x)},{x,0,1},DisplayFunction->Identity],DisplayFunction->$DisplayFunction]

Here is an example, where  where a=2.6, the number of iterations n=20,and  the initial value (Subscript[x, 0])=.9. In some cases, if n is too large, you will only see a portion of the diagram.

IterGraph[2.6,20,.9]

Feigenbaum Diagram

This program, which takes no input, will produce the Feigenbaum diagram.

FeigDiagram:=Module[{newones,allofthem={}},
Do[newones=Transpose[{Table[a,{100}],Take[IterQuad[a,200,.1],-100]}];
allofthem=Join[allofthem,newones],
{a,0,4,.04}];
ListPlot[allofthem]];

And here is the command to run the program.

FeigDiagram

Sensitive Dependence on Initial Conditions

The following program performs quadratic iteration, with a = 4 fixed, on two initial inputs, (Subscript[x, 1]) and (Subscript[x, 2]).  (To change a, simply replace both occurrences of "4" to whatever value you like.)

IterQuad2[n_,x1_,x2_]:=MatrixForm[Transpose[{Range[n+1],IterQuad[4,n,x1],IterQuad[4,n,x2]}]]

Here is an example where the number of iterations is n=25, and the two initial values are (Subscript[x, 1])= .1and(Subscript[x, 2]) = .1001.

IterQuad2[25,.1,.1001]

Chaos is not Random: Histograms

The following program will perform quadratic iteration (with a=4 fixed), and then report how many of the iterates are in different parts of the interval from 0 to 1. (To change a, simply replace the "4" to whatever value you like.)

RandomIter[n_,x0_,m_]:=Module[{i,iq=IterQuad[4,n,x0]},
Do[Print["The number of values between " ,(i-1)/m, " and ", i/m, " is ", Count[(i-1)/m < # <i/m& /@ iq, True]],
{i,m}]];

Here is an example where the number of iterations is n=1000, the initial value is (Subscript[x, 0])= .768,and the interval from 0 to 1 is being split up into sevenths.

RandomIter[1000,.768,7]

Art Duval, artduval@math.utep.edu
November 21, 2004;
Modified for Mathematica 6
October 21, 2008