Hi all,
i have a problem with the IRAND function…
The following zscript executes IRAND(9) <iterations> times.
For each iteration the script add “1” to the relative vector MoveList(Random Value).
In this way MoveList(i) contains, at the end, how many times the value “i” was been selected (for i=0 to 9).
With 5000 iteration i suppose to see each MoveList(i) with a value of 500 (+/-)…
…but i have the following result:
Number of “0” extracted: 277 (*** strange value )
Number of “1” extracted: 553
Number of “2” extracted: 553
Number of “3” extracted: 561
Number of “4” extracted: 555
Number of “5” extracted: 552
Number of “6” extracted: 566
Number of “7” extracted: 539
Number of “8” extracted: 577
Number of “9” extracted: 267 ( strange value ***)
I have tried again and again, but with the same result (i got different values, but with the same trend to have the first and the last value very strange)
Clearly, the IRAND is NOT uniform !!! (or i have made some mistakes :))
I hope the script will clarify the situation.
The question
Is there some mistakes in my script or IRAND is not uniform ?
Thanks for viewing…and for helping.
cameyo