Re: Help: Randomizing a List of Numbers
From: John Savard (jsavard_at_excxn.aNOSPAMb.cdn.invalid)
Date: 07/20/04
- Next message: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Previous message: David Eather: "Re: BIS Regulations?"
- In reply to: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Next in thread: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Reply: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 20 Jul 2004 12:36:28 GMT
On Tue, 20 Jul 2004 10:07:46 GMT, Tom St Denis <tom@securescience.net>
wrote, in part:
>Your other post about doing the "swaps" is exactly what I was talking
>against. It's not provably going to get you a uniformly distributed
>permutation.
Huh?
As long as you don't make the mistake of doing the swap between the
item in the list that you're trying to fill permanently, and one of
the locations *already* filled, of course the algorithm I exhibited
provides a uniformly distributed permutation from the space of 10,000!
possibilities. The side effect of shifting around the unallocated
items so as to avoid moving them a lot does not change the fact that
each one still has an equal opportunity of being selected.
The "swap" is *precisely* the optimization required.
John Savard
http://home.ecn.ab.ca/~jsavard/index.html
- Next message: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Previous message: David Eather: "Re: BIS Regulations?"
- In reply to: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Next in thread: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Reply: Tom St Denis: "Re: Help: Randomizing a List of Numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|