Re: neat way to program minimum of sum

*To*: mathgroup at smc.vnet.net*Subject*: [mg75180] Re: neat way to program minimum of sum*From*: CoolGenie <CGenie at gmail.com>*Date*: Thu, 19 Apr 2007 04:37:40 -0400 (EDT)*References*: <f01360$889$1@smc.vnet.net><f04n7n$8cs$1@smc.vnet.net>

On 18 Kwi, 11:09, Norbert Marxer <mar... at mec.li> wrote: > f[t_] := Length@NestWhileList[( > s = s + Random []) &, s = Random[], (s < t) &] - 1 This is nice but not satisfactory. The statement is that I have the values x[1], x[2], ... given first and then based on these I want to generate the minimum (should be minimum there, not maximum). I think that the code you suggested will give different answer every time... If I'm wrong please correct me. P. Kaminski