This is a follow up to the "Ian's Question for Dummies" thread. Yahweh and I both created our own programs to generate random numbers and both noticed that repeative numbers such as 1111 seem to occurs less often than non-repeative numbers (e.g. 5261). I believe this is probably an artifact of the way the computer generates pseudo-random numbers and it reminded me that I really have no idea how the computer generates these numbers.
What I do know is that (usually) you seed the random number generator and it will then generate a sequence of numbers, but it will always produce the same sequence of numbers for a given seed. IIRC, it is also the case that the next number generated will depend on the last number generated. As I understand it the random number generator takes the value from the seed plus the last number generated (I think) and produces the next random number by using some obscure bit of mathematical trickery. But I have no idea what the trickery is?
The numbers generated are considered pseudo-random because if enough trials are run you should get approximately a statistical distribution of all possible numbers. For example, if you use the random number generator to generate a number from 0 to 9 inclusive (i.e. 0,1,2,3,4,5,6,7,8 or 9 - 10 possible values) and you run it 10 million times, you should get roughly a million 0s, a million 1s, a million 2s and so on. I believe this is the objective when designing a random number generator. But, it is possible that if you consider two consecutive digits generated which would have 100 possible values (e.g. 00, 01, 02, ... 99) that you might find the distribution is skewed away from what would be expected based on statistics? I.e. some values, say 37, might have slightly more than the expected 100,000 occurances and others, say 77 have slightly less than 100,000? Does this skewing (if it even exists) get worse with longer sequences of random numbers, e.g. 3 consecutive numbers? 4? 100?
Can anybody elighten me on this?
What I do know is that (usually) you seed the random number generator and it will then generate a sequence of numbers, but it will always produce the same sequence of numbers for a given seed. IIRC, it is also the case that the next number generated will depend on the last number generated. As I understand it the random number generator takes the value from the seed plus the last number generated (I think) and produces the next random number by using some obscure bit of mathematical trickery. But I have no idea what the trickery is?
The numbers generated are considered pseudo-random because if enough trials are run you should get approximately a statistical distribution of all possible numbers. For example, if you use the random number generator to generate a number from 0 to 9 inclusive (i.e. 0,1,2,3,4,5,6,7,8 or 9 - 10 possible values) and you run it 10 million times, you should get roughly a million 0s, a million 1s, a million 2s and so on. I believe this is the objective when designing a random number generator. But, it is possible that if you consider two consecutive digits generated which would have 100 possible values (e.g. 00, 01, 02, ... 99) that you might find the distribution is skewed away from what would be expected based on statistics? I.e. some values, say 37, might have slightly more than the expected 100,000 occurances and others, say 77 have slightly less than 100,000? Does this skewing (if it even exists) get worse with longer sequences of random numbers, e.g. 3 consecutive numbers? 4? 100?
Can anybody elighten me on this?