Forum Stats

  • 3,771,053 Users
  • 2,253,215 Discussions
  • 7,875,717 Comments

Discussions

Random Numbers

User_PB6V4
User_PB6V4 Member Posts: 1 Green Ribbon

So....I have an assignment to write a "dice rolling" program. The thing is, I don't like the "only methods that I know exist." Thought I was onto something but the "comment" I want to read...whelp...I do not have access to.

Regardless, it is said that numbers such as "1" and "2" (for example..Benford's law) occur the most. I am aware that there are MANY theories about numbers and so on and so forth.

That being said, probability "could be" determined based upon all "naturally occurring" number occurrences. It can also be said that humans have generated numbers randomly on their own since the beginning of time. But it is not to be disregarded that "counting" is the common reason behind having numbers in the first place (record keeping). That being said it is extremely hard to generate a "truly random" number. I would like to write a TRUE method for this some day but wonder myself if it will be at all random.

I believe the best way to generate a random number would be in terms of "probability." The flaw in that is probability is more accurate the larger the "set of numbers" is. How can we find a happy medium between small sets, large sets, medium sets, fractional sets, AND infinite sets, or even imaginary sets....


Any suggestions?

Answers

  • John Or
    John Or Member Posts: 2 Green Ribbon

    Most computers have function which generate pseudo random uniform distribution decimal numbers 0 <= rnd < 1 .

    With this you can generate other distributions like normal (Bell Shaped) or Rayleigh, or others.

    Cryptographically secure random number generators are also available.

    Good Luck.


    John Or