[LON-CAPA-users] random_permutation, choosing the $seed

Gerd Kortemeyer korte at lite.msu.edu
Sun Aug 31 21:14:31 EDT 2014

Hi Again,

On Aug 31, 2014, at 8:59 PM, Gerd Kortemeyer <kortemey at msu.edu> wrote:

> The problem may be 1e10 as upper limit - that’s awfully big. While I am unable to verify this right now, I have a vague feeling that a 32-bit integer is expected inside &random_permutation(), and that weird things could happen with the overflows or “negatives.” Maybe try with 1e8 (which is smaller than 2^31) and see if the bias goes away.

I am not sure what “bias” is in this context means, but I just noticed that your array appears to have 10,000 elements, which means there are 10,000! different permutations. Of course 10,000! >> 1e10, so with the a random seed between 1 and 1e10, you’ll never “hit” all possible permutations - is that the “bias”?

- Gerd.

More information about the LON-CAPA-users mailing list