Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Random 1-1 mapping

by tomazos (Deacon)
on May 28, 2006 at 19:06 UTC ( [id://552206]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://552206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-19 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found