http://qs1969.pair.com?node_id=552206


in reply to Re: Random 1-1 mapping
in thread Random 1-1 mapping

I've possibly been confusing with the use of the word iterate. The list is actually directly accessible. I can access element x cheaply and statelessly - the records are fixed sized and contiguous.

I just want to walk this list in a well-defined, reproducible, random-order.

I think multiplying by a prime and then dividing by the maximum has something to do with producing the 1-1 mapping (was it RSA or abstract algebra / group/ring theory - I'm too old for this sh*t).

-Andrew.

Replies are listed 'Best First'.
Re^3: Random 1-1 mapping
by QM (Parson) on May 28, 2006 at 19:56 UTC
    1) Did this code/idea help you?

    2) You need an offset if zero is involved.

    3) Yes, multiplying by a prime mod some other prime will do what you want. There are probably several other configurations that will do the same, and some will be better than what I've given. There are numerous approaches, rules, tests, and other info that you can dig up. I'd start with Mathworld or Wikipedia.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of