What is a group/family of functions that is random but some number(s) are more likely to come?
For example, calling each of this fake functions 10 times give:

  • random2: 2,3,2,4,2,6,7,2,2,2
  • random4: 4,1,2,3,4,4,2,1,4,9

As you can see, random2 gives more number 2, random4 gives more number 4.
Both functions have some patterns (not 100% random).

  • 1
    A "100% random" number generator will have some patterns in it, because a complete lack of "patterns" is itself a predictable pattern. – Ixrec Jun 11 '16 at 9:03
  • 1
    What is the probability distribution of these RNGs? I would usually expect a RNG to create uniformly distributed numbers, though I've also had cases where I needed numbers with a Gaussian distribution. Given an expected distribution, we can use the Chi-Square Test to check whether the actual distribution is OK. In your example, the sample size is to small, but if random2 produces a lot more 2s than any other number, it would be unsuitable as an uniformly distributed RNG: We could also call it flawed, broken, or dangerous. – amon Jun 11 '16 at 9:27

In probability theory, when a random variable is more likely to produce one result than another, we call it biased towards the first result. I would probably call your functions randomBiasedTo2 etc.

  • I don't mean how to name each function, but the group of functions. Using word "biased" I was able to find something. "Biased or weighted random number (generators)" show some results in the google, like this: codetheory.in/… – Darek Nędza Jun 12 '16 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.