D
Duaa Momani
Guest
Hi,
I am using the PHP random function (rand(start,end)) but I have noticed that whatever number of times I run the function, it gives me about 25% of randoms generated in the first quarter of range, and 25% of the second one and so on...
e.g. if I used rand(1,4) and ran this function 10000 times or even 100000000 times then I got the following percentages:
Number of 1's generated = almost 25% of all numbers generated
number of 2's = about 25%
number of 3's = about 25%
number of 4's = about 25%
My question is: how can I get more variations and not getting these very close percentages?
I tried generating like rand(0,1000) or rand(0,1000000000) and tried a lot of small or large numbers but I still getting the same problem...
I am using the PHP random function (rand(start,end)) but I have noticed that whatever number of times I run the function, it gives me about 25% of randoms generated in the first quarter of range, and 25% of the second one and so on...
e.g. if I used rand(1,4) and ran this function 10000 times or even 100000000 times then I got the following percentages:
Number of 1's generated = almost 25% of all numbers generated
number of 2's = about 25%
number of 3's = about 25%
number of 4's = about 25%
My question is: how can I get more variations and not getting these very close percentages?
I tried generating like rand(0,1000) or rand(0,1000000000) and tried a lot of small or large numbers but I still getting the same problem...