Re: Shuffle problem
- To: mathgroup at smc.vnet.net
- Subject: [mg84974] Re: Shuffle problem
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Mon, 21 Jan 2008 06:58:19 -0500 (EST)
- References: <fn1o0h$9n9$1@smc.vnet.net>
angela wrote: > Hi; > > Is there a way to get Mathematica 6.01 to randomly shuffle a list: Is there a built in command that I am blind to? > > For example: > > {t,t,t,h,h,h} would become something like {t,h,h,t,t,h} > > The lists are of arbitrary length. I wrote my own function but it is kind of slow. > Hi, The Combinatorica package has RandomPermutation[] For version 6: In[5]:= << Combinatorica` In[6]:= RandomPermutation[{t, t, t, h, h, h}] Out[6]= {h, t, t, t, h, h} -- Szabolcs