MathGroup Archive 2007

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

Search the Archive

Re: Noob evaluation question



Hi Rob,

simply fetch the random number before calling Position.

Daniel



heycarnut wrote:

> Hi -

> 

> Helping a buddy out with a small application, and I'm drawing a blank

> on the following.

> 

> Given :

> 

>    Position[{1, 2, 3, 4, 5, 6, 7, 8, 9}, _?(# <= Random[Integer, {1,

> 9}] &)]

> 

> How can we make the generated random number 'fixed' for the evaluation

> of Position, instead of a new number getting generated at each element

> of the list (the above is a simplified and contrived example.)

> 

> Thanks

> Rob

> 

> 




  • Prev by Date: Re: Picking Arguments
  • Next by Date: Re: How do I write tabular output?
  • Previous by thread: Re: Noob evaluation question
  • Next by thread: Re: Noob evaluation question