Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Per cents and Probabilities

by btrott (Parson)
on Jun 25, 2001 at 02:28 UTC ( #91135=note: print w/ replies, xml ) Need Help??


in reply to Per cents and Probabilities

It seems like what you want is biased/weighted random number selection, where the weights are stored as the keys of a hash. You might take a look at this previous node, which has some good responses: Biased random number selection. You could probably adapt one of those responses to your own needs.


Comment on Re: Per cents and Probabilities

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2015-07-30 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls