MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Strange Nest behaviour with functions

  • To: mathgroup at
  • Subject: [mg114099] Strange Nest behaviour with functions
  • From: István Zachar <zac at>
  • Date: Tue, 23 Nov 2010 06:01:36 -0500 (EST)

Dear Group,

could someone please explain why Nest yields different results for
pure and non pure functions for certain parameter values? The first
example (with r = 3.5) produces the same lists, while the second (with
r = 3.6) fails to do that. Should pure and non-pure functions differ
in this aspect? For larger values of r, the divergence is even more

In[60]:= func[r_,x_]:=r x (1-x);
		d1=Nest[r # (1-#)&,Range[0,1,0.2],100]

Out[62]= {0.,0.826941,0.38282,0.38282,0.826941,0.}
Out[63]= {0.,0.826941,0.38282,0.38282,0.826941,0.}
Out[64]= True

In[65]:= r=3.6;
		d1=Nest[r # (1-#)&,Range[0,1,0.2],100]

Out[66]= {0.,0.899672,0.456407,0.456408,0.899672,0.}
Out[67]= {0.,0.899672,0.456409,0.456409,0.899672,0.}
Out[68]= False

  • Prev by Date: Re: Finding shared element in two lists
  • Next by Date: Re: TeXForm issue
  • Previous by thread: Re: "OpenCLLink block size is invalid"
  • Next by thread: Re: Strange Nest behaviour with functions