Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Random 1-1 mapping

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


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

Fixed comments. Been writing in both languages and can now write in neither.

$input is just a scalar. It has the range 0..$max. I don't see where a factorial of the count comes in.

The idea is:

shuffle(42, 10, 0) == 6 shuffle(42, 10, 1) == 1 shuffle(42, 10, 2) == 5 shuffle(42, 10, 3) == 8 shuffle(42, 10, 4) == 3 shuffle(42, 10, 5) == 4 shuffle(42, 10, 6) == 9 shuffle(42, 10, 7) == 2 shuffle(42, 10, 8) == 7 shuffle(42, 10, 9) == 0

?

-Andrew.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found