MathGroup Archive 2003

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

Search the Archive

Pick random element from list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43276] Pick random element from list
  • From: "Khufu" <a7tv-pbcm at spamex.com>
  • Date: Sat, 23 Aug 2003 08:09:02 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Mathgroup,

Is there a built-in function to pick a random element from a list?

I'm looking for something simple, like:

list = {1,2,3,a,b,c}
PickRandom[list] returns "b", etc.

If this isn't built-in, can anyone suggest a simple/efficient
implementation?

Many thanks,
-K


  • Prev by Date: Those Pesky Minus Signs
  • Next by Date: Help! on vector field around equilibrium of nonlinear system
  • Previous by thread: RE: Those Pesky Minus Signs
  • Next by thread: Re: Pick random element from list