MathGroup Archive 2007

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

Search the Archive

Re: neat way to program minimum of sum


This just came to my mind:

x[t_]:=x[t]=Random[]
f[t_]:=Length[NestWhileList[# + x[#] &, 0, # <= t &]]

But this is quite crazy!! It generates the list but not indexed by
integers but by some real numbers (increasing, if only we don't get a
'0'...).

To Norbert Marxer:
What if I want to plot this function? Saving the values of x for later
is mandatory.

Thanks to everybody for answers,
P. Kaminski



  • Prev by Date: Re: Assign delayed but fixed value
  • Next by Date: how to make myVec[v,3] to return {v_1, v_2, v_3} ?
  • Previous by thread: Re: neat way to program minimum of sum
  • Next by thread: minmum of a function