Re: Re: Rearrangement of a sequence into random order
- To: mathgroup at smc.vnet.net
- Subject: [mg28461] Re: [mg28444] Re: [mg28434] Rearrangement of a sequence into random order
- From: Wil Kortsmit <rcwil at win.tue.nl>
- Date: Fri, 20 Apr 2001 04:24:11 -0400 (EDT)
- Organization: Technische Universiteit Eindhoven
- References: <200104190726.DAA19424@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hello everybody, Tom De Vries wrote: > > I had this in my files. It uses Sort and an ordering function.... it's > probably one of many ways of doing this.... maybe it will do what you need > it to.... > > In[64]:= > scramble[list_] := Sort[list, (Random[Integer] == 1) &] > > > .... It is a nice exercise to prove that this 'scramble' algorithm does not give a fair 'random permutation'. Of course 'RandomPermutation' does. Wil Kortsmit
- References:
- Re: Rearrangement of a sequence into random order
- From: Tom De Vries <tdevries@shop.westworld.ca>
- Re: Rearrangement of a sequence into random order