Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: getting one random number

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65176] Re: getting one random number
  • From: albert <awnl at arcor.de>
  • Date: Thu, 16 Mar 2006 06:33:37 -0500 (EST)
  • References: <dvas8g$c37$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Kevin,

> When I exicute the line below, mathematica takes a new random number for
> each element in the list "k[dist]"

... because you said so :-)

> l[dist_] := Map[# < Random[] &, k[dist]]

One of million possibilities would be:

l[dist_] := With[{r=Random[]},Map[# < r &, k[dist]]]

hth,

albert


  • Prev by Date: Re: getting one random number
  • Next by Date: Re: Unevaluated a[[1]]*a[[2]]
  • Previous by thread: Re: getting one random number
  • Next by thread: Re: getting one random number