-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a function that outputs items in a different order depending on a random number. for example 1/2 of the time Popeye's and its will be #1 on the list and Taco Bell and its logo will be #2 and half the time the it will be the other way around. The problem is that when a user reloads or comes…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I would like an algorithm for a function that takes n integers and returns one integer. For small changes in the input, the resulting integer should vary greatly. Even though I've taken a number of courses in math, I have not used that knowledge very much and now I need some help...
An important…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am looking for a random number generator that can be biased. For instance, say I want a random number between 1-5, with the probability being:
1: Comes up 20% of the time
2: Comes up 10% of the time
3: Comes up 40% of the time
4: Comes up 25% of the time
5: Comes up 5% of the time
Is there anything…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
This picture from wikipedia has a nice example of the sort of functions I'd ideally like to generate
http://en.wikipedia.org/wiki/File:Normal_Distribution_PDF.svg
Right now I'm using the Irwin-Hall Distribution, which is more or less a Polynomial approximation of the Gaussian distribution...basically…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to generate random numbers from a gaussian distribution. Python has the very useful random.gauss() method, but this is only a one-dimensional random variable. How could I programmatically generate random numbers from this distribution in n-dimensions?
For example, in two dimensions, the…
>>> More