I have a program which generates random numbers. How can I test if the random number generator is generating actual random numbers?
|
|
If numbers are being computer generated, they won't be truly random, they will be pseudo-random numbers. I would head over to math.stackexchange.com to get a good understanding of the problem you are trying to test. Some good, related questions are: How to generate REAL random numbers with some random and pseudo random You should also look in to ways you can automate the testing. To truly test this you will need to test a very large sample size, and then visualise the distribution of results. |
||||
|
|
i think u should have to try for limit..i mean make that field for 1 to 9 no. only and see what are the results i dont know whether its gonna work or not...but this is a good Question.! |
|||||||||||
|
|
See for example http://en.wikipedia.org/wiki/Statistical_randomness for a list of possible tests to check randomness of the generator. http://en.wikipedia.org/wiki/Random_number_generation gives pointers to other things you might be interested in your generator. |
|||
|
|
|
Try this document - Chapter 10 of Beautiful Testing For a simple example, have a look at this example blog post from Alan Page |
|||||||
|