Tagged Questions
-1
votes
1answer
85 views
Unevenly distributed random number generation [duplicate]
Let's say I have to generate random number from 1 to 100, however, the probability of each number is not 1/100, but a predefined probability.
How to generate that number? I use Ruby/Python.
3
votes
1answer
770 views
How Python random shuffle works?
How shuffle from random works in Python?
I ask because it works very fast. When I try to write shuffle it works 1 minute for 10^6 element, but Python shuffle does that in 8 sec?
3
votes
5answers
402 views
python random with a skew
I am trying to create a very simple evolution algorithm for a creature simulator, what I would like to have is, both creatures have a trait and a dominance level, both noted by ints. their child's ...
4
votes
1answer
320 views
random.choice in other languages
Python has a nice function in the standard library random.choice which returns a random element from a sequence. But none of the other languages I've developed in have thought to include such a ...