Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

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


  • Prev by Date: PC - Mac Compatibility
  • Next by Date: controlling whether notebook sections open on evaluation
  • Previous by thread: Re: Rearrangement of a sequence into random order
  • Next by thread: Re: Rearrangement of a sequence into random order