You are perfectly correcct of course ... I guess that my main problems were twofold ... i didn't test with small sets of data and I just tested by experiment rather than proper analysis of the algorithm. Thanks.
I just checked this with the code that you suggest on my Win32 PC and the "random" numbers appeared the same every time!! So I didn't get the problem. I then checked it using a unix perl and got the example you cited after the fifth trial ... thanks very much - I really appreciate it. It was fun too.
Regards, Marburg (john.keating@may.ie)