Hi,
I use the pseudo random number generator from python
This is the code
random_number = random()
random_number = int(round(random_number * 99 + 1))
I use this to get random numbers from 1-100. I collected a lot of random numbers this way and analyzed whether every number was drawn aproximately 1% of the time. This is the case EXCEPT for the numbers 1 and 100 which are drawn approximately 0.5 % of the time. What am I doing wrong. Obviously I want all the numbers to be drawn about 1% of the time.
Many thanks in advance,
Jeroen Eitjes
I use the pseudo random number generator from python
This is the code
random_number = random()
random_number = int(round(random_number * 99 + 1))
I use this to get random numbers from 1-100. I collected a lot of random numbers this way and analyzed whether every number was drawn aproximately 1% of the time. This is the case EXCEPT for the numbers 1 and 100 which are drawn approximately 0.5 % of the time. What am I doing wrong. Obviously I want all the numbers to be drawn about 1% of the time.
Many thanks in advance,
Jeroen Eitjes