MathGroup Archive 2007

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

Search the Archive

Re: Quick Question


Hi,
perhaps the simplest way is (I took it from the Further Examples for
Random):

In[1]:=
RandomRelist[x_List]:=Block[{n=x,p},Do[p=Random[Integer,
{1,i}];n[[{p,i}]]=n[[{
      i,p}]],{i,Length[x]}];n]

In[2]:=
RandomRelist[Range[6]]

Out[2]=
{6,2,1,4,5,3}


Cheers,
psycho_dad

            rob cronin       :
> Quick Question:
>
> With Mathematica 5.2 is there any way to scramble a simple list of numbers:
> i.e. randomly rearange the list {1,2,3,4,5,6} without any apparent order.
>
> Kind regards
>
> _________________________________________________________________
> Get a preview of Live Earth, the hottest event this summer - only on MSN
> http://liveearth.msn.com?source=msntaglineliveearthhm



  • Prev by Date: Re: Quick Question
  • Next by Date: Re: save as pdf in version 6
  • Previous by thread: Re: Quick Question
  • Next by thread: Re: Quick Question