Re: Quick Question
- To: mathgroup at smc.vnet.net
- Subject: [mg78130] Re: Quick Question
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Sat, 23 Jun 2007 07:16:54 -0400 (EDT)
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