Re: looking for random array reshuffling algorithm
From: Rick D. (nomail_at_mail.com)
Date: 03/20/05
- Next message: CBFalconer: "Re: looking for random array reshuffling algorithm"
- Previous message: Gerry Quinn: "Re: Turing machines, quantum computers, and alephs"
- In reply to: Willem: "Re: looking for random array reshuffling algorithm"
- Next in thread: Willem: "Re: looking for random array reshuffling algorithm"
- Reply: Willem: "Re: looking for random array reshuffling algorithm"
- Reply: Marcin Mank: "Re: looking for random array reshuffling algorithm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 20 Mar 2005 21:58:23 +0100
On Sun, 20 Mar 2005 15:38:58 +0000 (UTC), Willem <willem@stack.nl>
wrote:
-snip-
>) A simple (not so random) example:
>)
>) n = 1,2,3,4
>) n+1 = 2,3,4,1
>) n+2 = 3,4,1,2
>) n+3 = 4,1,2,3
>) n+x = .. (loop)
>
>Let me get this correct: You want a single permutation that you can apply
>to an array to get different states, and you want it's period to be as long
>as possible ?
Yes, i'm looking for a fast algorithm that can generate n+1,n+2,..
based on n and reverse it back to n (1 step at a time) and is as
chaotic as possible and has a very big cycle period.
>Or do you want to apply different shuffles every time, and just want them
>to be reversible ?
>
>) I've tried several number regrouping methods. But even when i
>) introduce a random seed to make the process more chaotic they tend to
>) loop (return to the n state) after +/- x=60000 when i use a 20 number
>) array. Which is fast if you consider the fact that there are +/- 20!
>) (=20*19*18*..) possible combinations.
>
>Does it return to the n state exactly, or does it return to one of the
>60000 previous states ?
Right now. After a fixed number of states the process cycles back to
the original state and starts the same cycle again, and again, etc.
I can probably create a somewhat bigger cycle by further adjusting the
seed, but i'm sure there are better and easier ways to do this.
Best regards,
Rick
BTW: To avoid any further confusion i might have caused. With random
shuffling, i mean chaotic shuffling (like a prng), not truly random .
I figured the reversible aspect made that clear, but i guess i should
have been more clear.
- Next message: CBFalconer: "Re: looking for random array reshuffling algorithm"
- Previous message: Gerry Quinn: "Re: Turing machines, quantum computers, and alephs"
- In reply to: Willem: "Re: looking for random array reshuffling algorithm"
- Next in thread: Willem: "Re: looking for random array reshuffling algorithm"
- Reply: Willem: "Re: looking for random array reshuffling algorithm"
- Reply: Marcin Mank: "Re: looking for random array reshuffling algorithm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|