# Choose a random number.

## Choose a random number.

• Total voters
93
DaveC426913
Gold Member
Is "fine granular stuff from a burst stress ball" an acceptable substitute for sand?
:rofl:

Code:
my @numb = (1 .. 20);

my $num = int(rand(19)); print @numb[$num];
Perl does it for me. I got 9.

EDIT: This is what I get for approaching a simple problem with a solution already in my mind. It might make more sense to just print \$num and ditch the array... :P

Last edited:
Moonbear
Staff Emeritus
Gold Member
So, how do you know a number is generated randomly? Wouldn't even a so-called random number generator need to have some sort of rules to generate the numbers?

So, how do you know a number is generated randomly? Wouldn't even a so-called random number generator need to have some sort of rules to generate the numbers?
A computer cannot generate pure random number. What computer generates is a pseudo random number. For most of the random number applications, pseudo random numbers are more suited than pure random numbers. Pure random numbers have very little applications.

DaveC426913
Gold Member
A computer cannot generate pure random number. What computer generates is a pseudo random number. For most of the random number applications, pseudo random numbers are more suited than pure random numbers. Pure random numbers have very little applications.
You can start with a seed rather than using a system-generated randomizer.

Moonbear
Staff Emeritus
Gold Member
A computer cannot generate pure random number. What computer generates is a pseudo random number. For most of the random number applications, pseudo random numbers are more suited than pure random numbers. Pure random numbers have very little applications.
So, still, how would you know if a number WAS a pure random number? Where do they come from and how would you recognize them?

siddharth
Homework Helper
Gold Member
So, still, how would you know if a number WAS a pure random number? Where do they come from and how would you recognize them?
Maybe using a natural process which is random, like the decay of an atom. If there's geiger counter connected to a computer, and tracks the delay between individual decays.

There are also tests for randomness which may give a pretty good idea of how random a sequence of numbers generated by a pseudo-random number generator are (although, these can easily fail). In fact, in my senior thesis, I have to perform a lattice monte-carlo simulation, and the pseudo-random number generator I use has a period of 219937-1

BobG
Homework Helper
My probability is a little rusty. What sort of discrete probability distribution would theoretically be expected here considering it was truly random? Poisson Distribution? A Bayesian analysis could tell us the probability that this data is actually a random distribution. Might do that later.
If it was truly random, you'd expect a uniform distribution.

If you ask humans to pick a random number from 1 to 20, you'd expect a spike at 17. 37 is an even more popular random number than 17 if the range is 1 to 100. The favorite random number from 1 to 10 is 7.

The question was asked to a non-typical audience. Some of the responders seem more proud of how they picked their random number than they are of the number they picked.

CRGreathouse
Homework Helper
We have 87 responses so far, and the chi-square value, 94.63, is below the 95% threshold of 108.65.

We're still random!

Redbelly98
Staff Emeritus