Choose a random number.

  • Thread starter signerror
  • Start date

Choose a random number.


  • Total voters
    93
  • #76
DaveC426913
Gold Member
18,844
2,314
Is "fine granular stuff from a burst stress ball" an acceptable substitute for sand?
:rofl:
 
  • #77
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:
  • #78
Moonbear
Staff Emeritus
Science Advisor
Gold Member
11,490
52
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?
 
  • #79
201
44
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.
 
  • #80
DaveC426913
Gold Member
18,844
2,314
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.
 
  • #81
Moonbear
Staff Emeritus
Science Advisor
Gold Member
11,490
52
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?
 
  • #82
siddharth
Homework Helper
Gold Member
1,127
0
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
 
  • #83
BobG
Science Advisor
Homework Helper
185
80
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.
 
  • #84
CRGreathouse
Science Advisor
Homework Helper
2,820
0
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!
 
  • #85
Redbelly98
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
12,102
130
2 seems rather unpopular in this poll so far (1 out of 88 responses, 1.1%)
 

Related Threads on Choose a random number.

  • Last Post
Replies
3
Views
4K
Replies
15
Views
3K
Replies
61
Views
29K
Replies
64
Views
31K
Replies
10
Views
3K
Replies
13
Views
3K
Replies
36
Views
5K
  • Last Post
Replies
1
Views
2K
  • Last Post
2
Replies
37
Views
4K
  • Last Post
Replies
4
Views
1K
Top