MathGroup Archive 2007

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

Search the Archive

Re: Quick Question


On 6/22/07 at 6:50 AM, cronin_rob at hotmail.com (rob cronin) wrote:

>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.

Load the package Combinatorica` and use the function RandomPermutation or r=
oll your own. For example,

In[4]:= Nest[
 Insert[Rest@#, First@#, Random[Integer, {1, Length@# - 1}]] &,
 Range@6, 5]

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





--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Combination List
  • Next by Date: Just one "1" in a list
  • Previous by thread: Re: Quick Question
  • Next by thread: Re: Quick Question