Re: Imperfect random permutation of 2^k elements
From: Tim Smith (reply_in_group_at_mouse-potato.com)
Date: 04/11/04
- Next message: Gary Shannon: "Re: true random number generator"
- Previous message: Mok-Kong Shen: "Re: Memorizing passphrase"
- In reply to: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Next in thread: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Reply: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 11 Apr 2004 00:58:45 GMT
In article <fcZdc.20640$tu5.3633@newssvr27.news.prodigy.com>, Bryan Olson
wrote:
> Benjamin Goldberg posted a shuffling algorithm that uses random bit
> sequences even more directly. See "Anti-sorting" sci.crypt, 2002-05-12
> currently available at:
>
> http://www.google.com/groups?selm=3CDE55AF.708814A1%40earthlink.net
>
> Goldberg's original post didn't claim it to be "perfect" in the same sense
> as algorithm P, but I thought it was interesting enough to examine, and I
> found that it does in fact generate all permutations with equal
> probability.
>
> http://www.google.com/groups?selm=3CDE8C65.4010400%40nowhere.org
I haven't analyzed the psuedocode in the first referenced post above, but
the C code given doesn't generate all permutations with equal probability.
It generates a subset of the permutations. Within that subset, all the
permutations seem to equally probable. For example, for 4 items, it only
generates:
0 1 2 3
0 2 1 3
1 0 2 3
1 2 0 3
2 0 1 3
2 1 0 3
I notice from later discussions in the thread that the C code has some
optimizations, so perhaps those optimizations broke something?
-- --Tim Smith
- Next message: Gary Shannon: "Re: true random number generator"
- Previous message: Mok-Kong Shen: "Re: Memorizing passphrase"
- In reply to: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Next in thread: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Reply: Bryan Olson: "Re: Imperfect random permutation of 2^k elements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|